Hi,
The smart things devices list shows a devices status ONLINE/OFFLINE/ACTIVE/HUB_DISCONNECTED. Is there any way for a smart app to access this variable?
I tried extracting device state by getting all its attributes as follows. However, the field DeviceWatch-DeviceStatus in this seems to not match the above status. For example, one of my smart locks correctly says “ONLINE” on a devices listing but the attribute DeviceWatch-DeviceStatus is NULL.
def device_state = [:] for (attribute in device.supportedAttributes) { device_state."${attribute}" = device.currentValue("${attribute}") }
How do I accurately get the status as shown in the smart things dashboard?
Thanks,
Badri.