biddster / node-red-contrib-schedex

Scheduler for node-red which allows you to enter on/off times as 24hr clock (e.g. 01:10) or suncalc events (e.g. goldenHour). It also allows you to offset times and randomise the time within the offset.
22 stars 17 forks source link

Request for single on or off time to be valid #22

Closed TinajaLabs closed 5 years ago

TinajaLabs commented 7 years ago

I have a LIFX LED bulb. I would like to change it to different colors during the course of the evening.

What I'm configuring is a series of schedex timers that change the color (by payload values) for each time changing the color at goldenHour, night, nadir, etc.

What I think I need is series of the timer nodes that just set the LIFX on with a different color. I don't need the off settings.

Unfortunately I get an error if I do not define the off time.

Additionally there's a conundrum about what happens if I define night for the off time in one color changing schedex node and night for the on time in a subsequent color changing schedex node. What if the on hits before the off?

On the last node I am using an off and an on time.

This is a request to validate a schedex node with only an off or on time defined.

biddster commented 7 years ago

I think you can achieve what you want much easier by using the sun events node directly.

https://www.npmjs.com/package/node-red-contrib-sunevents

biddster commented 7 years ago

Does this example help?

Note that you'll need to edit the sun events node and insert your long/lat location.

[{"id":"2e82fff8.81df6","type":"sun events","z":"465f1675.c1e758","testmode":"N","verbose":"N","topic":"","name":"","x":218.5,"y":617,"wires":[["7df61111.719a9"]]},{"id":"7df61111.719a9","type":"switch","z":"465f1675.c1e758","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"goldenHour","vt":"str"},{"t":"eq","v":"sunset","vt":"str"},{"t":"eq","v":"dusk","vt":"str"}],"checkall":"true","outputs":3,"x":370.5,"y":617,"wires":[["2bae7853.9545e8"],["2cc602f9.25ca0e"],["437c7376.1b9cac"]]},{"id":"2bae7853.9545e8","type":"change","z":"465f1675.c1e758","name":"golden hour -> red lights","rules":[{"t":"set","p":"payload","pt":"msg","to":"red","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":575.5,"y":581,"wires":[["ce8d85af.294578"]]},{"id":"2cc602f9.25ca0e","type":"change","z":"465f1675.c1e758","name":"sunset -> yellow lights","rules":[{"t":"set","p":"payload","pt":"msg","to":"yellow","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"yellow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":566,"y":618,"wires":[["ce8d85af.294578"]]},{"id":"437c7376.1b9cac","type":"change","z":"465f1675.c1e758","name":"dusk -> blue lights","rules":[{"t":"set","p":"payload","pt":"msg","to":"blue","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"blue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":558,"y":656,"wires":[["ce8d85af.294578"]]},{"id":"1b8559f6.ef5366","type":"inject","z":"465f1675.c1e758","name":"Off at midnight","topic":"off","payload":"off","payloadType":"str","repeat":"","crontab":"00 00 * * *","once":false,"x":561.5,"y":700,"wires":[["ce8d85af.294578"]]},{"id":"ce8d85af.294578","type":"debug","z":"465f1675.c1e758","name":"Replace with LIFX node...","active":true,"console":"false","complete":"true","x":893.5,"y":652,"wires":[]}]
TinajaLabs commented 7 years ago

Probably will. I'll check it this eve. Thanks.

biddster commented 7 years ago

Did that above help @TinajaLabs ?

jwygralak67 commented 6 years ago

I'd like to bump this issue. My use case is that I want to use schedex as an alarm clock. I want to set an ontime and have schedex emit a message that initiates some process, but I don't need it to emit any message for an offtime, as stopping the alarm process will be done via user input.

I suppose I could work around the issue by setting on & offtimes, then putting a filter on the output which throws away the off message.

biddster commented 5 years ago

Fixed in 1.3.0.