Checking status of sensor

Hello all,
I want to ask what would be the best way to achieve my this desired outcome using red.

A sensor is outputting information every second.
If the sensor is off, it would not have any output.
After 5 seconds of consecutive of having no outputs, msg.payload="Sensor off!!"

Do I use a function node or is there a built in node in node red?

I think the RBE node may go a long way to reduce the messages you see - maybe.

Get the node receiving the output from the sensor and then connect the RBE node.

Use the trigger node set to send nothing - wait 5 secs - then send "Sensor Off!" - with the time set to extend on any new input...

(The RBE node will just remove repeats - so may not be what you need in this instance - but could be useful after this to reduce the volume of repeats if that is also a problem)

No problems.

I didn't understand it that way.

But all good.

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