Good point…
I also have devices in my smart home which are not in use everytime. But I tend to deactivate those devices. But that is a decision of own.
Yes, I test against ‘last_changed’ and ‘last_updated’.
And your right, it can lead to false positives. In reality, I do not have.
My script checks every sensor or binary_sensor of a device. And most of the devices have several sensors. If only one sensor is updated, I assume the device is fine. With my devices, any of the sensors of a device always changes and that’s good enough for me.
The thing is: Other entities than sensor or binary_sensor can be touched/changed by HA itself.
For instance a wall plug: It has a switch entity. This switch entity can be either changed by HA (by an automation for example) or directly on the physical device by pressing a button. The entity will be updated in any case, but can you be sure if this update really comes from the device?
But if this wall plug has a sensor for power measurement and this sensor entity gets updated than you know for sure, that this update was done by the device. Which means, it’s alive.
I believe, sensors and binary_sensors (of real physical devices) never gets updated by HA itself, only on behalf of the corresponding device. That’s why I only check sensors and binary_sensors.
Ha. I didn’t even know that devices can be disabled. Makes a lot of sense. Thanks for pointing that out. But also: What a boringly simple solution …