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!