When tested directly as Homeyscript :
Script Error
TypeError: Cannot read properties of undefined (reading ‘lastUpdated’)
at testdevice.js:56:75
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async HomeyScriptApp.runScript (/app.js:495:22)
at async Object.runScript (/api.js:30:22)
…isn’t it maybe because of devices with capabilities that don’t have a lastUpdated
?
Robert modified his script here - A script to check sensor last update - #9 by robertklep, do you think you can improve your script maybe ?