11-08-2013, 04:01 PM
I'm lost in time...
How can I set differing start and stop times for use with triggered events?
I have several rules tied to motion sensors and people counters that turn interior lights on and off during the day. Right now the events are triggered based on two triggers that both have to be true: sensors tripping AND a time that "IsInTimeRange" so the sensors don't trip the lights at night. The "IsInTimeRange" trigger is limited to hours and not minutes so I'd like a little more flexibility there to use minutes, but more importantly, I'd also like to have more ability to change the start and times via action commands when needed.
What I'd like to do is move the start and stop times into global or local start and stop variables (with appropriate IF statements) and put them in the triggered event action. I would then have the sensor as the only event trigger. I would also create separate actions to change the start and stop times by re-writing the variables. That way, while the event would trigger on each sensor violation, the lights would only go on and off during the revised time frames, and I could, for example, start or stop the automation later or earlier on a given day.
The best I have (conceptually) been able to come up with is to define start and stop fields in the Variables Driver, read them in as global or local variables in the triggered event action, and then have a way to write a HH:MM formatted daily time to these variable. I didn't get far on that since I was not sure what Variable Drivers data field to use (MEng.time?) and I couldn't figure out how to write a HH:MM daily start or stop time to the variable driver or to a global or local variable...
Is that the best way? Is this even possible?
Thanks!
How can I set differing start and stop times for use with triggered events?
I have several rules tied to motion sensors and people counters that turn interior lights on and off during the day. Right now the events are triggered based on two triggers that both have to be true: sensors tripping AND a time that "IsInTimeRange" so the sensors don't trip the lights at night. The "IsInTimeRange" trigger is limited to hours and not minutes so I'd like a little more flexibility there to use minutes, but more importantly, I'd also like to have more ability to change the start and times via action commands when needed.
What I'd like to do is move the start and stop times into global or local start and stop variables (with appropriate IF statements) and put them in the triggered event action. I would then have the sensor as the only event trigger. I would also create separate actions to change the start and stop times by re-writing the variables. That way, while the event would trigger on each sensor violation, the lights would only go on and off during the revised time frames, and I could, for example, start or stop the automation later or earlier on a given day.
The best I have (conceptually) been able to come up with is to define start and stop fields in the Variables Driver, read them in as global or local variables in the triggered event action, and then have a way to write a HH:MM formatted daily time to these variable. I didn't get far on that since I was not sure what Variable Drivers data field to use (MEng.time?) and I couldn't figure out how to write a HH:MM daily start or stop time to the variable driver or to a global or local variable...
Is that the best way? Is this even possible?
Thanks!