I am new to using domoticz
and I like it so far. I started to study the Lua scripts and dzVents.V4.11468
Build Hash: 508cc66a1
Build Date: 2019-11-05 16:05:44
I get the code below working half way and I get no errors.
I use a hacked tone and when the burner(Branderinfo) comes on, the floor heating pump (Kaku switch 'Vloerverwarming') also comes on.
If the burner goes out, the pump continues to run for an hour and then goes out.
This part of the script works.
Next, i tried but didn't get it to work, if the burner does not start due to summer, the pump will start running if 'Vloerverwarming' is off for 24 hours for at least 1 hour to prevent from getting stuck.
Can you tell me what I'm doing wrong?
Code: Select all
return {
on = {
devices = {'ToonBranderInfo','Vloerverwarming'},
},
execute = function(domoticz, device)
if domoticz.devices('ToonBranderInfo').levelName == 'CV'
then
domoticz.log('Brander is aan!')
local Vloerverwarming = domoticz.devices('Vloerverwarming')
Vloerverwarming.switchOn()
else
domoticz.log('Brander is uit!')
local Vloerverwarming = domoticz.devices('Vloerverwarming')
Vloerverwarming.switchOff().afterHour(1)
if domoticz.devices('Vloerverwarming').state == 'Off'
then
domoticz.log('Vloerverwarming pompt even rond door inactiviteit')
local Vloerverwarming = domoticz.devices('Vloerverwarming')
Vloerverwarming.switchOn().afterHour(24).forHour(1)
end
end
end
}