Seems to be something is not right here. If I execute this
Code: Select all
return {
on = { timer = { "every minute"}},
logging = { level = domoticz.LOG_INFO,
marker = "testiteration" },
execute = function(domoticz)
local myDevice
local deadDevices = domoticz.devices().filter(function(myDevice)
if myDevice.lastUpdate ~= nil then
return (myDevice.lastUpdate.hoursAgo > 1 )
else
domoticz.log("Device ".. myDevice.name .. " (idx: " .. myDevice.idx .. ") has no lastUpdate set !?!?",domoticz.LOG_ERROR)
end
end)
deadDevices.forEach(function(zombie)
domoticz.log("Device ".. zombie.name .. " is not updated during the last 60 minutes",domoticz.LOG_INFO)
end)
end
}
the log shows...
Code: Select all
2018-10-07 23:27:00.764 Status: dzVents: Info: testiteration: ------ Start external script: testIteration.lua:, trigger: every minute
2018-10-07 23:27:00.767 Status: dzVents: Error (2.4.7): testiteration: Device (idx: 0) has no lastUpdate set !?!?
2018-10-07 23:27:00.768 Status: dzVents: Error (2.4.7): testiteration: Device (idx: 0) has no lastUpdate set !?!?
2018-10-07 23:27:00.768 Status: dzVents: Error (2.4.7): testiteration: Device (idx: 0) has no lastUpdate set !?!?
2018-10-07 23:27:00.768 Status: dzVents: Error (2.4.7): testiteration: Device (idx: 0) has no lastUpdate set !?!?
2018-10-07 23:27:00.768 Status: dzVents: Error (2.4.7): testiteration: Device (idx: 0) has no lastUpdate set !?!?
2018-10-07 23:27:01.053 Status: dzVents: Info: testiteration: Device km1 is not updated during the last 60 minutes
2018-10-07 23:27:01.053 Status: dzVents: Info: testiteration: Device XMotion-1 is not updated during the last 60 minutes
2018-10-07 23:27:01.055 Status: dzVents: Info: testiteration: Device XMotion-6 is not updated during the last 60 minutes
2018-10-07 23:27:01.056 Status: dzVents: Info: testiteration: Device km3 is not updated during the last 60 minutes
2018-10-07 23:27:01.057 Status: dzVents: Info: testiteration: Device Xiaomi Gateway Alarm Ringtone is not updated during the last 60 minutes
2018-10-07 23:27:01.057 Status: dzVents: Info: testiteration: Device My_External_IP is not updated during the last 60 minutes
..........
2018-10-07 23:27:01.064 Status: dzVents: Info: testiteration: ------ Finished testIteration.lua
So dzVents return some ghost devices. I checked the database but no ghost devices in deviceStatus table. I checked with a myDevice.dump() statement but that does only return empty fields.
Hope @dannybloe can answer / fix this one
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>>
dzVents wiki