# EZtimer flow examples

**URL:** <https://discourse.nodered.org/t/eztimer-flow-examples/15483>\
**Category:** General\
**Created:** [12 September 2019 19:50 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483 "2019-09-12T19:50:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [12 September 2019 19:50 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/1 "2019-09-12T19:50:53Z")

</div>

Trying to integrate the contrib-eztimer node into a flow. My need is for a timer that can be programmatically set with days and on times. Bigtimer looks great but has limited ability to set days and times programmatically. Looked at various other timers and settled on eztimer. With all that said I have overcome various learning obstacles but still cannot get the eztimer to fire. I could post several dozens of flows I have experimented with but my question is does anyone have a flow they are willing to share that shows how to use the various functions of eztimer. I have gone all the way to the end of the internet without finding a flow. I would be open to changing timers but this has now become a personal challenge. The eztimer documentation seems normal for what I have seen but I have worn a hole in the screen running my finger along the commands. With all that said my basic need is to set the timer with various UI's on the dashboard  
Thanks  
and sorry for the long rant

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [12 September 2019 20:19 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/2 "2019-09-12T20:19:30Z")

</div>

Take a look at [light scheduler](https://flows.nodered.org/node/node-red-contrib-light-scheduler) (unless you have to span weeks and not a single week), you can configure it visually.

---

<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:** [12 September 2019 20:46 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/3 "2019-09-12T20:46:21Z")

</div>

Or Steve's new cron-plus node.

[https://discourse.nodered.org/t/updated-v0-3-0-a-flexible-multiple-scheduler-node-incl-timezone-support-node-red-contrib-cron-plus/13686/55](https://discourse.nodered.org/t/updated-v0-3-0-a-flexible-multiple-scheduler-node-incl-timezone-support-node-red-contrib-cron-plus/13686/55)

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [30 November 2020 17:23 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/4 "2020-11-30T17:23:15Z")

</div>

Using the NODE "EZTIMER" to programatically set the ON TIME and OFF Time

In the Function, setting the ontime . then passing it as message to the EZTIMER node.  
//setting ontime  
msg.payload = {'ontime':'11:56:00'};  
//add other properties  
return msg;

However, the EZTimer never fires and get error:  
"Invalid object (msg.payload) input."

If there are different suggestion to programatically set the scheduler please kindly share.

---

<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:** [30 November 2020 17:36 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/5 "2020-11-30T17:36:16Z")

</div>

Can you add a debug node showing what is going into the node and paste here what it shows please.

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [30 November 2020 20:44 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/6 "2020-11-30T20:44:51Z")

</div>

```auto
[{"id":"68c98b3a.b4f794","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"38f8b634.d27c0a","type":"debug","z":"68c98b3a.b4f794","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":200,"wires":[]},{"id":"d3ce9f08.2b459","type":"eztimer","z":"68c98b3a.b4f794","name":"timer","debug":false,"autoname":"17:00 - dusk","tag":"eztimer","suspended":true,"sendEventsOnSuspend":false,"lat":"","lon":"","timerType":"1","startupMessage":true,"ontype":"2","ontimesun":"dawn","ontimetod":"17:00","onpropertytype":"msg","onproperty":"payload","onvaluetype":"num","onvalue":1,"onoffset":0,"onrandomoffset":0,"onsuppressrepeats":false,"offtype":"2","offtimesun":"dusk","offtimetod":"dusk","offduration":"00:01:00","offpropertytype":"msg","offproperty":"payload","offvaluetype":"num","offvalue":0,"offoffset":0,"offrandomoffset":0,"offsuppressrepeats":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":650,"y":260,"wires":[["38f8b634.d27c0a"]]},{"id":"eff7d809.931148","type":"function","z":"68c98b3a.b4f794","name":"Set On Time ","func":"\n//setting ontime\nmsg.payload = {'ontime':'11:56:00'};\n//add other properties \nreturn msg;\n\n\n","outputs":1,"noerr":0,"x":470,"y":260,"wires":[["d3ce9f08.2b459","48e3e6ea.6c9b98"]]},{"id":"48e3e6ea.6c9b98","type":"debug","z":"68c98b3a.b4f794","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":550,"y":160,"wires":[]},{"id":"d80c34fe.58a6c8","type":"inject","z":"68c98b3a.b4f794","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":300,"y":260,"wires":[["eff7d809.931148"]]}]

```

---

<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:** [30 November 2020 21:03 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/7 "2020-11-30T21:03:07Z")

</div>

Not the flow, what a debug node shows.

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [30 November 2020 21:10 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/8 "2020-11-30T21:10:32Z")

</div>

Here is the debug info:  
 ![debug](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/742bde4e103644f04914f1f987987fff43afed4b.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:** [30 November 2020 21:12 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/9 "2020-11-30T21:12:06Z")

</div>

I assumed when you posted the original function that you had other stuff in the function (where you had the comment about adding other properties) but I see that is not the case.  
See [https://github.com/mrgadget/node-red-contrib-eztimer/issues/41](https://github.com/mrgadget/node-red-contrib-eztimer/issues/41)  
It has apparently been fixed but not yet released to npm.

---

<div class="post-metadata">

**Author:** ![sweetwater](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sweetwater](https://discourse.nodered.org/u/sweetwater)\
**Post date:** [6 December 2020 17:41 UTC](https://discourse.nodered.org/t/eztimer-flow-examples/15483/10 "2020-12-06T17:41:20Z")

</div>

Changed to using the "SCHEDEX" Node and works as expected.
