sleep/wait in a script?
Posted: Tuesday 08 August 2017 15:51
Hello, there's nothing similar to a wait or sleep before trigger a switch-on?
I wrote this simple script that turn on the alarm when the tag-presence (a bluetooth beacon) is "out-house" (Fuori) and turn it of when is "in-house" (Casa):
It works fine but i wanna refine more and ad a -wait- or a -sleep- before turn on the alarm for when i'm leaving b house for exable for going in the garden downside or in the card and i'll come back few minutes later.
Any suggest? Thanks in advance for your kind help!
I wrote this simple script that turn on the alarm when the tag-presence (a bluetooth beacon) is "out-house" (Fuori) and turn it of when is "in-house" (Casa):
Code: Select all
..... ON 'Tag_Andrea' variable state changed......
if domoticz.variables('Tag_Andrea').value == 'Fuori' then
domoticz.devices('Pannello Allarme').armAway()
elseif domoticz.variables('Tag_Andrea').value == 'Casa' then
domoticz.devices('Pannello Allarme').disarm()
end
Code: Select all
if domoticz.variables('Tag_Andrea').value == 'Fuori' then
CREATE A LOCAL VARIABLE AND SET IT TO 'FUORI'
SLEEP 20 MINUTES
IF LOCAL_VARIABLE.STATE == domoticz.variables('Tag_Andrea').state then
domoticz.devices('Pannello Allarme').armAway()
ELSE DO NOTHING BECAUSE I'M IN HOUSE AGAIN
Any suggest? Thanks in advance for your kind help!