From d5bf32a37d6f60fce732aa183c60a7b5de51a16a Mon Sep 17 00:00:00 2001 From: ESPHome Device Builder Date: Sat, 25 Jul 2026 13:13:54 +1200 Subject: [PATCH] Edit esp-officeduallights.yaml --- esphome/esp-officeduallights.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/esphome/esp-officeduallights.yaml b/esphome/esp-officeduallights.yaml index 47035be..8648c5a 100644 --- a/esphome/esp-officeduallights.yaml +++ b/esphome/esp-officeduallights.yaml @@ -365,6 +365,28 @@ mqtt: then: - light.turn_off: light_2 + # Mirror shared overhead status from esp-officelights onto light_2. This handles the + # case where the main lightswitch's overhead timer finishes and turns off the overhead. + # State guards prevent ping-pong with the command topic handlers above. + - topic: "${mqtt_shared_overhead_status_topic}" + payload: "${mqtt_command_on}" + then: + - if: + condition: + lambda: "return !id(relay_2).state;" + then: + - light.turn_on: light_2 + + - topic: "${mqtt_shared_overhead_status_topic}" + payload: "${mqtt_command_off}" + then: + - script.stop: relay_2_timer_script + - if: + condition: + lambda: "return id(relay_2).state;" + then: + - light.turn_off: light_2 + #:########################################################################################:# # SCRIPT COMPONENT: # Independent per-relay timer scripts