How can I poll the status node for status errors?

I have a Status node which reports changes in the status of an RFX sensor:

Then, my Function node filters for disconnections:

if (msg.status.text == "disconnected") return msg;

which means I can periodically try to restart a system service using the exec node, until the Status node outputs "connected".

Problem is, the Status node only reports on status changes. That means if I Deploy in the meantime, it doesn't attempt to reconnect.

Is there some way of polling the Status node, or another crafty solution?

You could add a repeater node after the status which repeats the latest status at a regular interval. This node will do that, node-red-contrib-msg-resend.

1 Like