My Wifi Doorbell works and notifies my broker, the HA automatons run but I can’t get the topic to clear.
When I listen to the topic on HA:
Message 0 received on homeassistant/doorbell at 7:23 PM:
{
“batt”: 3.236328
}
QoS: 0 - Retain: true
When the doorbell is triggered it send the battery voltage to the topic. I don’t really care about the voltage but without the state clearing it causes complications and duplicate future activation.
As a cludge I just reboot the MQTT server nightly but I’d rather just fix whatever mistake I’ve made. Can anyone help?
If I don’t clear the battery voltage by restarting my mqtt server then anytime I change the automation and hit save the automations that relate to that topic will retrigger.
If someone hits the doorbell and it has already been triggered once all the automations get triggered twice.
Of course the mqtt message is not cleared, it contains the retain flag. You can clear the message by publishing at the end of your automation a message to the topic with empty payload.
This causes an endless loop because it triggers as a push the the group.
It’s kind of funny actually. Alexa is triggered over and over saying dingdong doorbell over and over until I restart my mqtt docker.
Thats great thank you very much.
I will have to test on the weekend, I directly commented out some of the code for testing to remove the loop but then I edited after using the GUI interface and it deleted all the text that was commented out.
I will either restore or start again this weekend. I also have to wait to fully do the automation because I exceeded the 150 push notification limit when it started to loop so I have to wait 24 hours anyway.
I really appreciate your help though, thank you very much. If I get this all working on the weekend I will post my result.