Page 1 of 1

Is it possible to check for Manual or Timer triggered event?

Posted: Sunday 28 October 2018 9:13
by rizzah
Hi,

I am wondering if it is possible to see (and use) how an event was triggered. I have a Philips Hue light in my bedroom included with a wireless on/of/dimmer controller. I have a dzVents script handing the lights on/of and for how long or trigger a 'wake up' scene in the morning. When i manually turn on the light, it gets shut down after a minute because of the timer in the script. Which makes sense of course. But is there a way to make it check on how the light was turned on? For example, if it was turned on manually, then stay on for an hour, otherwise use the timers in the script.

Thanks.

Re: Is it possible to check for Manual or Timer triggered event?

Posted: Sunday 28 October 2018 9:23
by waaren
rizzah wrote: Sunday 28 October 2018 9:13 I am wondering if it is possible to see (and use) how an event was triggered. I have a Philips Hue light in my bedroom included with a wireless on/of/dimmer controller. I have a dzVents script handing the lights on/of and for how long or trigger a 'wake up' scene in the morning. When i manually turn on the light, it gets shut down after a minute because of the timer in the script. Which makes sense of course. But is there a way to make it check on how the light was turned on? For example, if it was turned on manually, then stay on for an hour, otherwise use the timers in the script.
When you trigger something from a script, you can expose that fact and the time it was triggered to that script and/or to the outside world.
using dzVents persistent data; only usable in the same script
using a dummy switch ; On / Off / lastUpdate- and/or description fields can be used to expose the info
using a userVariable ; You can store all information needed there

So if you implement any of the above methods in your script, the script would know if the light was switched by the script itself or... not.
If not.. the script could assume the light was switched by either another script or manually.