diff options
-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: |