action when person arrives
Posted: Saturday 04 July 2020 16:25
I use an OnlineChecker script to see if my partners or my phone is at home. The script triggers a virtual switch (on is ‘at home’, off is ‘away’). I would like to have a light switch on if one of us comes at home during the night:
e.g. IF Time > 0:30h and time < 4:00h AND switch person1 OR person2 turns on THEN turn on light.
Problem is that i cannot find a way to Blocky use the ‘changes state’ as a trigger. Now the problem is the script keeps turning the light on because one of our phones are at home. When I use only ‘device’ as a trigger, turning off at our wish the ligt re-triggers the script and therefore keeping the ligt in a ‘on’ loop.
I also thought about setting a user variable if the device is switched off, to prevent a ‘on-loop’ but I cannot work that out either.
Does someone have a solution? i can imagine is is a quite common application..
e.g. IF Time > 0:30h and time < 4:00h AND switch person1 OR person2 turns on THEN turn on light.
Problem is that i cannot find a way to Blocky use the ‘changes state’ as a trigger. Now the problem is the script keeps turning the light on because one of our phones are at home. When I use only ‘device’ as a trigger, turning off at our wish the ligt re-triggers the script and therefore keeping the ligt in a ‘on’ loop.
I also thought about setting a user variable if the device is switched off, to prevent a ‘on-loop’ but I cannot work that out either.
Does someone have a solution? i can imagine is is a quite common application..