Colorize text when no update is received

Dear all,

I use MQTT to receive updates from my heating. For example, the heating will send an update every 1 minute on the humidity in my living room, which I use to present in the dashboard.

MQTT_humidity

However, to exclude any issues in the MQTT communication, I would like to colorize the value, e.g. in red, when no update was received within 2 minutes over MQTT. How can I solve this in the most simple way?

To know when no value is received for two minutes, feed it into a Trigger node set to Send Nothing then Wait 2 Minutes, Extend Delay if new messages arrive, then Send a message to do the colour setting. The result will be that it will send nothing while messages keep coming in and send the message 2 minutes after they stop.

[Edit] If the reason it stops is that the device is offline or inaccessible then also (or instead) use the MQTT LWT message to tell you it is offline.

Great @Colin ,

works like a charme.

There is also a nice description under Trigger a flow if a message isn’t received after a defined time : Node-RED

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.