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.
Is it possible to check for Manual or Timer triggered event?
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Is it possible to check for Manual or Timer triggered event?
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.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.
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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest