getting a nil error. probably a simple fix
Posted: Friday 22 January 2021 9:27
well, i am getting rusty with dzvents
i am trying to time the time between a device gets updated but i am getting a nil error
i declared a global variable but somehow something is still wrong
also tried WatermeterDeltaTime = domoticz.time.compare('Watermeter').lastUpdate.ms but that did not help either
in the global_data is this
i am trying to time the time between a device gets updated but i am getting a nil error
i declared a global variable but somehow something is still wrong
also tried WatermeterDeltaTime = domoticz.time.compare('Watermeter').lastUpdate.ms but that did not help either
in the global_data is this
Code: Select all
WatermeterDeltaTime = { initial = 9999 },Code: Select all
return {
active = true,
on = {
devices = {
'Watermeter'
}
},
execute = function(domoticz, Watermeter)
WatermeterDeltaTime = domoticz.time.compare(Watermeter.lastUpdate.ms)
if WatermeterDeltaTime <= 9000 then
domoticz.devices('fastpulse').updateWaterflow(WatermeterDeltaTime)
end
--domoticz.devices('fastpulse').updateWaterflow(1)
end
}