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