Edit esp-downstloungeentry.yaml
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user