Firstly, not sure if this is the correct category, sorry in advance if it is not right.
I have a Photon connected to a relay that can control my boiler in my home. I control it via a small web app I wrote which uses javascript to call the API to run the exposed functions and return the status.
Works like a charm.
My next task is to implement a timer, for example for it to turn on at a specific time and off at another time.
I was originally thinking of controlling cron jobs on the website but it sounds like a hack n slash!
How would I achieve this in a sensible manor? I can’t seem to think of a solution
I suppose, but you are limited (right now) by by your choice of constructor. So you have to initialize the array of DailyTimer objects… something like this:
We could certainly add a constructor that takes no arguments and uses come default values, but you eventually have to set the times anyways, I suppose.
Yeah easily done. I am using these timers to do something like that… updating on or off times from time to time with web-hooks. For instance, I use Solar noon to determine when to open/close blinds on the east and west side of my house and sunset/sunrise for lawn watering and exterior lighting.