mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-11-07 01:52:11 +00:00
Time Sensitive lighting thanks to @DALE3H!
This commit is contained in:
@@ -10,22 +10,12 @@
|
||||
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.new_state is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state is not none }}"
|
||||
- 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 is not none }}"
|
||||
# - condition: template
|
||||
# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 50 }}"
|
||||
action:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
- alias: detect_light_between 8am and 12pm
|
||||
- alias: detect_light_between 8am and 8pm
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
@@ -10,22 +10,12 @@
|
||||
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.new_state is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state is not none }}"
|
||||
- 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 is not none }}"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
|
||||
@@ -11,25 +11,18 @@
|
||||
after: '20:00:00'
|
||||
- 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.new_state is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state is not none }}"
|
||||
- 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 is not none }}"
|
||||
# - condition: template
|
||||
# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 20 }}"
|
||||
action:
|
||||
|
||||
Reference in New Issue
Block a user