# Newbie question: take action at specific time

**URL:** <https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994>\
**Category:** General\
**Tags:** function-node, home-assistant\
**Created:** [6 July 2025 11:50 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994 "2025-07-06T11:50:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanvh83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/johanvh83/32/101892_2.png) [@johanvh83](https://discourse.nodered.org/u/johanvh83)\
**Post date:** [6 July 2025 11:50 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/1 "2025-07-06T11:50:21Z")

</div>

My flow:

```flows
[{"id":"9cd9fa2d0d2e7202","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"13d41ac132368021","type":"server-state-changed","z":"9cd9fa2d0d2e7202","name":"Switch on?","server":"c74ca316.14c28","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["input_boolean.nachtladen"],"substring":[],"regex":[]},"outputInitially":true,"stateType":"habool","ifState":"true","ifStateType":"bool","ifStateOperator":"is","outputOnlyOnStateChange":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":140,"y":60,"wires":[["6421274bc1d0d573"],[]]},{"id":"dd741507cc53cd34","type":"api-call-service","z":"9cd9fa2d0d2e7202","name":"Take action","server":"c74ca316.14c28","version":7,"debugenabled":false,"action":"input_number.set_value","floorId":[],"areaId":[],"deviceId":[],"entityId":["input_number.charge_current"],"labelId":[],"data":" {\"value\": 10}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"input_number","service":"set_value","x":650,"y":140,"wires":[[]]},{"id":"6421274bc1d0d573","type":"api-call-service","z":"9cd9fa2d0d2e7202","name":"Pause charging","server":"c74ca316.14c28","version":7,"debugenabled":true,"action":"easee.action_command","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"{\"device_id\":\"276dadb4c47eea642a878ea0a71bea42\",\"action_command\":\"pause\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"easee","service":"action_command","x":320,"y":60,"wires":[["da034f7d41e777b3"]]},{"id":"da034f7d41e777b3","type":"time-range-switch","z":"9cd9fa2d0d2e7202","name":"Is it specific time?","lat":"","lon":"","startTime":"13:40","endTime":"13:41","startOffset":0,"endOffset":0,"x":590,"y":60,"wires":[["dd741507cc53cd34"],[]]},{"id":"c74ca316.14c28","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

```

I made a simple flow but it doesn't work.  
I have a switch. When it on, I trigger my flow, first it pauses my charger, this works, when I reach a specific time (00:05 at night) it should start my charging again.  
I tried the flow by changing my time (not 00:05 but few minutes after I hit 'deploy'.  
What I see is that after the 'Time Range Node' nothing happens.  
What's wrong?  
Thanks for your input!

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 July 2025 12:08 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/2 "2025-07-06T12:08:29Z")

</div>

Hi and welcome

The forum has its own options for posting code and is preferred to extenal sources.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![johanvh83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/johanvh83/32/101892_2.png) [@johanvh83](https://discourse.nodered.org/u/johanvh83)\
**Post date:** [6 July 2025 12:16 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/3 "2025-07-06T12:16:47Z")

</div>

Thanks, I changed

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 July 2025 12:42 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/4 "2025-07-06T12:42:11Z")

</div>

I see now there are a lot of HA nodes.  
Most here do not use HA, but some do and you will have to wait for them to get more help if this is only HA related. Or post on the HA forum

Saying that there are the inject node, trigger and delay that can work with timing issues. Or there are contrib nodes like [node-red-contrib-cron-plus (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-cron-plus) that may help you also.  
Or [Library - Node-RED](https://flows.nodered.org/search?term=schedule)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [6 July 2025 12:43 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/5 "2025-07-06T12:43:49Z")

</div>

I think you must be using Home Assistant - because when I imported your flow I got this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bfe31b110c36780c6f885a3ab4985dd0a13a6043.png)

I added the Home-assistant tag accordingly.

FYI a purely Node-red way to take an action at a specific time is with the Inject node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/6/e6abf0b4d19df4ed70aa4f36c1d8490e35fd4a4e.png)

The node can also inject after a specified time from a full deploy.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 July 2025 12:47 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/6 "2025-07-06T12:47:08Z")

</div>

It is best to try and determine exactly which nodes are causing the problem and just post those nodes here.  
Before that, however, since you believe that the it is the time range switch node that is causing the problem then add debug nodes to show what is going into that node and show us how you have configured it.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 July 2025 12:50 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/7 "2025-07-06T12:50:24Z")

</div>

> [@Colin](#):
>
> It is best to try and determine exactly which nodes are causing the problem and just post those nodes here.  
> Before that, however, since you

Not sure what you are trying to say to me?

---

<div class="post-metadata">

**Author:** ![johanvh83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/johanvh83/32/101892_2.png) [@johanvh83](https://discourse.nodered.org/u/johanvh83)\
**Post date:** [6 July 2025 12:53 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/8 "2025-07-06T12:53:41Z")

</div>

Hi, thanks for your help. I do know the Inject node but this is a kind of trigger and this node doesn't has an input. In my opinion it can only be used a start, let's say.  
OK, I'm able start my flow with the inject node and then check if my switch is on.  
But at another time I'd like to stop my charging, so I guess then I just need another flow

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [6 July 2025 13:02 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/9 "2025-07-06T13:02:07Z")

</div>

There are quite a few time-based nodes available in the flows catalogue. One of the most comprehensive is CRON+. That will act as a static timer or can be driven dynamically from msg inputs.

Lighting controls can get quite complex. Here is an example from my own setup (I don't use HA):

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bcf6f5de0a94ae1f458a351a91e0518ceaf5d25f.png)  
Everything is controlled via MQTT.

BTW, I took the liberty of editing your post to add the `flows` tag to the flow you posted so that it shows as a flow rather than just JSON - a new capability recently added to the forum.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 July 2025 13:43 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/10 "2025-07-06T13:43:42Z")

</div>

> [@E1cid](#):
>
> Not sure what you are trying to say to me?

I wasn't, I was trying to say it to @johanvh83, but failed miserably.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 October 2025 13:44 UTC](https://discourse.nodered.org/t/newbie-question-take-action-at-specific-time/97994/11 "2025-10-04T13:44:16Z")

</div>

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