How to avoid loops with MQTT updating devices
Posted: Wednesday 19 April 2017 10:53
Hi guys,
I have an Arduino that works as a switch. When pressed it turn a relay on and it sends the command to DomoticZ (via MQTT) updating the switch status.
The problem is that when I press the switch a domoticz/in MQTT message is sent from Arduino with the switch status. DomoticZ sees that message, update the switch state and send a domoticz/out MQTT message with the switch state. The Arduino is listening to that topic, it updates the switch status and it sends a domoticz/in MQTT message......and the loop is started
Is there a way to insert a field in the MQTT message the Arduino is sending so that if DomoticZ sees that field it doesn't send a domoticz/out update?
Or do you have any other suggestion to avoid this loop?
Thanks!
I have an Arduino that works as a switch. When pressed it turn a relay on and it sends the command to DomoticZ (via MQTT) updating the switch status.
The problem is that when I press the switch a domoticz/in MQTT message is sent from Arduino with the switch status. DomoticZ sees that message, update the switch state and send a domoticz/out MQTT message with the switch state. The Arduino is listening to that topic, it updates the switch status and it sends a domoticz/in MQTT message......and the loop is started
Is there a way to insert a field in the MQTT message the Arduino is sending so that if DomoticZ sees that field it doesn't send a domoticz/out update?
Or do you have any other suggestion to avoid this loop?
Thanks!