I'm trying to monitor if a device is dead. I've read forum and it seemed to be ease. I planned to use lastUpdate attribute to find out when the device reported its presence. However when I read lastUpdate in my script, it returns wrong value.
My script:
Code: Select all
return {
on = {
timer = {
'every minute',
}
},
logging =
{
level = domoticz.LOG_DEBUG,
},
execute = function(domoticz, timer)
domoticz.log("Brama updated: " .. domoticz.devices('Brama').lastUpdate.rawDateTime)
end
}
As you can see, 'Brama' switch is getting updated, however lastUpdate reports wrong value. The 'Devices' screen is accurate:2020-10-24 15:12:51.195 (Wemos D1 Mini Pro garage) Light/Switch (Brama)
2020-10-24 15:12:51.188 Status: User: Admin initiated a switch command (11/Brama/Off)
2020-10-24 15:13:01.511 (Wemos D1 Mini Pro garage) Light/Switch (Brama)
2020-10-24 15:13:01.439 Status: dzVents: Info: ------ Start internal script: Lost_brama_monitoring:, trigger: "every minute"
2020-10-24 15:13:01.498 Status: User: Admin initiated a switch command (11/Brama/Off)
2020-10-24 15:13:01.805 Status: dzVents: Debug: Processing device-adapter for Brama: Switch device adapter
2020-10-24 15:13:01.806 Status: dzVents: Info: Brama updated: 2020-10-22 18:55:20
2020-10-24 15:13:01.813 Status: dzVents: Info: ------ Finished Lost_brama_monitoring
Domoticz: 2020.2 (build 12461) - I've updated to Beta because I've read somewhere in the forum that there were some bugs in Stable
dzVents Version: 3.0.14
I'm sure I'm doing something wrong... Any help appreciated.
Regards,
Pawel