Edit esp-downstloungeentry.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-25 20:49:58 +12:00
parent ec42542784
commit f2924e1d77
+9
View File
@@ -163,6 +163,15 @@ logger:
# This adds device-specific MQTT command triggers to the common MQTT configuration.
#:########################################################################################:#
mqtt:
# Republish current mirror state whenever MQTT reconnects so the remote device
# knows our view of the state.
on_connect:
- mqtt.publish:
topic: "${mqtt_remote_status_topic}"
payload: !lambda |-
return id(Relay_1).state ? "${mqtt_remote_device_command_on}" : "${mqtt_remote_device_command_off}";
retain: true
on_message:
# Mirror remote state onto Relay_1 (only toggle if a change is needed)
- topic: "${mqtt_remote_status_topic}"