The current config send a notify to our smartphone and tell us "I shut down the heating... when you'll close all remember to turn off "Away mode"".
Now i want to refine a bit the script and let it automate this last step: when everything is closed again -> restore the previus status of Away Mode. Somebody more experienced can help me on that? Thanks since now!!!
Code: Select all
return {
active = true,
on = {
devices = {'Sensor window bedroom',
'Sensor window bathroom',
'Sensor window kitchen'
}
},
execute = function(domoticz, switch)
if (domoticz.devices('Sensor window bedroom').state == 'Open' or domoticz.devices('Sensor window bathroom').state == 'Open' or domoticz.devices('Sensor window kitchen').state == 'Open') then
if domoticz.devices('Heat_Away_mode).state ~= 'On' then
if (domoticz.devices('Temperature outside').temperature <= domoticz.devices('Temperature inside').temperature) then
domoticz.devices('Heat_Away_mode').switchOn()
domoticz.notify('Heating off for power saving, keep in mind to turn back on', message, domoticz.PRIORITY_NORMAL)
end
end
end
end
}