Delayed switching
Posted: Monday 09 November 2020 11:49
I'm looking for a solution of the following idea:
Actually i'm using a door switch to shut my heating if the door is open and the outside temperatur is less than 15° C.
This works fine, but i now look for a solution to only shut the heating if the door is not closed within 30 seconds or is open more than 30 seconds which is the same, but i dont know how to fix the timing problem.
Thanks for any idea
Actually i'm using a door switch to shut my heating if the door is open and the outside temperatur is less than 15° C.
Code: Select all
return {
on = {
devices = {
'Tuer Wohnzimmer',
'Zigbee Terrassentuer'
}
},
execute = function(domoticz, device)
local WZHeat = domoticz.devices('WZ Heat')
local WZThermostat = domoticz.devices('WZ Thermostat');
local OAT = domoticz.devices('THB Darksky');
if OAT.temperature < 15 then
if device.state == 'Open' then
domoticz.log(device.name .." is now Open; setting Mode to Off")
WZThermostat.updateMode('Off')
-- WZHeat.updateSetPoint(16)
elseif device.state == 'Closed' then
domoticz.log(device.name .." is now Closed; setting Mode to Heat " )
WZThermostat.updateMode('Heat')
end
end
end
}
Thanks for any idea