From 3ead85ef29580788bd9a74274dfeaaa1377cf4cc Mon Sep 17 00:00:00 2001 From: ESPHome Device Builder Date: Sun, 13 Sep 2026 11:19:34 +1200 Subject: [PATCH] Edit esp-officeduallights.yaml --- esphome/esp-officeduallights.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/esphome/esp-officeduallights.yaml b/esphome/esp-officeduallights.yaml index 11de242..8d7351e 100644 --- a/esphome/esp-officeduallights.yaml +++ b/esphome/esp-officeduallights.yaml @@ -241,13 +241,21 @@ mqtt: payload: "On" then: - script.stop: relay_1_timer_script - - light.turn_on: light_1 + - if: + condition: + lambda: "return !id(relay_1).state;" + then: + - light.turn_on: light_1 - topic: "${mqtt_local_command1_topic}" payload: "Off" then: - script.stop: relay_1_timer_script - - light.turn_off: light_1 + - if: + condition: + lambda: "return id(relay_1).state;" + then: + - light.turn_off: light_1 - topic: "${mqtt_local_command1_topic}" then: @@ -279,13 +287,21 @@ mqtt: payload: "On" then: - script.stop: relay_2_timer_script - - light.turn_on: light_2 + - if: + condition: + lambda: "return !id(relay_2).state;" + then: + - light.turn_on: light_2 - topic: "${mqtt_local_command2_topic}" payload: "Off" then: - script.stop: relay_2_timer_script - - light.turn_off: light_2 + - if: + condition: + lambda: "return id(relay_2).state;" + then: + - light.turn_off: light_2 - topic: "${mqtt_local_command2_topic}" then: