From adae7311eaec8589d65c52241c21be5625013b08 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 8 Sep 2025 15:32:33 +0400 Subject: Groups might transit from-on-to-on state if e.g. one light is turned off, but group is still on. This fixes it --- blueprints/automation/lights/light_switch.yaml | 4 ++-- 1 file 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: -- cgit v1.2.3