# Dawn, dusk and 23:00 timer

**URL:** <https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196>\
**Category:** General\
**Created:** [31 July 2023 19:04 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196 "2023-07-31T19:04:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [31 July 2023 19:04 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/1 "2023-07-31T19:04:31Z")

</div>

Hallo all

What is the best way to make a timer, there turn light OFF at dawn and ON at dusk, but set it to 10% at 23:00 ?

When I use bigtimer, I only have on or off. and then I have to use a "time range" node.

are there a better way ?

---

<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:** [31 July 2023 19:07 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/2 "2023-07-31T19:07:17Z")

</div>

The CRON+ node is, without doubt, the most flexible of the many scheduling nodes and can do everything you are asking.

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [31 July 2023 19:46 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/3 "2023-07-31T19:46:20Z")

</div>

WOW...thx alot.... love it

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [31 July 2023 20:02 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/4 "2023-07-31T20:02:05Z")

</div>

I cant get it to work whit a "inject" node to get status. Do you know if I can do that ?

---

<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:** [31 July 2023 20:08 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/5 "2023-07-31T20:08:36Z")

</div>

The help info for the node tells you how:

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

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [31 July 2023 20:09 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/6 "2023-07-31T20:09:42Z")

</div>

yes, I have try it, but I cant get it to work

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [31 July 2023 20:10 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/7 "2023-07-31T20:10:45Z")

</div>

```auto
[{"id":"6e6ed394a01251ce","type":"debug","z":"c4afb74715a93d10","name":"debug 16","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":940,"y":680,"wires":[]},{"id":"6a1c0407c2352fe0","type":"cronplus","z":"c4afb74715a93d10","name":"","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"fanOut","defaultLocation":"55 9","defaultLocationType":"fixed","outputs":5,"options":[{"name":"Sunset","topic":"Sunset","payloadType":"str","payload":"1","expressionType":"solar","expression":"0 45 21 * * *","location":"55.05302635383441 9.321497082710266","offset":"0","solarType":"selected","solarEvents":"sunsetStart"},{"name":"23:00","topic":"23:00","payloadType":"str","payload":"2","expressionType":"cron","expression":"0 0 23 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"Sunrise","topic":"Sunrise","payloadType":"str","payload":"3","expressionType":"solar","expression":"20 45 21 * * *","location":"","offset":"0","solarType":"selected","solarEvents":"sunrise"}],"x":760,"y":700,"wires":[["6e6ed394a01251ce"],["6e6ed394a01251ce"],["6e6ed394a01251ce"],[],[]]},{"id":"5350aa4417a5988c","type":"inject","z":"c4afb74715a93d10","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":700,"wires":[["71f2851c4a0ca19f"]]},{"id":"71f2851c4a0ca19f","type":"change","z":"c4afb74715a93d10","name":"trigger","rules":[{"t":"set","p":"payload","pt":"msg","to":"trigger","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":700,"wires":[["6a1c0407c2352fe0"]]}]

```

---

<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:** [31 July 2023 20:20 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/8 "2023-07-31T20:20:51Z")

</div>

```auto
[{"id":"f32b22fe72eed204","type":"cronplus","z":"30fdd9a9702231b0","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 * 1 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":580,"y":1580,"wires":[["3d81cc9771111bb6"]]},{"id":"94124fe5a8014cd1","type":"inject","z":"30fdd9a9702231b0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"status","payload":"schedule1","payloadType":"str","x":340,"y":1580,"wires":[["f32b22fe72eed204"]]},{"id":"3d81cc9771111bb6","type":"debug","z":"30fdd9a9702231b0","name":"debug 121","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":1580,"wires":[]}]

```

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

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [31 July 2023 20:38 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/9 "2023-07-31T20:38:59Z")

</div>

Okay, I had also come to that conclusion.

But what I can't with "CRON+", as I can with the "BigTimer", is the ability to send an "inject" node with "payload auto" and have it send out the signal I need.

When I do that with CRON+ and use "trigger-all" or some of the others, it sends out all three signals even though I only need the current one.

I would like to have a button that I can press, and it simply sends a signal through the CRON+ node, and then it outputs the result depending on the time of day.

```auto
[{"id":"6e6ed394a01251ce","type":"debug","z":"c4afb74715a93d10","name":"debug 16","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":800,"y":820,"wires":[]},{"id":"6a1c0407c2352fe0","type":"cronplus","z":"c4afb74715a93d10","name":"Test","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"output2","defaultLocation":"55 9","defaultLocationType":"fixed","outputs":2,"options":[{"name":"Sunset","topic":"Sunset","payloadType":"str","payload":"1","expressionType":"solar","expression":"0 45 21 * * *","location":"55.05302635383441 9.321497082710266","offset":"0","solarType":"selected","solarEvents":"sunsetStart"},{"name":"23:00","topic":"23:00","payloadType":"str","payload":"2","expressionType":"cron","expression":"0 0 23 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"Sunrise","topic":"Sunrise","payloadType":"str","payload":"3","expressionType":"solar","expression":"20 45 21 * * *","location":"","offset":"0","solarType":"selected","solarEvents":"sunrise"}],"x":650,"y":820,"wires":[["6e6ed394a01251ce"],[]]},{"id":"5350aa4417a5988c","type":"inject","z":"c4afb74715a93d10","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"trigger-all","payload":"Test","payloadType":"str","x":490,"y":820,"wires":[["6a1c0407c2352fe0"]]}]

```

 ![Udklip](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/d/ddeba1d3a5b698f29b5484102789283fa20f8536.png)

---

<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:** [31 July 2023 21:09 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/10 "2023-07-31T21:09:50Z")

</div>

I'd probably do that with one of the gate nodes. Use CRON+ or similar to open/close the gate at the appropriate times then have your inject direct to the gate.

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [31 July 2023 21:23 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/11 "2023-07-31T21:23:26Z")

</div>

okay...

The is my best...

```auto
[{"id":"658ec2724aea6cf9","type":"link in","z":"c4afb74715a93d10","name":"Solstyring","links":["5eedc4eb25b6533f","d3ebfcad2baefbbd"],"x":75,"y":220,"wires":[["85efaa9e574f9c08"]]},{"id":"f5b032aa34e3b7ed","type":"link out","z":"c4afb74715a93d10","name":"4 Bottom Wall Switch Køkken - 2","mode":"link","links":["f39c5419cf92b1ba"],"x":1135,"y":220,"wires":[]},{"id":"9e4c301c707afacc","type":"function","z":"c4afb74715a93d10","name":"set varable || Have OFF","func":"// define variable\nvar value = \"off\"\n\n// set global variable\nglobal.set(\"Have\", value)\nglobal.set(\"Kuglelampe_Stor\", value)\nglobal.set(\"Kuglelampe_Lille\", value)\nglobal.set(\"Smartplug_Pavillon\", value)\nglobal.set(\"Gardenpole_L\", value)\nglobal.set(\"Gardenpole_R\", value)\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":220,"wires":[["f5b032aa34e3b7ed"]]},{"id":"ddf41dd164b2bd82","type":"function","z":"c4afb74715a93d10","name":"set varable || Have ON","func":"// define variable\nvar value = \"on\"\n\n// set global variable\nglobal.set(\"Have\", value)\nglobal.set(\"Kuglelampe_Stor\", value)\nglobal.set(\"Kuglelampe_Lille\", value)\nglobal.set(\"Smartplug_Pavillon\", value)\nglobal.set(\"Gardenpole_L\", value)\nglobal.set(\"Gardenpole_R\", value)\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":300,"wires":[["f5b032aa34e3b7ed"]]},{"id":"d66064cb9384ba5e","type":"change","z":"c4afb74715a93d10","name":"0 - Default","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"scene_recall\": 0\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":280,"wires":[["ddf41dd164b2bd82"]]},{"id":"b3cfe6b00ca6de26","type":"change","z":"c4afb74715a93d10","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"state\":\"OFF\",\t \"transition\": 2\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":220,"wires":[["9e4c301c707afacc"]]},{"id":"a8843dd6a7a755de","type":"change","z":"c4afb74715a93d10","name":"1 - Nattelys","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"scene_recall\": 1\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":340,"wires":[["ddf41dd164b2bd82"]]},{"id":"6a1c0407c2352fe0","type":"cronplus","z":"c4afb74715a93d10","name":"Solstyring","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"fanOut","defaultLocation":"55 9","defaultLocationType":"fixed","outputs":5,"options":[{"name":"Sunrise","topic":"Sunrise","payloadType":"str","payload":"1","expressionType":"solar","expression":"20 45 21 * * *","location":"","offset":"0","solarType":"selected","solarEvents":"sunrise"},{"name":"Sunset start","topic":"Sunset","payloadType":"str","payload":"2","expressionType":"solar","expression":"0 45 21 * * *","location":"55.05302635383441 9.321497082710266","offset":"0","solarType":"selected","solarEvents":"sunsetStart"},{"name":"23:00","topic":"23:00","payloadType":"str","payload":"3","expressionType":"cron","expression":"0 0 23 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":420,"y":300,"wires":[["b3cfe6b00ca6de26"],["d66064cb9384ba5e"],["a8843dd6a7a755de"],[],[]]},{"id":"72e16223cd2b30cf","type":"time-range-switch","z":"c4afb74715a93d10","name":"","lat":"55","lon":"9","startTime":"sunsetStart","endTime":"23:00","startOffset":0,"endOffset":"0","x":450,"y":220,"wires":[["d66064cb9384ba5e"],["a8843dd6a7a755de"]],"icon":"node-red-node-suncalc/sun.png"},{"id":"85efaa9e574f9c08","type":"time-range-switch","z":"c4afb74715a93d10","name":"","lat":"55","lon":"9","startTime":"sunrise","endTime":"sunsetStart","startOffset":0,"endOffset":"0","x":240,"y":220,"wires":[["b3cfe6b00ca6de26"],["72e16223cd2b30cf"]],"icon":"node-red-node-suncalc/sun.png"}]

```

 ![Udklip](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/86b49f11f68142a11d6d0e070ad6efa051bd7795.png)

---

<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:** [14 August 2023 21:23 UTC](https://discourse.nodered.org/t/dawn-dusk-and-23-00-timer/80196/12 "2023-08-14T21:23:37Z")

</div>

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