diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2025-09-08 15:32:33 +0400 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2025-09-08 15:32:33 +0400 |
commit | adae7311eaec8589d65c52241c21be5625013b08 (patch) | |
tree | 2560ac92dc6c68ae64e3784a69b52510c2f70549 | |
parent | be904eee31224112ef58628e90156617f64ea740 (diff) | |
download | hass-adae7311eaec8589d65c52241c21be5625013b08.tar.gz hass-adae7311eaec8589d65c52241c21be5625013b08.tar.bz2 hass-adae7311eaec8589d65c52241c21be5625013b08.tar.xz hass-adae7311eaec8589d65c52241c21be5625013b08.zip |
Groups might transit from-on-to-on state if e.g. one light is turned off, but group is still on. This fixes it
-rw-r--r-- | blueprints/automation/lights/light_switch.yaml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/blueprints/automation/lights/light_switch.yaml b/blueprints/automation/lights/light_switch.yaml index b3a4f81..c50e603 100644 --- a/blueprints/automation/lights/light_switch.yaml +++ b/blueprints/automation/lights/light_switch.yaml @@ -106,9 +106,9 @@ action: - "{{ trigger.entity_id == light_entity }}" sequence: - service: > - {% if trigger.to_state.state == "on" %} + {% if trigger.from_state.state == "off" and trigger.to_state.state == "on" %} switch.turn_on - {% else %} + {% elif trigger.from_state.state == "on" and trigger.to_state.state == "off" %} switch.turn_off {% endif %} target: |