I am sure there has been mention of this somewhere before but I just can’t find it so…
Is it possible to add the ability to surface a devices online status in a driver so it can be interrogated in a routine (@Mariano_Colmenarejo )?
It would be so useful to be able to raise an alarm/notification if a device drops connection to the ST hub. Even opens up the option for a, say, temperature/humidity or motion sensor to be used as a basic presence sensor?
Again, apologies if I’ve missed this elsewhere but any thoughts anyone?
If we’re talking about actually knowing if a device is off-line, then…
For Wi-Fi devices, sure. For battery powered Z wave/zigbee/Thread, very unlikely.
In order to know a device is off-line, you have to poll it constantly. That will kill the battery life as well as hugely overwhelm your mesh network with all the multiple messages requesting the online status.
Zwave and the Zigbee profiles used in home automation are designed for tiny messages sent infrequently. Like “the light switch was turned on.”
It’s why these protocols aren’t even a good choice for energy monitoring. If you’re talking about messages sent more frequently than three or four times an hour. They will flood your network and it will be hard for other devices to get their messages through.
But realtime “are you still there?“ polling for every device would just lower the quality of service for all the devices as well as kill the batteries in the battery powered ones.
Wi-Fi is different because it is designed for big messages with constant connection (like streaming video). So it would be suitable for monitoring online status in the way you describe.
On the other hand, if you’re saying you just want to use the status that smartthings already sets for a device being “off-line,” then that’s a different matter. I don’t know if that information is available in an actionable form or not. And I agree, it would be useful if it is.
Device health has always been a bit of a mystery in SmartThings. It has changed a few times and has never really been usefully documented.
There have been signs that ST were intent on grouping health related things like online/offline status, battery and signal strength together but nothing particularly useful for end users seems to have happened as a consequence. Indeed the Health Check capability seems to be on its last legs and battery reports disappeared from the history so we have less to work with than ever.
Apps have long been able to subscribe to the connection status of devices so it is a bit disappointing that there doesn’t seem to be any way of working with that status in rules based automations such as Routines.