Installing a timer for a switch

Hi all,

I'm creating this topic in good faith that someone on this forum can be able to help a new Node-RED'er.
I have made a basic flow which activates a function with a ON / OFF switch, connected to a LED light to display if the switch is on or off.

What I want to have integrated in the flow is a timer (not a scheduler) which cuts off the activated signal after X-seconds. Say I turn the switch ON, then the switch should go back to OFF after x-seconds of being active.

Have any of you got tips / tricks on what I could use to make this achievable?
Is it possible to use Big Timer or Timerswitch for this purpose?

Best regards

Yes Pete Scargills big timer can do this, there's a recent youtube video where he inject 5 seconds.

You can do that with a Trigger node, set it to send the On message then X secs later send the Off.

1 Like

Watched the video, but this is a different approach than what I am searching for.
What I am searching for is something like this:

My UI is as of now very simple:

I want to be able to use the interface in such a way that when I'm turning the switch on, it will stay active for 5 seconds then it will deactivate itself.

Is there a easy way to do this?

How is the trigger going to do anything like this ?

Try: switch -> trigger -> output.

To be honest I'm not completely sure how to set this up. My first thought was that the Trigger would activate the switch and keep it on for a certain amount of time, but this didn't work.
I have now also tried with placing the trigger after the switch and it still doesn't work, this might be because I have the wrong inputs. Any idea on what I can set the input to be in order to make this work?

Try this:


Thanks alot! This worked out perfectly.

1 Like