Skip to content

Commit

Permalink
Update to auto turn off the cycle (home-assistant#3391)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
DubhAd authored and fabaff committed Oct 21, 2017
1 parent fbfad8c commit 865596a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/_cookbook/dim_and_brighten_lights.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 865596a

Please sign in to comment.