285e901087
add missing condition for lights automations add computer lights
67 lines
1.5 KiB
Django/Jinja
67 lines
1.5 KiB
Django/Jinja
{% for light in lights %}
|
|
# {{ light.name }}
|
|
- id: sleep_mode_{{ light.entityId }}
|
|
alias: '[Sleep-Mode] {{ light.name }}'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: {{ light.entityId }}
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.sleep_mode
|
|
state: 'on'
|
|
action:
|
|
- service: light.turn_on
|
|
data:
|
|
kelvin: 2000
|
|
entity_id: {{ light.entityId }}
|
|
mode: single
|
|
- id: sleep_on_{{ light.entityId }}
|
|
alias: '[Sleep-On] {{ light.name }}'
|
|
trigger:
|
|
- platform: time
|
|
at: input_datetime.sleep_mode
|
|
condition:
|
|
- condition: state
|
|
entity_id: {{ light.entityId }}
|
|
state: 'on'
|
|
action:
|
|
- service: light.turn_on
|
|
data:
|
|
kelvin: 2000
|
|
entity_id: {{ light.entityId }}
|
|
mode: single
|
|
- id: day_mode_{{ light.entityId }}
|
|
alias: '[Day-Mode] {{ light.name }}'
|
|
trigger:
|
|
- platform: time
|
|
at: input_datetime.day_mode
|
|
condition:
|
|
- condition: state
|
|
entity_id: {{ light.entityId }}
|
|
state: 'off'
|
|
action:
|
|
- service: light.turn_on
|
|
data:
|
|
kelvin: 3200
|
|
entity_id: {{ light.entityId }}
|
|
mode: single
|
|
- id: day_on_{{ light.entityId }}
|
|
alias: '[Day-On] {{ light.name }}'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: {{ light.entityId }}
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.sleep_mode
|
|
state: 'off'
|
|
action:
|
|
- service: light.turn_on
|
|
data:
|
|
kelvin: 3200
|
|
entity_id: {{ light.entityId }}
|
|
mode: single
|
|
|
|
{% endfor %}
|