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

Easy to use, 100% Lua-based event scripting framework.
Post Reply
rizzah
Posts: 61
Joined: Monday 17 October 2016 16:11
Target OS: Raspberry Pi
Domoticz version:
Location: Groningen
Contact:

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

Post by rizzah » Sunday 28 October 2018 10:13

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.

User avatar
waaren
Posts: 1332
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by waaren » Sunday 28 October 2018 10:23

rizzah wrote:
Sunday 28 October 2018 10: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.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Post Reply

Who is online

Users browsing this forum: bce626 and 3 guests