From 37faf62809ade11d6f82f6c086283579383a589a Mon Sep 17 00:00:00 2001 From: ESPHome Device Builder Date: Sat, 25 Jul 2026 13:08:53 +1200 Subject: [PATCH] Edit esp-officeduallights.yaml --- esphome/esp-officeduallights.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/esphome/esp-officeduallights.yaml b/esphome/esp-officeduallights.yaml index a99e5de..47035be 100644 --- a/esphome/esp-officeduallights.yaml +++ b/esphome/esp-officeduallights.yaml @@ -124,6 +124,12 @@ substitutions: mqtt_mainlight_function_overhead: "office-main-lights-right" mqtt_mainlight_command_overhead: "${mqtt_command_main_topic}/${mqtt_mainlight_function_overhead}" + # MQTT Overhead Status - shared topic for overhead state sync + # Both this device and esp-officelights publish and subscribe to this topic so + # whichever device's timer finishes first keeps the other in sync. + mqtt_shared_overhead_status_function: "office-overhead-status" + mqtt_shared_overhead_status_topic: "${mqtt_status_main_topic}/${mqtt_shared_overhead_status_function}" + # MQTT Status/Command payloads mqtt_command_on: "On" mqtt_command_off: "Off" @@ -231,6 +237,11 @@ mqtt: payload: !lambda |- return id(relay_2).state ? "${mqtt_command_on}" : "${mqtt_command_off}"; retain: true + - mqtt.publish: + topic: "${mqtt_shared_overhead_status_topic}" + payload: !lambda |- + return id(relay_2).state ? "${mqtt_command_on}" : "${mqtt_command_off}"; + retain: true on_message: - topic: "${mqtt_local_command1_topic}" @@ -465,6 +476,10 @@ switch: topic: "${mqtt_local_status2_topic}" payload: "On" retain: true + - mqtt.publish: + topic: "${mqtt_shared_overhead_status_topic}" + payload: "On" + retain: true - if: condition: switch.is_off: relay_1 @@ -477,6 +492,10 @@ switch: topic: "${mqtt_local_status2_topic}" payload: "Off" retain: true + - mqtt.publish: + topic: "${mqtt_shared_overhead_status_topic}" + payload: "Off" + retain: true - if: condition: switch.is_off: relay_1