From 2ca3852dd7d2594c68c4c7f3a9b3c813020b4dce Mon Sep 17 00:00:00 2001 From: DubhAd Date: Wed, 18 Oct 2017 21:18:26 +0100 Subject: [PATCH] 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 --- source/_cookbook/dim_and_brighten_lights.markdown | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/_cookbook/dim_and_brighten_lights.markdown b/source/_cookbook/dim_and_brighten_lights.markdown index 21fc4f02699..148e8a312d9 100644 --- a/source/_cookbook/dim_and_brighten_lights.markdown +++ b/source/_cookbook/dim_and_brighten_lights.markdown @@ -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