Hello all
I’m trying to make a switch out of a MQTT command to enable/disable the use of a physical switch on a Shelly1.
My Example:
Doorbell is wired into shelly 1. I have tasmota on it. I want to be able to turn on/off the use of the doorbell.
SwitchMode does this (0 makes the doorbell usable, 15 makes it disabled but still sends a MQTT request)
I would like to make a switch in HA that shows when the doorbell is enabled or disabled.
I’ve tried to set it myself but I think I messed up somehow. Basically the switch needs to show as “ON” when SwitchMode is at 0, and “OFF” when it’s at 15. Is this possible? I posted what I’ve been trying below but it’s clearly not right.
Help?
Massive thanks in advance <3
- platform: mqtt
unique_id: doorbell_switch
name: "Doorbell Switch"
state_topic: "stat/tasmota_78273E/RESULT"
command_topic: "stat/tasmota_78273E/RESULT"
availability:
- topic: "stat/tasmota_78273E/RESULT"
payload_on: '{"SwitchMode":"0"}'
payload_off: '{"SwitchMode":"15"}'
state_on: "ON"
state_off: "OFF"
optimistic: false
qos: 0
retain: