still trying to get my head around the whole DzVent / Lua scripts I have got the below working but it keeps on send the on stat's or off stat's like it stuck in a loop have i missed something silly out ;/ any help would be great..
Code: Select all
return {
active = true,
on = {
'UFH Electric',
'UFH Call'
},
execute = function(domoticz, device)
local ufhe = domoticz.devices['UFH Electric']
local ufhc = domoticz.devices['UFH Call']
if (ufhe.WActual > 9)
then
ufhc.switchOn()
domoticz.log("UFH is Active", domoticz.LOG_ERROR)
-- domoticz.notify('Hey!', 'UFH is Active', domoticz.PRIORITY_LOW)
end
if (ufhe.WActual == 0)
then
ufhc.switchOff()
domoticz.log("UFH is Active.", domoticz.LOG_INFO)
-- domoticz.notify('Hey!', 'UFH is De-active', domoticz.PRIORITY_LOW)
end
end
}