Time input for dashbord

Now I have a inject node that switches a lamp on at 18:00 and off at 21:00

Sometimes I would like to set the off time a bit later and this is not possible in the dashboard.
I always have to program the input node again.

Is there a node that I can use in my dashboard to change the inject node ?

What do you mean by 'input node'?

Sorry. It’s the inject node.

There are a number of nodes that you can use for scheduling, such as node-red-contrib-cron-plus and there have been threads here on how to control them from the dashboard to setup and modify the schedule. If you search the forum you should be able to find some of them which may be helpful.

have a look at the schedex node and the mytimeout node - it will do what you want fairly easily

It accepts programmatic input - here is a basic flow that i use on my dashboard to adjust run times - should give you an idea

 [{"id":"64720192.6b3d","type":"debug","z":"a78930fe.ed232","name":"Solar Fire up - Node 1","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":890,"y":1360,"wires":[]},{"id":"9680b48.80c2a48","type":"mqtt out","z":"a78930fe.ed232","name":"","topic":"cmnd/ArduinoLive/SolarPumpControl","qos":"","retain":"","broker":"389dd264.7716de","x":930,"y":1400,"wires":[]},{"id":"babce9af.92eef8","type":"inject","z":"a78930fe.ed232","name":"Turn off Solar - Manual","topic":"cmnd/ArduinoLive/SolarPumpControl","payload":"0","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":140,"y":1440,"wires":[["376f9496.b6e4ac"]]},{"id":"6cd82dbe.ac54f4","type":"ui_button","z":"a78930fe.ed232","name":"Manual Turn on of Solar 1hr","group":"624acab0.30b154","order":2,"width":0,"height":0,"passthru":false,"label":"Manual Solar 1 Hr Turn on","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{     \"payload\": \"on\",     \"timeout\": 3600,     \"warning\": 5 }","payloadType":"json","topic":"cmnd/ArduinoLive/SolarPumpControl","x":140,"y":1360,"wires":[["376f9496.b6e4ac"]]},{"id":"250da7e7.ad0408","type":"ui_button","z":"a78930fe.ed232","name":"Turn off Manual Solar Override","group":"624acab0.30b154","order":1,"width":0,"height":0,"passthru":false,"label":"Turn off Manual Solar Override","color":"","bgcolor":"","icon":"","payload":"0","payloadType":"str","topic":"cmnd/ArduinoLive/SolarPumpControl","x":150,"y":1400,"wires":[["376f9496.b6e4ac"]]},{"id":"2793aadd.647516","type":"debug","z":"a78930fe.ed232","name":"Solar Fire up - Node 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":880,"y":1460,"wires":[]},{"id":"5a0b2ab1.d04264","type":"ui_button","z":"a78930fe.ed232","name":"Manual Turn on of Solar 2hr","group":"624acab0.30b154","order":3,"width":0,"height":0,"passthru":false,"label":"Manual Solar 2 Hr Turn on","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{     \"payload\": \"on\",     \"timeout\": 7200,     \"warning\": 5 }","payloadType":"json","topic":"cmnd/ArduinoLive/SolarPumpControl","x":140,"y":1320,"wires":[["376f9496.b6e4ac"]]},{"id":"376f9496.b6e4ac","type":"mytimeout","z":"a78930fe.ed232","name":"Solar Manual Turn on - New Node","outtopic":"cmnd/ArduinoLive/SolarPumpControl","outsafe":"1","outwarning":"","outunsafe":"0","warning":"2","timer":"10","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":560,"y":1360,"wires":[["9680b48.80c2a48","64720192.6b3d"],["2793aadd.647516","75601030.93d14"]]},{"id":"75601030.93d14","type":"change","z":"a78930fe.ed232","name":"Set Flow Variable - SolarTimeToRun","rules":[{"t":"set","p":"SolarTimeToRun","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1460,"wires":[["7e7043e8.2ed23c"]]},{"id":"7e7043e8.2ed23c","type":"ui_text_input","z":"a78930fe.ed232","name":"","label":"Manual Solar  - Time to run (Sec)","group":"624acab0.30b154","order":6,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":910,"y":1520,"wires":[[]]},{"id":"d5118861.8ea138","type":"ui_button","z":"a78930fe.ed232","name":"Manual Turn on of Solar 4hr","group":"624acab0.30b154","order":4,"width":0,"height":0,"passthru":false,"label":"Manual Solar 4 Hr Turn on","color":"","bgcolor":"","icon":"","payload":"{     \"payload\": \"on\",     \"timeout\": 14400,     \"warning\": 5 }","payloadType":"json","topic":"cmnd/ArduinoLive/SolarPumpControl","x":140,"y":1280,"wires":[["376f9496.b6e4ac"]]},{"id":"a8b8782b.513db8","type":"ui_button","z":"a78930fe.ed232","name":"Manual Turn on of Solar 6hr","group":"624acab0.30b154","order":5,"width":0,"height":0,"passthru":false,"label":"Manual Solar 6 Hr Turn on","tooltip":"","color":"","bgcolor":"","icon":"","payload":"{     \"payload\": \"on\",     \"timeout\": 21600,     \"warning\": 5 }","payloadType":"json","topic":"cmnd/ArduinoLive/SolarPumpControl","x":140,"y":1240,"wires":[["376f9496.b6e4ac"]]},{"id":"389dd264.7716de","type":"mqtt-broker","z":"a78930fe.ed232","broker":"localhost","port":"1883","clientid":"Node-Red","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"624acab0.30b154","type":"ui_group","z":"","name":"Solar Control","tab":"c9d53e06.a95c8","order":8,"disp":true,"width":"6","collapse":true},{"id":"c9d53e06.a95c8","type":"ui_tab","z":"","name":"CURTIN house main page","icon":"dashboard","order":1}]

Setup a schedule in the schedex node for your normal runtimes

Setup the mytimeout node if you want to vary them and feed it into the schedex node

Craig

Looks good.
I'm testing it and looks like I can use it!

Also setup another Schedex node to run once a day (say 12:01) in the night - this will reset your schedules back to auto in case you have moved them to manual as part of this (and then forgotten about putting them into Manual mode !!) - Ask me how i know this one !!

Craig

With the Cron-plus node, you have 100% dynamic control possibilities

Latest versions can also persist dynamically created (e.g. via dashboard) schedules

Here is a basic example...

https://flows.nodered.org/flow/79a66966a6cc655a827872a4af794b94

1 Like