How to Add time to input_datetime

Hallo all

How do I add one extra hour, in node-red, to an input input_datetime.time.

If I set the time on the dashborad to like 20:00, and I need node-red to add one extra hour?

I need it to create a control where I can set a bedtime. I want to be able to set the bedtime on the dashboard, and then Node-RED should turn off some of the lights an hour later.

Thx alot all

Maybe node-red-contrib-mytimeout could help. Take a look at it. I don't know how it will work with Home Assistant because I (and most people on the forum) don't use it

Hey Zenofmud
Thx for the replay.

That was a good idea, but not exactly what I needed. If 20:00:00 is input, then I need the value to be 21:00:00.

I'm not proficient in function nodes, but perhaps there's an easy way to do it with function nodes.

Assuming that your system sends a message of some sort at bedtime, you could use a delay or trigger node without any time arithmetic. I think you would need to set msg.delay to 3600000 (1hr in milliseconds).

Does input_datetime come from Home Assistant? What format is it? An example would be useful.

With my timeout you can specify the timeout in seconds and when it reaches that it sends out a message. I use it for my coffee pot timer. I can turn on the pot and 20 minutes later the pot is turned off.
You can take a look at Coffee Pot Timer

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