Inject preset numbers at different times of day

Another possibility using the inbuilt nodes:

[{"id":"f4f88c80.c5fc5","type":"change","z":"1d66267b.4c5caa","name":"","rules":[{"t":"set","p":"time","pt":"msg","to":"$substring($fromMillis(payload+36E5),11,5)","tot":"jsonata"},{"t":"set","p":"output","pt":"flow","to":"$exists($flowContext(\"output\")) ? $flowContext(\"output\") : \"Assigned\" ","tot":"jsonata"},{"t":"set","p":"output","pt":"flow","to":"time = \"13:25\" ? \"First Condition\" : $flowContext(\"output\")","tot":"jsonata"},{"t":"set","p":"output","pt":"flow","to":"time = \"13:30\" ? \"Second Condition\" : $flowContext(\"output\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":460,"wires":[["b94eb2b2.7aaa1"]]},{"id":"b94eb2b2.7aaa1","type":"debug","z":"1d66267b.4c5caa","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"$flowContext(\"output\")","targetType":"jsonata","x":550,"y":460,"wires":[]},{"id":"7963cee6.9568e","type":"inject","z":"1d66267b.4c5caa","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":460,"wires":[["f4f88c80.c5fc5"]]}]
1 Like