OpenMarine
How to detect loss of MQTT data stream - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: Node Red (https://forum.openmarine.net/forumdisplay.php?fid=15)
+--- Thread: How to detect loss of MQTT data stream (/showthread.php?tid=2477)



How to detect loss of MQTT data stream - affinite - 2020-04-04

Hi all
I have a number of NodeRed flows setup to monitor battery voltages sent as MQTT from an ESP82666.
They work fine except when the MQTT data stream is interrupted. 
In this instance the NR dashboard Gauge simply freezes with the last message payload displayed.
I am trying to find a way to zero the gauge by changing the payload message to 0 if no message received in say 1 minute so that I get warning of a sender failure.
Im sure I need to use the Trigger Node but I cant get it to work. 
Any ideas ?


RE: How to detect loss of MQTT data stream - jim321 - 2020-04-05

https://discourse.nodered.org/t/how-to-monitor-mqtt-publisher-is-alive/14021

just send a 0 for the Gauge instead of a message

Code:
[{"id":"19b00651.99840a","type":"trigger","z":"d849ee72.4f61b","op1":"","op2":"0","op1type":"nul","op2type":"num","duration":"60","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":930,"y":500,"wires":[[]]}]



RE: How to detect loss of MQTT data stream - affinite - 2020-04-06

(2020-04-05, 02:09 PM)jim321 Wrote: https://discourse.nodered.org/t/how-to-monitor-mqtt-publisher-is-alive/14021

just send a 0 for the Gauge instead of a message

Code:
[{"id":"19b00651.99840a","type":"trigger","z":"d849ee72.4f61b","op1":"","op2":"0","op1type":"nul","op2type":"num","duration":"60","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":930,"y":500,"wires":[[]]}]

Jim 
thanks that worked a treat
Couldn't get it to work at first then realised I had to put the trigger in parallel with the connector between MQTT node and gauge


RE: How to detect loss of MQTT data stream - jim321 - 2020-04-06

good glad it worked for you..Smile
you might shorten the delay to 15 or 30 a lot can happen in a minute..