I currently have a ‘time sheduler’ where the user can select a start and end time for a specific device to be turned on and off.
Works like a charm but has one big issue: you can only select one time window. the time window is repeated daily.
So : you can configure to turn on at 10:00 and turn off at 14:00 but not turn on at 10:00, turn off at 12:00 and then turn on again at 14:00 and turn off at 16:00
So, I’m looking for something far more flexible.
Just looked at something like this : http://www.jqueryscript.net/time-clock/Create-A-Basic-Weekly-Schedule-with-Hour-Selector-Using-jQuery.html
Wouldn’t be too difficult to embed an iframe with such a page an give the user the option to select per hour per day for scheduling the device on and off.
To get/write from/to pimatic the page has to to communicate over the pimatic API.
For me working with blocks per hour is good enough. That would result in 24 variables (every hour a var, with value 1 or 0) per day(!). Now, turning the device on or off based on the value of the variable for the current hour would result in 48 rules per day(!!). One rule to turn the device on if needed and to turn the device off if needed.
You could divide this by half to write a rule to turn the device on for 1 hour. A quick test learns me that this wouldn’t work, the device is turned off even if the following (hour)rule would set it on for 1 hour. Also, for my specific situation it in unwanted to have a toggling device every hour.
So, sounds nice but handling the rules would be a big pain in the ass (336 rules for the entire week!!).
To avoid tunnel vision from my side, anyone with a better approach ?