The use case is, that I have a logging extension, which writes events with every change. That’s once a second wich a powermeter, which floods the target. So I would like to write the data only once a minute. Therefore I would like to trigger it on a particular second of every minute to achieve it.
Couldn’t you just schedule a routine to run once a minute and push your data, whatever is available, at that time? Or even average out the values over that minute and send the average?
Im already doing this and it’s easier than you think.
Code your SmartApp to cache values from the power events to a state variable. When the first even comes in, execute a runIn(60), set a flag so runIn doesn’t get called again, then write the data to the logger when the function is called by runIn(), at which point you reset the flags the process repeats.
This model uses the actual events received from the power meter as the trigger, eliminating the need to be concerned with a reliable scheduler. It also allows the scheduler to be self-healings once it’s triggered by the power event.