Timestamp injection when Switch in Dashboard is on


I want to have a timestamp injection with an interval (1 or 2 seconds) when the switch in the Dashboard is on.....I want to simulate an alarm system with an ultrasonic sensor.......if somebody is "near my house" and the alarm system ist armed, I will have a LED to blink....
Sorry for my english !!:slight_smile:

use a trigger-node to create/send the interval messages...connect the dashbord button to the trigger node and its on/off messages can control the triggering of the interval messages.

A simple way to do this is to have an Inject node injecting at the appropriate rate and send that through a node-red-contrib-simple-gate which you can control from the dashboard switch to allow or block the messages.

Here is a basic flow which does what you want.

Replace the inject and debug nodes as required.
And adjust the frequency too as required.


Oh yes, I forgot you could do that. @Trying_to_learn's way is better than my suggestion.

No problem.

I only know that because I have recently needed something just like that and so it is fresh in the memory.

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