I’ve managed to get my doorbell to publish mqtt events to the Mosquitto broker installed in my HA instance but I’m having trouble creating the binary sensor to state change on those incoming mqtt events.
My goal is that when the doorbell rings I can trigger an automation to play a sound on several smart speakers.
This is the event that the doorbell emits when someone rings the bell:
No it’s a genuine validation error.
You could only escape the quotes:
\"Start\"
But it wouldn’t make any difference, the quotes aren’t the problem in this logic. I can’t see any reason it wouldn’t work. It may however be worth subscribing to the topic in the MQTT integration page in Home Assistant, just so you can be absolutely certain that what Home Assistant is receiving, matches what you see in MQTT Box.
Shouldn’t really make a difference though.
payload_on defaults to ‘ON’ and payload_off defaults to ‘OFF’.
The logic that was posted in the value_template should at the absolute minimum if it is not matching ‘Start’ - be setting the sensor to ‘OFF’
I would be more inclined to believe that this was a case of Home Assistant simply never receiving the message in the first place.
It may however be worth subscribing to the topic in the MQTT integration page in Home Assistant, just so you can be absolutely certain that what Home Assistant is receiving
Progress! When I explicitly tell MQTT to listen for that topic it picks it up and my automation worked!
Why wasn’t Home Assistant picking up this topic out of the box?
The “Listen to a topic” setting in MQTT config looks like a troubleshooting tool since it only allows you to specify one topic to listen to at a time. Is there a better place where I can specify that this topic should be listened to?
Someone should really create a simple web tool that allows us to add device config and it generates the MQTT Discovery message for us to post to Home Assistant.