EZtimer flow examples

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

Take a look at light scheduler (unless you have to span weeks and not a single week), you can configure it visually.

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

3 Likes

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.

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

[{"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"]]}]

Not the flow, what a debug node shows.

Here is the debug info:
debug

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
It has apparently been fixed but not yet released to npm.

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