mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-11-07 01:52:11 +00:00
Allow the outdoor lights to behave like the indoor lights. - Make sense.
This commit is contained in:
@@ -1,135 +1,125 @@
|
||||
##############################################################################
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Here is 5am to 8am
|
||||
##############################################################################
|
||||
|
||||
- alias: detect_light_between 5am and 8am
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: group.family
|
||||
state: home
|
||||
- condition: time
|
||||
after: '05:00:00'
|
||||
- condition: time
|
||||
before: '7:59:00'
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.outdoor' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.garage' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
|
||||
# - condition: template
|
||||
# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 50 }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
brightness: 50
|
||||
|
||||
##############################################################################
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Here is 8am to 8pm
|
||||
##############################################################################
|
||||
|
||||
- alias: detect_light_between 8am and 8pm
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: group.family
|
||||
state: home
|
||||
- condition: time
|
||||
after: '08:00:00'
|
||||
- condition: time
|
||||
before: '20:00:00'
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.outdoor' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
brightness: 255
|
||||
|
||||
##############################################################################
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Here is 8pm to 5am
|
||||
##############################################################################
|
||||
|
||||
- alias: detect_light_between 8pm and 5am
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: time
|
||||
after: '20:00:01'
|
||||
- condition: time
|
||||
before: '12:00:00'
|
||||
- condition: state
|
||||
entity_id: sun.sun
|
||||
state: 'below_horizon'
|
||||
- condition: state
|
||||
entity_id: group.family
|
||||
state: home
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.outdoor' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.garage' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
|
||||
# - condition: template
|
||||
# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 20 }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
##############################################################################
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Here is 5am to 8am
|
||||
##############################################################################
|
||||
|
||||
- alias: detect_light_between 5am and 8am
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: group.family
|
||||
state: home
|
||||
- condition: time
|
||||
after: '05:00:00'
|
||||
- condition: time
|
||||
before: '7:59:00'
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
|
||||
# - condition: template
|
||||
# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 50 }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
brightness: 50
|
||||
|
||||
##############################################################################
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Here is 8am to 8pm
|
||||
##############################################################################
|
||||
|
||||
- alias: detect_light_between 8am and 8pm
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: group.family
|
||||
state: home
|
||||
- condition: time
|
||||
after: '08:00:00'
|
||||
- condition: time
|
||||
before: '20:00:00'
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
brightness: 255
|
||||
|
||||
##############################################################################
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Here is 8pm to 5am
|
||||
##############################################################################
|
||||
|
||||
- alias: detect_light_between 8pm and 5am
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: time
|
||||
after: '20:00:01'
|
||||
- condition: time
|
||||
before: '12:00:00'
|
||||
- condition: state
|
||||
entity_id: sun.sun
|
||||
state: 'below_horizon'
|
||||
- condition: state
|
||||
entity_id: group.family
|
||||
state: home
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
|
||||
# - condition: template
|
||||
# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 20 }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
brightness: 35
|
||||
@@ -8,31 +8,31 @@
|
||||
- name: month_front_1_colors
|
||||
entities:
|
||||
light.outdoor_sconce_2:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Gold'
|
||||
brightness: 255
|
||||
light.outdoor_sconce_1:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Gold'
|
||||
brightness: 255
|
||||
light.outdoor_foyer:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Gold'
|
||||
brightness: 255
|
||||
light.outdoor_sconce_3:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Gold'
|
||||
brightness: 255
|
||||
light.garage_left:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Yellow'
|
||||
brightness: 150
|
||||
light.garage_small:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Yellow'
|
||||
brightness: 150
|
||||
light.outdoor_den:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Yellow'
|
||||
brightness: 150
|
||||
|
||||
@@ -40,62 +40,62 @@
|
||||
entities:
|
||||
|
||||
light.outdoor_foyer:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Blue'
|
||||
brightness: 255
|
||||
light.outdoor_sconce_1:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Gold'
|
||||
brightness: 255
|
||||
light.outdoor_sconce_2:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Blue'
|
||||
brightness: 255
|
||||
light.outdoor_sconce_3:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'Blue'
|
||||
brightness: 255
|
||||
light.garage_left:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'RoyalBlue'
|
||||
brightness: 255
|
||||
light.garage_small:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'RoyalBlue'
|
||||
brightness: 255
|
||||
light.outdoor_den:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'RoyalBlue'
|
||||
brightness: 255
|
||||
|
||||
- name: front_full_brightness
|
||||
entities:
|
||||
light.outdoor_sconce_2:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'White'
|
||||
brightness: 255
|
||||
light.outdoor_sconce_1:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'White'
|
||||
brightness: 255
|
||||
light.outdoor_foyer:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'White'
|
||||
brightness: 255
|
||||
light.outdoor_sconce_3:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'White'
|
||||
brightness: 255
|
||||
light.garage_left:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'White'
|
||||
brightness: 255
|
||||
light.garage_small:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'White'
|
||||
brightness: 255
|
||||
light.outdoor_den:
|
||||
state: on
|
||||
state: 'on'
|
||||
color_name: 'White'
|
||||
brightness: 255
|
||||
|
||||
|
||||
Reference in New Issue
Block a user