You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.2 KiB
33 lines
1.2 KiB
- alias: detect_light_between 8am and 12pm
|
|
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.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:
|
|
entity_id: "{{ trigger.event.data.entity_id }}"
|
|
brightness: 255 |