From 865596a21de5658a0d96d3491405d13fe639f490 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 21fc4f026998..148e8a312d95 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