Currently i have this script (the script is more articulated but i put the essential part) that do some actions according the value of two variable (Tag_Andrea - Tag_Ilaria) which is controlled by BLE presence script. These variable could have two string content: Out when someone is away from the house, Home when someone is back:
Code: Select all
on = {
variables = {
'Tag_Andrea',
'Tag_Ilaria'
},
},
execute = function(domoticz, Tag)
if domoticz.variables('Tag_Andrea').value == 'Out' and domoticz.variables('Tag_Ilaria').value == 'Out' then
-------------- TURN ON THE ALARM AND DO MUCH MORE
elseif domoticz.variables('Tag_Andrea').value == 'Home' or domoticz.variables('Tag_Ilaria').value == 'Home' then
-------------- TURN OFF THE ALARM AND DO MUCH MORE
How can i edit this script to be triggered only on variable content changed?
Thanks since now for your help!