Going forward, I would like to maintain two separate totals, based on the period (time of day) of usage: low hours, 01:00-07:00 & 14:00-17:00, and high, 07:00-14:00 & 17:00-01:00.
Given that this action is going to be executed quite frequently, my concerns are related to the most efficient means of maintaining those two totals. I have considered the following (all triggers are based on the device state becoming > 0):
- 4 triggers, each with a condition limiting it to one specific time period, and with an action to increment the appropriate variable (I.e. no scripting, but 4 triggers will fire each time the device's value becomes > 1, though only 1 will succeed)..
- 1 trigger with an embedded AppleScript to check the time of day and then increment the appropriate variable.
- 1 trigger with an embedded Python script to check the time of day and then increment the appropriate variable.
- Something else I haven't though of...
To be honest, this is probably a much better project for an Arduino or R-Pi which would capture "bips" for some longer period, say 15 minutes, and then update Indigo. But, while I am testing the concept, this is an easy way to start.