# Bigtimer challenge

**URL:** <https://discourse.nodered.org/t/bigtimer-challenge/66190>\
**Category:** General\
**Created:** [8 August 2022 21:08 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190 "2022-08-08T21:08:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmartens](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cmartens](https://discourse.nodered.org/u/cmartens)\
**Post date:** [8 August 2022 21:08 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/1 "2022-08-08T21:08:02Z")

</div>

Hi,

I am using Nodered and Bigtimer for my irrigation. Everything is working fine. However I would like to display the date and time of the next run. I was hoping that this could be calculated based on the combination of the date/time of the Bigtimer node (displayed under the node) and the current date/time. However I don't know how to arrange this. Does anybody have experience with this? Thanks in advance for your reaction.

 ![Schermafbeelding 2022-08-08 om 23.05.39](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fdc7bd93ed2abff6cdc17fe0adf059018308f5ba.jpeg)

![Schermafbeelding 2022-08-08 om 23.09.20](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78ecb141aadf3043892e62e11d3581213c9afd37.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:** [8 August 2022 22:46 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/2 "2022-08-08T22:46:30Z")

</div>

Not sure you can do that with Bigtimer, you'd be better off with CRON+ for more advanced tasks.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [8 August 2022 23:26 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/3 "2022-08-08T23:26:32Z")

</div>

Peter Scargill the author of the Bigtimer node comes here very seldom and has stated before he will only provide support through his Blog - you might want to head over there and ask

Obviously the source code is readily available and you could look at having a go yourself

As Julian has stated - Bigtimer is only one option

Craig

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [9 August 2022 04:33 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/4 "2022-08-09T04:33:57Z")

</div>

Have you tried the status node? If you use that you can capture the text below the bigtimer node and then use that in an expression

Here an example from my system

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

---

<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:** [9 August 2022 10:17 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/5 "2022-08-09T10:17:35Z")

</div>

> [@craigcurtin](#):
>
> Obviously the source code is readily available and you could look at having a go yourself

It seems that the source is only available by installing it and finding it in the node\_modules folder. It does not have a github or similar repository where one can view the source, fork it or submit issues or Pull Requests. That is one of the reasons that I switched to using the cron plus node.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 August 2022 10:29 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/6 "2022-08-09T10:29:28Z")

</div>

@Steve-Mcl is it possible to get the forthcoming event in Cron+'s payload?  
(It's available in node status)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 August 2022 11:31 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/7 "2022-08-09T11:31:38Z")

</div>

Yes, poke a topic of "status" and payload of the schedule name.  
(or a topic of "status-all" for all schedules)

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

```auto
[{"id":"0cadc70ad80bc89c","type":"cronplus","z":"fc65972c8d3b1d68","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"fanOut","outputs":4,"options":[{"name":"on_sched","topic":"on","payloadType":"json","payload":"{\"state\": \"on\"}","expressionType":"cron","expression":"0 0 7 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"off_sched","topic":"off","payloadType":"json","payload":"{\"state\": \"off\"}","expressionType":"cron","expression":"0 0 8 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":300,"y":180,"wires":[[],[],[],["eadae4b2ac54e6d7","95f8f4acc6461ba2"]]},{"id":"5254c9e3da09bdce","type":"inject","z":"fc65972c8d3b1d68","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"status","payload":"on_sched","payloadType":"str","x":120,"y":160,"wires":[["0cadc70ad80bc89c"]]},{"id":"f22bc02b710b8a43","type":"inject","z":"fc65972c8d3b1d68","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"status","payload":"off_sched","payloadType":"str","x":120,"y":220,"wires":[["0cadc70ad80bc89c"]]},{"id":"eadae4b2ac54e6d7","type":"switch","z":"fc65972c8d3b1d68","name":"","property":"payload.result.config.name","propertyType":"msg","rules":[{"t":"eq","v":"on_sched","vt":"str"},{"t":"eq","v":"off_sched","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":200,"wires":[["f4f87ffda42b96e4"],["2e4a8af2f7484c01"]]},{"id":"f4f87ffda42b96e4","type":"debug","z":"fc65972c8d3b1d68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload.result.status.nextDateTZ","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":200,"wires":[]},{"id":"2e4a8af2f7484c01","type":"debug","z":"fc65972c8d3b1d68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload.result.status.nextDateTZ","targetType":"msg","statusVal":"payload","statusType":"auto","x":790,"y":260,"wires":[]},{"id":"95f8f4acc6461ba2","type":"debug","z":"fc65972c8d3b1d68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":140,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 August 2022 12:56 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/8 "2022-08-09T12:56:04Z")

</div>

Yes, but I think that the OP wanted the next scheduled event, not a list of events.  
(Like what's displayed in node status).

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 August 2022 14:25 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/9 "2022-08-09T14:25:40Z")

</div>

> [@Paul-Reed](#):
>
> Yes, but I think that the OP wanted the next scheduled event

That is exactly what this does Paul. Look at the time stamps...

There is just more info for more advanced users (e.g. the servers time is included as reference so a user can accurately calculate "how long until the next event in ms" and a friendly `description` of the schedule etc etc.

* * *

But I think perhaps I misunderstood & you actually mean next event out of **ALL** schedules right?

In which case...

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

```auto
[{"id":"0cadc70ad80bc89c","type":"cronplus","z":"fc65972c8d3b1d68","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"fanOut","outputs":4,"options":[{"name":"on_sched","topic":"on","payloadType":"json","payload":"{\"state\": \"on\"}","expressionType":"cron","expression":"0 0 7 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"off_sched","topic":"off","payloadType":"json","payload":"{\"state\": \"off\"}","expressionType":"cron","expression":"0 0 8 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":540,"y":180,"wires":[[],[],[],["95f8f4acc6461ba2","b4f1ebad07b0e870"]]},{"id":"5254c9e3da09bdce","type":"inject","z":"fc65972c8d3b1d68","name":"get status","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"status-all","x":380,"y":180,"wires":[["0cadc70ad80bc89c"]]},{"id":"95f8f4acc6461ba2","type":"debug","z":"fc65972c8d3b1d68","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":140,"wires":[]},{"id":"b4f1ebad07b0e870","type":"function","z":"fc65972c8d3b1d68","name":"Select next","func":"\nconst next = msg.payload.result.reduce((a, b) => a.status.nextDate < b.status.nextDate ? a : b)\nmsg.payload = {\n name: next.config.name,\n topic: next.config.topic,\n next: next.status.nextDate,\n nextLocal: next.status.nextDateTZ,\n timeZone: next.status.serverTimeZone,\n when: next.status.description,\n msUntil: next.status.nextDate.valueOf() - next.status.serverTime.valueOf(),\n description: next.status.nextDescription,\n}\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":200,"wires":[["32df337f09c22d4e"]]},{"id":"32df337f09c22d4e","type":"debug","z":"fc65972c8d3b1d68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.nextLocal","statusType":"msg","x":970,"y":200,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![cmartens](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cmartens](https://discourse.nodered.org/u/cmartens)\
**Post date:** [9 August 2022 15:04 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/10 "2022-08-09T15:04:01Z")

</div>

Hi Steve,

Thanks for your help. The result is currently looking like this. Is there a way to change the way the date and time are displayed?

![Screenshot 2022-08-09 170337](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0c488eb49f9f0865368b2e6ad6dc8b6a70339112.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 August 2022 16:04 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/11 "2022-08-09T16:04:04Z")

</div>

> [@cmartens](#):
>
> Is there a way to change the way the date and time are displayed?

Of course. there are many ways a date and time can be displayed. You will have to provide the format before anyone can give you an answer though

e.g.

- `YY/MM/DD HH:mm:ss`
- `YYYY-MM-DD HH:mm:ss.zzz`
- `YYYY, DD MMM hh:mm a`
- `DD MMM hh:mm:ss a`
- and so on

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 August 2022 16:06 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/12 "2022-08-09T16:06:08Z")

</div>

> [@cmartens](#):
>
> Is there a way to change the way the date and time are displayed?

Yes, insert a change node after Steve's function node (above), and use 'moment to change it to whatever format that you want. (Change the timezone to your own).

`$moment(msg.payload.next).tz("Europe/London").format('lll')`

![tz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8f8d3930ed1d35584ce447c84613082b4a21107e.jpeg)

Result;

![tz1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f11986c7bd25f914ab8bd8aafdbd59b2e236f3f3.jpeg)

See [https://momentjs.com/](https://momentjs.com/) for more formatting examples

**NOTE** - ensure that you select jasonata in the change node - **J:**

---

<div class="post-metadata">

**Author:** ![cmartens](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cmartens](https://discourse.nodered.org/u/cmartens)\
**Post date:** [9 August 2022 21:17 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/14 "2022-08-09T21:17:21Z")

</div>

Thanks @Paul-Reed and @Steve-Mcl for your help! I have added the final version of the flow which includes a couple of nodes to switch on and off a device. However, after switching on and off the device based on the settings of the timer, the input\_text sensor is not updating.

It looks like the input\_text entity is only updated after using the Inject Node. Any ideas how to solve this?

```auto
[{"id":"30e9e18e08e63fd3","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"5b910241fcc70820","type":"cronplus","z":"30e9e18e08e63fd3","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"fanOut","outputs":4,"options":[{"name":"on_sched","topic":"on","payloadType":"json","payload":"{\"state\": \"on\"}","expressionType":"cron","expression":"0 8 23 ? * TUE *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"off_sched","topic":"off","payloadType":"json","payload":"{\"state\": \"off\"}","expressionType":"cron","expression":"0 10 23 ? * TUE *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":180,"y":240,"wires":[["8f9f537a4c75e40d"],["e9da367b335dbe12"],[],["106cbe4819f840f1"]]},{"id":"f5b9f782d0da3ad9","type":"inject","z":"30e9e18e08e63fd3","name":"get status","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"status-all","x":180,"y":380,"wires":[["5b910241fcc70820"]]},{"id":"106cbe4819f840f1","type":"function","z":"30e9e18e08e63fd3","name":"Select next","func":"\nconst next = msg.payload.result.reduce((a, b) => a.status.nextDate < b.status.nextDate ? a : b)\nmsg.payload = {\n name: next.config.name,\n topic: next.config.topic,\n next: next.status.nextDate,\n nextLocal: next.status.nextDateTZ,\n timeZone: next.status.serverTimeZone,\n when: next.status.description,\n msUntil: next.status.nextDate.valueOf() - next.status.serverTime.valueOf(),\n description: next.status.nextDescription,\n}\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":300,"wires":[["5bca6964d1a2a3a5"]]},{"id":"0a75e7b008ae1c95","type":"api-call-service","z":"30e9e18e08e63fd3","name":"Date & Time","server":"ab0c7805.ea8858","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.tuin_beregening_datum_tijd_volgende_run"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":690,"y":300,"wires":[[]]},{"id":"5bca6964d1a2a3a5","type":"change","z":"30e9e18e08e63fd3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(msg.payload.next).lang(\"nl\").tz(\"Europe/Amsterdam\").format('lll')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":300,"wires":[["0a75e7b008ae1c95"]]},{"id":"21f1db9f6ca0572e","type":"api-call-service","z":"30e9e18e08e63fd3","name":"Pomp: Uit","server":"9d8c9ade.d8af7","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.tuin_verlichting"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":620,"y":220,"wires":[[]]},{"id":"b45fe18073ee5efd","type":"api-call-service","z":"30e9e18e08e63fd3","name":"Pomp: Aan","server":"9d8c9ade.d8af7","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.tuin_verlichting"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":630,"y":140,"wires":[[]]},{"id":"8f9f537a4c75e40d","type":"api-current-state","z":"30e9e18e08e63fd3","name":"Automatische beregening: Aan?","server":"ab0c7805.ea8858","version":3,"outputs":2,"halt_if":"Aan (ma, wo, vr, 07:00-08:00)","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.tuin_beregening_automatisch","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":140,"wires":[["b45fe18073ee5efd"],[]]},{"id":"e9da367b335dbe12","type":"api-current-state","z":"30e9e18e08e63fd3","name":"Automatische beregening: Aan?","server":"ab0c7805.ea8858","version":3,"outputs":2,"halt_if":"Aan (ma, wo, vr, 07:00-08:00)","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.tuin_beregening_automatisch","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":220,"wires":[["21f1db9f6ca0572e"],[]]},{"id":"ab0c7805.ea8858","type":"server","name":"Home Assistant","version":4,"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"},{"id":"9d8c9ade.d8af7","type":"server","name":"Home Assistant","version":4,"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"}]

```

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 August 2022 21:47 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/15 "2022-08-09T21:47:57Z")

</div>

It looks as though your flow includes Home Assistant, which I don't use, so can't try your flow without installing & configuring HA (which I don't want to do 😉)  
Hopefully a HA user may be able to assist further.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [9 August 2022 22:27 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/16 "2022-08-09T22:27:11Z")

</div>

Let me try and look at it a little bit later today as i do have HA and all the HA nodes installed

Craig

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [10 August 2022 07:51 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/17 "2022-08-10T07:51:24Z")

</div>

OK so looking at your flow - if you use the nodes to turn on or off - then your function node is not run at that point - as you have it coming from a different starting point on the CronPlus node - so it will not be fired until the next run through (or a trigger node is fired again)

The simplest way would probably be to put a change\_state node that would feed into the cronplus node and act a trigger for it to update its status

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

You would have to check in developer tools what the state changes look like in HA from your nodes and if there are multiple entities you would need multiple change state nodes

Craig

---

<div class="post-metadata">

**Author:** ![cmartens](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cmartens](https://discourse.nodered.org/u/cmartens)\
**Post date:** [10 August 2022 12:47 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/18 "2022-08-10T12:47:13Z")

</div>

Mission completed! All issues have been solved! Thanks for your help!

At the end I was able to change the output of the node which switches off the device and sent that message back to the cron plus node. The final version of the flow looks like this:

 ![Schermafbeelding 2022-08-10 om 14.42.34](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/4/c4ec1347b81d7357bd9316c1926b3947be9812fc.jpeg)

The end result in Home Assistant look like this:

 ![Schermafbeelding 2022-08-10 om 14.27.33](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2ea2b93aa23482c1adc56eacd86bc0629c7fd792.png)

```auto
[{"id":"30e9e18e08e63fd3","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"5b910241fcc70820","type":"cronplus","z":"30e9e18e08e63fd3","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"fanOut","outputs":4,"options":[{"name":"on_sched","topic":"on","payloadType":"json","payload":"{\"state\": \"on\"}","expressionType":"cron","expression":"0 30 14 ? * WED *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"off_sched","topic":"off","payloadType":"json","payload":"{\"state\": \"off\"}","expressionType":"cron","expression":"0 30 14 ? * WED *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":180,"y":240,"wires":[["8f9f537a4c75e40d"],["e9da367b335dbe12"],[],["fa5b15823dd7afe6"]]},{"id":"106cbe4819f840f1","type":"function","z":"30e9e18e08e63fd3","name":"Date Next Run","func":"\nconst next = msg.payload.result.reduce((a, b) => a.status.nextDate < b.status.nextDate ? a : b)\nmsg.payload = {\n name: next.config.name,\n topic: next.config.topic,\n next: next.status.nextDate,\n nextLocal: next.status.nextDateTZ,\n timeZone: next.status.serverTimeZone,\n when: next.status.description,\n msUntil: next.status.nextDate.valueOf() - next.status.serverTime.valueOf(),\n description: next.status.nextDescription,\n}\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":320,"wires":[["5bca6964d1a2a3a5"]]},{"id":"0a75e7b008ae1c95","type":"api-call-service","z":"30e9e18e08e63fd3","name":"Date & Time","server":"ab0c7805.ea8858","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.tuin_beregening_datum_tijd_volgende_run"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":710,"y":320,"wires":[[]]},{"id":"5bca6964d1a2a3a5","type":"change","z":"30e9e18e08e63fd3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(msg.payload.next).lang(\"nl\").tz(\"Europe/Amsterdam\").format('lll')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":320,"wires":[["0a75e7b008ae1c95"]]},{"id":"21f1db9f6ca0572e","type":"api-call-service","z":"30e9e18e08e63fd3","name":"Pomp: Uit","server":"9d8c9ade.d8af7","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.tuin_verlichting"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"topic","propertyType":"msg","value":"status-all","valueType":"str"}],"queue":"none","output_location":"","output_location_type":"none","x":640,"y":240,"wires":[["5b910241fcc70820"]]},{"id":"b45fe18073ee5efd","type":"api-call-service","z":"30e9e18e08e63fd3","name":"Pomp: Aan","server":"9d8c9ade.d8af7","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.tuin_verlichting"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":630,"y":160,"wires":[[]]},{"id":"8f9f537a4c75e40d","type":"api-current-state","z":"30e9e18e08e63fd3","name":"Automatische beregening: Aan?","server":"ab0c7805.ea8858","version":3,"outputs":2,"halt_if":"Aan (ma, wo, vr, 07:00-08:00)","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.tuin_beregening_automatisch","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":160,"wires":[["b45fe18073ee5efd"],[]]},{"id":"e9da367b335dbe12","type":"api-current-state","z":"30e9e18e08e63fd3","name":"Automatische beregening: Aan?","server":"ab0c7805.ea8858","version":3,"outputs":2,"halt_if":"Aan (ma, wo, vr, 07:00-08:00)","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.tuin_beregening_automatisch","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":410,"y":240,"wires":[["21f1db9f6ca0572e"],[]]},{"id":"e6e8680f76376f6b","type":"api-call-service","z":"30e9e18e08e63fd3","name":"Date & Time","server":"ab0c7805.ea8858","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.tuin_beregening_datum_tijd_laatste_run"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":390,"y":440,"wires":[[]]},{"id":"fa5b15823dd7afe6","type":"function","z":"30e9e18e08e63fd3","name":"","func":"var now = new Date().toLocaleString(\"nl\", { year: 'numeric', month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false });\nreturn { payload: now };\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":235,"y":440,"wires":[["8c3fb5f13903a5cc"]],"l":false},{"id":"8c3fb5f13903a5cc","type":"change","z":"30e9e18e08e63fd3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(msg.payload.next).lang(\"nl\").tz(\"Europe/Amsterdam\").format('lll')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":380,"wires":[["e6e8680f76376f6b"]]},{"id":"a2adb87ef24caa47","type":"comment","z":"30e9e18e08e63fd3","name":"Option 3","info":"","x":320,"y":520,"wires":[]},{"id":"ab0c7805.ea8858","type":"server","name":"Home Assistant","version":4,"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"},{"id":"9d8c9ade.d8af7","type":"server","name":"Home Assistant","version":4,"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"}]

```

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [10 August 2022 15:40 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/19 "2022-08-10T15:40:37Z")

</div>

So at the end, it was not a Bigtimer challenge (that was simpler to solve), instead it developed into a cron+ challenge with a complex result, so better change the heading/topic of the first post

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 August 2022 15:47 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/20 "2022-08-10T15:47:36Z")

</div>

> [@krambriw](#):
>
> So at the end, it was not a Bigtimer challenge (that was simpler to solve)

I'm not certain that is true? The OP wanted the time of the next event (not the description of when it would occur)

> [@cmartens](#):
>
> However I would like to display the date and time of the next run

But, you are correct in that if the OP simply wanted the status from bigtimer, the status node was the way to go.

FWIW, I believe BigTimer is no longer actively developed and there is no link to the src - maybe pointing the OP to a different tool was worth it in the end.

IMO - leave the title as is, then anyone searching for "how to do something off-piste with BigTimer" can find there are solutions where BigTimer doesnt fit?

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [10 August 2022 16:02 UTC](https://discourse.nodered.org/t/bigtimer-challenge/66190/21 "2022-08-10T16:02:21Z")

</div>

Yes, you are right!  
Best regards, Walter

[Next page](https://discourse.nodered.org/t/bigtimer-challenge/66190.md?page=2)
