Schedex of Cronplus node for a dashboard Alarm Clock?

Hi,

I am trying to create a weekday alarm clock live dashboard.
The image below is the user interface

image

If the time is set and the day is activated, a music stream is send with a Castv2 Node to a Google Home mini device when the selected time starts. (I already got a flow of this i.c.w. Domoticz/Mqtt)

The development of the flow is at a point of which I must decide whether to use a Schedex or Cronplus node. Can somebody advise me which node is more suitable for this flow?

I dont know about Schedex but i can say Cron-plus is more than capable of doing this. (disclaimer, I am the author)

Additionally, cron-plus has the ability to persist dynamically setup schedules (i.e. dynamic setup schedules will be reloaded after a power outage)

cron-plus has built in demos (CTRL+I --> examples) and the built-in help is extensive with code snippets for adding/updating schedules dynamically.

And if you get stuck, you can always ask.

Thanx, I will dig in to it

Hi Steve,

I have studied the Cron Plus node, but I still have some questions.
I managed to send a dynamic schedule to the cron plus node with a change node.
However, I want to control this with a dashboard switch node.
If the dashboard switch node is switched on, the schedule is sent to to Cron Plus node (this works)

How can I remove the dynamic schedule when the dashboard switch node is off?

Below is my current flow

[{"id":"e8cdc00d.87099","type":"tab","label":"Wekker Faye-Linn","disabled":false,"info":""},{"id":"aae6611c.a66c7","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Mon","tooltip":"","group":"da420f01.d894","order":1,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"Monday","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":290,"y":580,"wires":[["22170e5a38bdec50"]]},{"id":"77d0c4a5.be627c","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Tue","tooltip":"","group":"da420f01.d894","order":4,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":290,"y":660,"wires":[["353506f6e82b98f9"]]},{"id":"92ad6c9f.a4a1d","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Wed","tooltip":"","group":"da420f01.d894","order":7,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":290,"y":740,"wires":[[]]},{"id":"773c2125.0cbae","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Thu","tooltip":"","group":"da420f01.d894","order":10,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":290,"y":820,"wires":[[]]},{"id":"8e297cd7.e25df","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Fri","tooltip":"","group":"da420f01.d894","order":13,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":290,"y":900,"wires":[[]]},{"id":"da8ea047.5c739","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Sat","tooltip":"","group":"da420f01.d894","order":16,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":290,"y":980,"wires":[[]]},{"id":"db94dd1e.8ac2f","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Sun","tooltip":"","group":"da420f01.d894","order":19,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":290,"y":1060,"wires":[[]]},{"id":"bfab46e7.f996a8","type":"ui_text_input","z":"e8cdc00d.87099","name":"Tue Time Input","label":"","tooltip":"","group":"da420f01.d894","order":5,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"Tuesday","sendOnBlur":true,"className":"","topicType":"str","x":360,"y":180,"wires":[["2f5c47e98d2ecd48"]]},{"id":"6870fbb6.42b744","type":"ui_text_input","z":"e8cdc00d.87099","name":"Wed Time Input","label":"","tooltip":"","group":"da420f01.d894","order":8,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":240,"wires":[["e7eeae169214dbd5"]]},{"id":"fab06d63.52087","type":"ui_text_input","z":"e8cdc00d.87099","name":"Thu Time Input","label":"","tooltip":"","group":"da420f01.d894","order":11,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":300,"wires":[["eb30469c342dc463"]]},{"id":"d9cf7c61.134aa","type":"ui_text_input","z":"e8cdc00d.87099","name":"Fri Time Input","label":"","tooltip":"","group":"da420f01.d894","order":14,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":360,"wires":[["d18e7b9714220ee5"]]},{"id":"8fdbf870.9c1848","type":"ui_text_input","z":"e8cdc00d.87099","name":"Sat Time Input","label":"","tooltip":"","group":"da420f01.d894","order":17,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":420,"wires":[["2491c39b3bb6f40c"]]},{"id":"dbbe962a.4b8fe8","type":"ui_text_input","z":"e8cdc00d.87099","name":"Sun Time Input","label":"","tooltip":"","group":"da420f01.d894","order":20,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":480,"wires":[["c01a45a28e39393e"]]},{"id":"fdef54bec95c36d2","type":"cronplus","z":"e8cdc00d.87099","name":"Cron Timer","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[],"x":1290,"y":760,"wires":[["565295d90ae4291e"]]},{"id":"b34ef5deb0d18471","type":"ui_text_input","z":"e8cdc00d.87099","name":"Mon Time Input","label":"","tooltip":"","group":"da420f01.d894","order":2,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"Monday","sendOnBlur":true,"className":"","topicType":"str","x":360,"y":120,"wires":[["38b1310a96f5ef43"]]},{"id":"565295d90ae4291e","type":"debug","z":"e8cdc00d.87099","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1510,"y":760,"wires":[]},{"id":"6d42b56e4b831218","type":"ui_button","z":"e8cdc00d.87099","name":"Mon Button Set","group":"da420f01.d894","order":3,"width":"1","height":"1","passthru":true,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::mon_time","payloadType":"flow","topic":"Monday","topicType":"str","x":800,"y":120,"wires":[["c930f9f8fc93bafc"]]},{"id":"38b1310a96f5ef43","type":"change","z":"e8cdc00d.87099","name":"Save Mon Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::mon_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":120,"wires":[[]]},{"id":"6ad0078034d60395","type":"ui_button","z":"e8cdc00d.87099","name":"Tue Button Set","group":"da420f01.d894","order":6,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::tue_time","payloadType":"flow","topic":"Tuesday","topicType":"str","x":800,"y":180,"wires":[["c930f9f8fc93bafc"]]},{"id":"c97db69981cf6a70","type":"ui_button","z":"e8cdc00d.87099","name":"Wed Button Set","group":"da420f01.d894","order":9,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::wed_time","payloadType":"flow","topic":"Wednesday","topicType":"str","x":800,"y":240,"wires":[["c930f9f8fc93bafc"]]},{"id":"0882ef96f56ddd68","type":"ui_button","z":"e8cdc00d.87099","name":"Thu Button Set","group":"da420f01.d894","order":12,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::thu_time","payloadType":"flow","topic":"Thursday","topicType":"str","x":800,"y":300,"wires":[["c930f9f8fc93bafc"]]},{"id":"e0e859c4b760b969","type":"ui_button","z":"e8cdc00d.87099","name":"Fri Button Set","group":"da420f01.d894","order":15,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::fri_time","payloadType":"flow","topic":"Friday","topicType":"str","x":800,"y":360,"wires":[["c930f9f8fc93bafc"]]},{"id":"a87b026b0e95cb27","type":"ui_button","z":"e8cdc00d.87099","name":"Sat Button Set","group":"da420f01.d894","order":18,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::sat_time","payloadType":"flow","topic":"Saturday","topicType":"str","x":800,"y":420,"wires":[["c930f9f8fc93bafc"]]},{"id":"9814f704097cc590","type":"ui_button","z":"e8cdc00d.87099","name":"Sun Button Set","group":"da420f01.d894","order":21,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::sun_time","payloadType":"flow","topic":"Sunday","topicType":"str","x":800,"y":480,"wires":[["c930f9f8fc93bafc"]]},{"id":"1c5608474741b6d6","type":"inject","z":"e8cdc00d.87099","name":"Inject Mon Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::mon_time","payloadType":"flow","x":160,"y":120,"wires":[["b34ef5deb0d18471"]]},{"id":"2f5c47e98d2ecd48","type":"change","z":"e8cdc00d.87099","name":"Save Tue Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::tue_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":180,"wires":[[]]},{"id":"6f62cbb764d9f78d","type":"inject","z":"e8cdc00d.87099","name":"Inject Tue Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::tue_time","payloadType":"flow","x":160,"y":180,"wires":[["bfab46e7.f996a8"]]},{"id":"0f11b3517ca554d7","type":"inject","z":"e8cdc00d.87099","name":"Inject Wed Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::wed_time","payloadType":"flow","x":160,"y":240,"wires":[["6870fbb6.42b744"]]},{"id":"95856fbc7e5fd10a","type":"inject","z":"e8cdc00d.87099","name":"Inject Thu Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::thu_time","payloadType":"flow","x":160,"y":300,"wires":[["fab06d63.52087"]]},{"id":"667f07261dcd9464","type":"inject","z":"e8cdc00d.87099","name":"Inject Fri Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::fri_time","payloadType":"flow","x":160,"y":360,"wires":[["d9cf7c61.134aa"]]},{"id":"3cf0bb075c928f69","type":"inject","z":"e8cdc00d.87099","name":"Inject Sat Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::sat_time","payloadType":"flow","x":160,"y":420,"wires":[["8fdbf870.9c1848"]]},{"id":"271d25e0bb232217","type":"inject","z":"e8cdc00d.87099","name":"Inject Sun Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::sun_time","payloadType":"flow","x":160,"y":480,"wires":[["dbbe962a.4b8fe8"]]},{"id":"e7eeae169214dbd5","type":"change","z":"e8cdc00d.87099","name":"Save Wed Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::wed_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":240,"wires":[[]]},{"id":"eb30469c342dc463","type":"change","z":"e8cdc00d.87099","name":"Save Thu Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::thu_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":300,"wires":[[]]},{"id":"d18e7b9714220ee5","type":"change","z":"e8cdc00d.87099","name":"Save Fri Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::fri_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":360,"wires":[[]]},{"id":"2491c39b3bb6f40c","type":"change","z":"e8cdc00d.87099","name":"Save Sat Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::sat_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":420,"wires":[[]]},{"id":"c01a45a28e39393e","type":"change","z":"e8cdc00d.87099","name":"Save Sun Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::sun_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":480,"wires":[[]]},{"id":"c930f9f8fc93bafc","type":"function","z":"e8cdc00d.87099","name":"Save Weekdays Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Monday\"){\n    \n    // Cron number for day\n    var time1 = \"0 \" + calcTime(flow.get(\"mon_time\", \"file\")) + 1;\n    flow.set(\"ct_mon_time\", time1, \"file\");\n    \n    //msg.payload;\n    msg.payload = time1;\n\n    return msg;\n}\n\nif(msg.topic === \"Tuesday\"){\n    \n    // Cron number for day\n    var time2 = \"0 \" + calcTime(flow.get(\"tue_time\", \"file\")) + 2;\n    flow.set(\"ct_tue_time\", time2, \"file\");\n    \n    //msg.payload;\n    msg.payload = time2;\n\n    return msg;\n}\n\nif(msg.topic === \"Wednesday\"){\n    \n    // Cron number for day\n    var time3 = \"0 \" + calcTime(flow.get(\"wed_time\", \"file\")) + 3;\n    flow.set(\"ct_wed_time\", time3, \"file\");\n    \n    //msg.payload;\n    msg.payload = time3;\n\n    return msg;\n}\n\nif(msg.topic === \"Thursday\"){\n    \n    // Cron number for day\n    var time4 = \"0 \" + calcTime(flow.get(\"thu_time\", \"file\")) + 4;\n    flow.set(\"ct_thu_time\", time4, \"file\");\n    \n    //msg.payload;\n    msg.payload = time4;\n\n    return msg;\n}\n\nif(msg.topic === \"Friday\"){\n    \n    // Cron number for day\n    var time5 = \"0 \" + calcTime(flow.get(\"fri_time\", \"file\")) + 5;\n    flow.set(\"ct_fri_time\", time5, \"file\");\n    \n    //msg.payload;\n    msg.payload = time5;\n\n    return msg;\n}\n\nif(msg.topic === \"Saturday\"){\n    \n    // Cron number for day\n    var time6 = \"0 \" + calcTime(flow.get(\"sat_time\", \"file\")) + 6;\n    flow.set(\"ct_sat_time\", time6, \"file\");\n    \n    //msg.payload;\n    msg.payload = time6;\n\n    return msg;\n}\n\nif(msg.topic === \"Sunday\"){\n    \n    // Cron number for day\n    var time7 = \"0 \" + calcTime(flow.get(\"sun_time\", \"file\")) + 7;\n    flow.set(\"ct_sun_time\", time7, \"file\");\n    \n    //msg.payload;\n    msg.payload = time7;\n\n    return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1140,"y":300,"wires":[["87416a2da2154fe8"]]},{"id":"87416a2da2154fe8","type":"debug","z":"e8cdc00d.87099","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1410,"y":300,"wires":[]},{"id":"a0ad79f939a6d8f1","type":"change","z":"e8cdc00d.87099","name":"Monday Cron Plus Input","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Monday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_mon_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":540,"wires":[["fdef54bec95c36d2"]]},{"id":"22170e5a38bdec50","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":580,"wires":[["a0ad79f939a6d8f1"],[]]},{"id":"b4e6523a5d225d4a","type":"change","z":"e8cdc00d.87099","name":"Tuesday Cron Plus Input","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Tuesday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_tue_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":640,"wires":[["fdef54bec95c36d2"]]},{"id":"353506f6e82b98f9","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":660,"wires":[["b4e6523a5d225d4a"],[]]},{"id":"da420f01.d894","type":"ui_group","name":"Week Timer","tab":"89465ae5.96ed08","order":1,"disp":true,"width":"6","collapse":true},{"id":"89465ae5.96ed08","type":"ui_tab","name":"Wekker Faye-Linn","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

Send a topic of "remove" and the schedule name in the payload

from the built in help...

Example : Using a simple topic command to delete a schedule named "schedule1"

msg: {
  "topic": "remove",
  "payload": "schedule1"
}

Thanx, I found the solution also yesterday evening late!
I use a change node this also works

image

This part of the flow is almost finished now.
When switched "ON" the schedule with the calculated cron time [file] is send to the Cron Plus Node.
When switched "OFF" the schedule is removed.

The next challenge is that if a Time Input Node is changed by the user there are 2 possiblities:

  • If the Switch is (already) ON, the schedule (time) needs to be updated in the Cron Plus Node
  • If the Switch is OFF, nothing should happen (only after the switch is turned ON, but that already works)

How do I accomplish that?

Here is my current flow

[{"id":"e8cdc00d.87099","type":"tab","label":"Wekker Faye-Linn","disabled":false,"info":""},{"id":"aae6611c.a66c7","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Mon","tooltip":"","group":"da420f01.d894","order":1,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"Monday","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":370,"y":600,"wires":[["6186c8d238efda83","22170e5a38bdec50"]]},{"id":"77d0c4a5.be627c","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Tue","tooltip":"","group":"da420f01.d894","order":4,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":370,"y":680,"wires":[["353506f6e82b98f9","ddf8c6cf65c79d5a"]]},{"id":"92ad6c9f.a4a1d","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Wed","tooltip":"","group":"da420f01.d894","order":7,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":370,"y":760,"wires":[["9da24a8949c43619","d438f1ac4f576dd3"]]},{"id":"773c2125.0cbae","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Thu","tooltip":"","group":"da420f01.d894","order":10,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":370,"y":840,"wires":[["64abbd4f1f44fb55","ad4f6d036a21e4b8"]]},{"id":"8e297cd7.e25df","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Fri","tooltip":"","group":"da420f01.d894","order":13,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":370,"y":920,"wires":[["806278b86f4e8701","99f89bea7c9ff775"]]},{"id":"da8ea047.5c739","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Sat","tooltip":"","group":"da420f01.d894","order":16,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":370,"y":1000,"wires":[["a69b9689709c63c6","a6255d1d755ff807"]]},{"id":"db94dd1e.8ac2f","type":"ui_switch","z":"e8cdc00d.87099","name":"","label":"Sun","tooltip":"","group":"da420f01.d894","order":19,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"x":370,"y":1080,"wires":[["97c648c3c54376a6","484337076deef0b9"]]},{"id":"bfab46e7.f996a8","type":"ui_text_input","z":"e8cdc00d.87099","name":"Tue Time Input","label":"","tooltip":"","group":"da420f01.d894","order":5,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"Tuesday","sendOnBlur":true,"className":"","topicType":"str","x":360,"y":180,"wires":[["2f5c47e98d2ecd48"]]},{"id":"6870fbb6.42b744","type":"ui_text_input","z":"e8cdc00d.87099","name":"Wed Time Input","label":"","tooltip":"","group":"da420f01.d894","order":8,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":240,"wires":[["e7eeae169214dbd5"]]},{"id":"fab06d63.52087","type":"ui_text_input","z":"e8cdc00d.87099","name":"Thu Time Input","label":"","tooltip":"","group":"da420f01.d894","order":11,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":300,"wires":[["eb30469c342dc463"]]},{"id":"d9cf7c61.134aa","type":"ui_text_input","z":"e8cdc00d.87099","name":"Fri Time Input","label":"","tooltip":"","group":"da420f01.d894","order":14,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":360,"wires":[["d18e7b9714220ee5"]]},{"id":"8fdbf870.9c1848","type":"ui_text_input","z":"e8cdc00d.87099","name":"Sat Time Input","label":"","tooltip":"","group":"da420f01.d894","order":17,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":420,"wires":[["2491c39b3bb6f40c"]]},{"id":"dbbe962a.4b8fe8","type":"ui_text_input","z":"e8cdc00d.87099","name":"Sun Time Input","label":"","tooltip":"","group":"da420f01.d894","order":20,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":360,"y":480,"wires":[["c01a45a28e39393e"]]},{"id":"fdef54bec95c36d2","type":"cronplus","z":"e8cdc00d.87099","name":"Cron Timer","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[],"x":1390,"y":740,"wires":[["565295d90ae4291e"]]},{"id":"b34ef5deb0d18471","type":"ui_text_input","z":"e8cdc00d.87099","name":"Mon Time Input","label":"","tooltip":"","group":"da420f01.d894","order":2,"width":"3","height":"1","passthru":true,"mode":"time","delay":"0","topic":"Monday","sendOnBlur":true,"className":"","topicType":"str","x":360,"y":120,"wires":[["38b1310a96f5ef43"]]},{"id":"565295d90ae4291e","type":"debug","z":"e8cdc00d.87099","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1550,"y":740,"wires":[]},{"id":"6d42b56e4b831218","type":"ui_button","z":"e8cdc00d.87099","name":"Mon Button Set","group":"da420f01.d894","order":3,"width":"1","height":"1","passthru":true,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::mon_time","payloadType":"flow","topic":"Monday","topicType":"str","x":800,"y":120,"wires":[["c930f9f8fc93bafc"]]},{"id":"38b1310a96f5ef43","type":"change","z":"e8cdc00d.87099","name":"Save Mon Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::mon_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":120,"wires":[[]]},{"id":"6ad0078034d60395","type":"ui_button","z":"e8cdc00d.87099","name":"Tue Button Set","group":"da420f01.d894","order":6,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::tue_time","payloadType":"flow","topic":"Tuesday","topicType":"str","x":800,"y":180,"wires":[["52ea859234d131d8"]]},{"id":"c97db69981cf6a70","type":"ui_button","z":"e8cdc00d.87099","name":"Wed Button Set","group":"da420f01.d894","order":9,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::wed_time","payloadType":"flow","topic":"Wednesday","topicType":"str","x":800,"y":240,"wires":[["8304b9b3ab2bc60c"]]},{"id":"0882ef96f56ddd68","type":"ui_button","z":"e8cdc00d.87099","name":"Thu Button Set","group":"da420f01.d894","order":12,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::thu_time","payloadType":"flow","topic":"Thursday","topicType":"str","x":800,"y":300,"wires":[["4c5ddcda6dfbf8f6"]]},{"id":"e0e859c4b760b969","type":"ui_button","z":"e8cdc00d.87099","name":"Fri Button Set","group":"da420f01.d894","order":15,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::fri_time","payloadType":"flow","topic":"Friday","topicType":"str","x":800,"y":360,"wires":[["9dcf8585efef6e20"]]},{"id":"a87b026b0e95cb27","type":"ui_button","z":"e8cdc00d.87099","name":"Sat Button Set","group":"da420f01.d894","order":18,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::sat_time","payloadType":"flow","topic":"Saturday","topicType":"str","x":800,"y":420,"wires":[["3c9d91097537c772"]]},{"id":"9814f704097cc590","type":"ui_button","z":"e8cdc00d.87099","name":"Sun Button Set","group":"da420f01.d894","order":21,"width":"1","height":"1","passthru":false,"label":"Set","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"#:(file)::sun_time","payloadType":"flow","topic":"Sunday","topicType":"str","x":800,"y":480,"wires":[["46a8a75ab8b89102"]]},{"id":"1c5608474741b6d6","type":"inject","z":"e8cdc00d.87099","name":"Inject Mon Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::mon_time","payloadType":"flow","x":160,"y":120,"wires":[["b34ef5deb0d18471"]]},{"id":"2f5c47e98d2ecd48","type":"change","z":"e8cdc00d.87099","name":"Save Tue Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::tue_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":180,"wires":[[]]},{"id":"6f62cbb764d9f78d","type":"inject","z":"e8cdc00d.87099","name":"Inject Tue Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::tue_time","payloadType":"flow","x":160,"y":180,"wires":[["bfab46e7.f996a8"]]},{"id":"0f11b3517ca554d7","type":"inject","z":"e8cdc00d.87099","name":"Inject Wed Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::wed_time","payloadType":"flow","x":160,"y":240,"wires":[["6870fbb6.42b744"]]},{"id":"95856fbc7e5fd10a","type":"inject","z":"e8cdc00d.87099","name":"Inject Thu Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::thu_time","payloadType":"flow","x":160,"y":300,"wires":[["fab06d63.52087"]]},{"id":"667f07261dcd9464","type":"inject","z":"e8cdc00d.87099","name":"Inject Fri Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::fri_time","payloadType":"flow","x":160,"y":360,"wires":[["d9cf7c61.134aa"]]},{"id":"3cf0bb075c928f69","type":"inject","z":"e8cdc00d.87099","name":"Inject Sat Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::sat_time","payloadType":"flow","x":160,"y":420,"wires":[["8fdbf870.9c1848"]]},{"id":"271d25e0bb232217","type":"inject","z":"e8cdc00d.87099","name":"Inject Sun Time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::sun_time","payloadType":"flow","x":160,"y":480,"wires":[["dbbe962a.4b8fe8"]]},{"id":"e7eeae169214dbd5","type":"change","z":"e8cdc00d.87099","name":"Save Wed Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::wed_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":240,"wires":[[]]},{"id":"eb30469c342dc463","type":"change","z":"e8cdc00d.87099","name":"Save Thu Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::thu_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":300,"wires":[[]]},{"id":"d18e7b9714220ee5","type":"change","z":"e8cdc00d.87099","name":"Save Fri Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::fri_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":360,"wires":[[]]},{"id":"2491c39b3bb6f40c","type":"change","z":"e8cdc00d.87099","name":"Save Sat Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::sat_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":420,"wires":[[]]},{"id":"c01a45a28e39393e","type":"change","z":"e8cdc00d.87099","name":"Save Sun Time to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::sun_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":480,"wires":[[]]},{"id":"c930f9f8fc93bafc","type":"function","z":"e8cdc00d.87099","name":"Save Monday Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Monday\"){\n    \n    // Cron number for day\n    var time1 = \"0 \" + calcTime(flow.get(\"mon_time\", \"file\")) + 1;\n    flow.set(\"ct_mon_time\", time1, \"file\");\n    \n    //msg.payload;\n    msg.payload = time1;\n\n    return msg;\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":120,"wires":[[]]},{"id":"a0ad79f939a6d8f1","type":"change","z":"e8cdc00d.87099","name":"Add Monday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Monday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_mon_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":580,"wires":[["fdef54bec95c36d2"]]},{"id":"22170e5a38bdec50","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":600,"wires":[["a0ad79f939a6d8f1"],["335759b38884750c"]]},{"id":"b4e6523a5d225d4a","type":"change","z":"e8cdc00d.87099","name":"Add Tuesday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Tuesday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_tue_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":660,"wires":[["fdef54bec95c36d2"]]},{"id":"353506f6e82b98f9","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":680,"wires":[["b4e6523a5d225d4a"],["4fd7a5309b5d80c8"]]},{"id":"4fd7a5309b5d80c8","type":"change","z":"e8cdc00d.87099","name":"Remove Tuesday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"remove\",\"name\":\"Tuesday Time\"}]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":700,"wires":[["fdef54bec95c36d2"]]},{"id":"335759b38884750c","type":"change","z":"e8cdc00d.87099","name":"Remove Monday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"remove\",\"name\":\"Monday Time\"}]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":620,"wires":[["fdef54bec95c36d2"]]},{"id":"6186c8d238efda83","type":"change","z":"e8cdc00d.87099","name":"Save State to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::mon_state","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":560,"wires":[[]]},{"id":"f5a61b7e0864f369","type":"inject","z":"e8cdc00d.87099","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::mon_state","payloadType":"flow","x":200,"y":600,"wires":[["aae6611c.a66c7"]]},{"id":"ddf8c6cf65c79d5a","type":"change","z":"e8cdc00d.87099","name":"Save State to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::tue_state","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":640,"wires":[[]]},{"id":"9da24a8949c43619","type":"change","z":"e8cdc00d.87099","name":"Save State to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::wed_state","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":720,"wires":[[]]},{"id":"64abbd4f1f44fb55","type":"change","z":"e8cdc00d.87099","name":"Save State to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::thu_state","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":800,"wires":[[]]},{"id":"806278b86f4e8701","type":"change","z":"e8cdc00d.87099","name":"Save State to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::fri_state","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":880,"wires":[[]]},{"id":"a69b9689709c63c6","type":"change","z":"e8cdc00d.87099","name":"Save State to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::sat_state","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":960,"wires":[[]]},{"id":"97c648c3c54376a6","type":"change","z":"e8cdc00d.87099","name":"Save State to File","rules":[{"t":"move","p":"payload","pt":"msg","to":"#:(file)::sun_state","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1040,"wires":[[]]},{"id":"15ad0c2cf5b85192","type":"inject","z":"e8cdc00d.87099","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::tue_state","payloadType":"flow","x":200,"y":680,"wires":[["77d0c4a5.be627c"]]},{"id":"53163cdea1ec2955","type":"inject","z":"e8cdc00d.87099","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::wed_state","payloadType":"flow","x":200,"y":760,"wires":[["92ad6c9f.a4a1d"]]},{"id":"5d876e0b2131c76e","type":"inject","z":"e8cdc00d.87099","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::thu_state","payloadType":"flow","x":200,"y":840,"wires":[["773c2125.0cbae"]]},{"id":"653605b09db7d80c","type":"inject","z":"e8cdc00d.87099","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::fri_state","payloadType":"flow","x":190,"y":920,"wires":[["8e297cd7.e25df"]]},{"id":"b20e1588c0f11709","type":"inject","z":"e8cdc00d.87099","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::sat_state","payloadType":"flow","x":200,"y":1000,"wires":[["da8ea047.5c739"]]},{"id":"86a2d9a6724e90e9","type":"inject","z":"e8cdc00d.87099","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(file)::sun_state","payloadType":"flow","x":200,"y":1080,"wires":[["db94dd1e.8ac2f"]]},{"id":"77a13aa49ede0317","type":"change","z":"e8cdc00d.87099","name":"Add Wednesday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Wednesday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_wed_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":740,"wires":[["fdef54bec95c36d2"]]},{"id":"d438f1ac4f576dd3","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":760,"wires":[["77a13aa49ede0317"],["7275926526091b03"]]},{"id":"7275926526091b03","type":"change","z":"e8cdc00d.87099","name":"Remove Wednesday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"remove\",\"name\":\"Wednesday Time\"}]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":780,"wires":[["fdef54bec95c36d2"]]},{"id":"f64edff1599ddb86","type":"change","z":"e8cdc00d.87099","name":"Add Thursday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Thursday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_thu_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":820,"wires":[["fdef54bec95c36d2"]]},{"id":"ad4f6d036a21e4b8","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":840,"wires":[["f64edff1599ddb86"],["ac269bb080b2a59e"]]},{"id":"ac269bb080b2a59e","type":"change","z":"e8cdc00d.87099","name":"Remove Thursday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"remove\",\"name\":\"Thursday Time\"}]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":860,"wires":[["fdef54bec95c36d2"]]},{"id":"d975ff792a448c28","type":"change","z":"e8cdc00d.87099","name":"Add Friday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Friday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_fri_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":900,"wires":[["fdef54bec95c36d2"]]},{"id":"99f89bea7c9ff775","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":920,"wires":[["d975ff792a448c28"],["26175e4704b3dca8"]]},{"id":"26175e4704b3dca8","type":"change","z":"e8cdc00d.87099","name":"Remove Friday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"remove\",\"name\":\"Friday Time\"}]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":940,"wires":[["fdef54bec95c36d2"]]},{"id":"99b107142e1c0ca4","type":"change","z":"e8cdc00d.87099","name":"Add Saturday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Saturday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_sat_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":980,"wires":[["fdef54bec95c36d2"]]},{"id":"a6255d1d755ff807","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":1000,"wires":[["99b107142e1c0ca4"],["bb1a06776ae9a645"]]},{"id":"bb1a06776ae9a645","type":"change","z":"e8cdc00d.87099","name":"Remove Saturday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"remove\",\"name\":\"Saturday Time\"}]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":1020,"wires":[["fdef54bec95c36d2"]]},{"id":"d4b4f3d028b194b7","type":"change","z":"e8cdc00d.87099","name":"Add Sunday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload.name","pt":"msg","to":"Sunday Time","tot":"str"},{"t":"set","p":"payload.expression","pt":"msg","to":"#:(file)::ct_sun_time","tot":"flow"},{"t":"set","p":"payload.command","pt":"msg","to":"add","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"str","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":1060,"wires":[["fdef54bec95c36d2"]]},{"id":"484337076deef0b9","type":"switch","z":"e8cdc00d.87099","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":1080,"wires":[["d4b4f3d028b194b7"],["64c3c9c86c1f1b4c"]]},{"id":"64c3c9c86c1f1b4c","type":"change","z":"e8cdc00d.87099","name":"Remove Sunday Schedule","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"remove\",\"name\":\"Sunday Time\"}]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":1100,"wires":[["fdef54bec95c36d2"]]},{"id":"52ea859234d131d8","type":"function","z":"e8cdc00d.87099","name":"Save Tuesday Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Tuesday\"){\n    \n    // Cron number for day\n    var time2 = \"0 \" + calcTime(flow.get(\"tue_time\", \"file\")) + 2;\n    flow.set(\"ct_tue_time\", time2, \"file\");\n    \n    //msg.payload;\n    msg.payload = time2;\n\n    return msg;\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":180,"wires":[[]]},{"id":"8304b9b3ab2bc60c","type":"function","z":"e8cdc00d.87099","name":"Save Wednesday Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Wednesday\"){\n    \n    // Cron number for day\n    var time3 = \"0 \" + calcTime(flow.get(\"wed_time\", \"file\")) + 3;\n    flow.set(\"ct_wed_time\", time3, \"file\");\n    \n    //msg.payload;\n    msg.payload = time3;\n\n    return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":240,"wires":[[]]},{"id":"4c5ddcda6dfbf8f6","type":"function","z":"e8cdc00d.87099","name":"Save Thurday Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Thursday\"){\n    \n    // Cron number for day\n    var time4 = \"0 \" + calcTime(flow.get(\"thu_time\", \"file\")) + 4;\n    flow.set(\"ct_thu_time\", time4, \"file\");\n    \n    //msg.payload;\n    msg.payload = time4;\n\n    return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":300,"wires":[[]]},{"id":"9dcf8585efef6e20","type":"function","z":"e8cdc00d.87099","name":"Save Friday Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Friday\"){\n    \n    // Cron number for day\n    var time5 = \"0 \" + calcTime(flow.get(\"fri_time\", \"file\")) + 5;\n    flow.set(\"ct_fri_time\", time5, \"file\");\n    \n    //msg.payload;\n    msg.payload = time5;\n\n    return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":360,"wires":[[]]},{"id":"3c9d91097537c772","type":"function","z":"e8cdc00d.87099","name":"Save Saturday Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Saturday\"){\n    \n    // Cron number for day\n    var time6 = \"0 \" + calcTime(flow.get(\"sat_time\", \"file\")) + 6;\n    flow.set(\"ct_sat_time\", time6, \"file\");\n    \n    //msg.payload;\n    msg.payload = time6;\n\n    return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":420,"wires":[[]]},{"id":"46a8a75ab8b89102","type":"function","z":"e8cdc00d.87099","name":"Save Sunday Cron Time to File","func":"function calcTime(x){\n    \n    // calculate Hours and minutes\n    var hours = (Math.floor((x / (1000 * 60 * 60)) % 24)); \n    var minutes = (Math.floor((x / (1000 * 60)) % 60));\n    \n    //Return Hours and Minutes in Cron format\n    return minutes + \" \" + hours + \" * * \";\n}\n\nif(msg.topic === \"Sunday\"){\n    \n    // Cron number for day\n    var time7 = \"0 \" + calcTime(flow.get(\"sun_time\", \"file\")) + 7;\n    flow.set(\"ct_sun_time\", time7, \"file\");\n    \n    //msg.payload;\n    msg.payload = time7;\n\n    return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1070,"y":480,"wires":[[]]},{"id":"da420f01.d894","type":"ui_group","name":"Week Timer","tab":"89465ae5.96ed08","order":1,"disp":true,"width":"6","collapse":true},{"id":"89465ae5.96ed08","type":"ui_tab","name":"Wekker Faye-Linn","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.