Page 1 of 1

Is it possible to know if a switch has been activated with a timing condition?

Posted: Wednesday 26 October 2016 12:52
by civi
Hello,

I would like to know if a switch has been activated with a timing condition.
For example if I use " commandArray['anydevice'] = 'On FOR 5' " I can check the status = On, but I can't know if there is a timing condition.
I have checked the JSON status fields for the device, but I have not found any difference if I activate it with 'On' or with 'On FOR 5'

Is it possible? Using LUA? Using JSON?
Thanks in advance !

Civi

Re: Is it possible to know if a switch has been activated with a timing condition?

Posted: Wednesday 26 October 2016 16:16
by bobkersten
Currently there is no way to differentiate between a temporary or permanent On/Off action. You can however solve this with uservariables quite easily. Just store a flag when you turn it On for 5 minutes and remove it when it turns Off again. Anywhere between that period, if the device is On and the flag has not been set, it must've been turned On permanently.