mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-02-22 09:01:22 +00:00
37 lines
1.4 KiB
YAML
Executable File
37 lines
1.4 KiB
YAML
Executable File
- 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:00'
|
|
- condition: time
|
|
before: '12:00:00'
|
|
- 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.new_state.attributes is not none }}"
|
|
- condition: template
|
|
value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 254 }}"
|
|
action:
|
|
- service: light.turn_on
|
|
data_template:
|
|
entity_id: "{{ trigger.event.data.entity_id }}"
|
|
brightness: 255 |