Update to auto turn off the cycle (#3391)

* Update to auto turn off the cycle

Addition of service_template to automatically turn off the cycle when the lights reach their minimum or maximum brightness. Validated on my own lights.

* Fixed facepalm

Added the raw/endraw tags to the half I missed
This commit is contained in:
DubhAd 2017-10-18 21:18:26 +01:00 committed by Fabian Affolter
parent 8c6bd973ff
commit 2ca3852dd7

View File

@ -123,7 +123,12 @@ script:
{% endif %}
{{ next }}{% endraw %}
- service: script.turn_on
- service_template: >
{% raw %}{% if states.light.YOUR_LIGHT.attributes.brightness|default(0)|int < states('input_slider.light_maximum')|int %}
script.turn_on
{% else %}
script.turn_off
{% endif %}{% endraw %}
data:
entity_id: script.light_bright_pause
@ -149,7 +154,12 @@ script:
{% endif %}
{{ next }}{% endraw %}
- service: script.turn_on
- service_template: >
{% raw %}{% if states.light.YOUR_LIGHT.attributes.brightness|default(0)|int > states('input_slider.light_minimum')|int %}
script.turn_on
{% else %}
script.turn_off
{% endif %}{% endraw %}
data:
entity_id: script.light_dim_pause