[Project] Device Health Status [Tuya, Aqara, Ikea, Sonoff, Lidl, ThirdReality and others]

NEW!

healthStatus support in the New Dashboards available in HE Release 2.3.9

image
image

:tada:


Apps, Integrations and Drivers that support the healthStatus attribute :

Apps :

Integrations

Drivers :


Useful links:


23 Likes
Device Health Status revisions history

This is my first-ever app for HE, so please bear with me on possible bugs and not knowing how to implement something fast... I am now reading the Building a Simple App | Hubitat Documentation pages .. : )

Revisions history :

  • ver. 1.0.0 2023-02-03 - first version: 'Light Usage Table' sample app code modification
  • ver. 1.0.1 2023-02-03 - added powerSource, battery, model, manufacturer, driver name;
  • ver. 1.0.2 2023-02-03 (FriedCheese2006) - Tweaks to Install Process
  • ver. 1.0.3 2023-02-05 kkossev - importUrl; documentationLink; app version; debug and info logs options; added controller type, driver type; added an option to filter battery-powered only devices, hide poweSource column; filterHealthCheckOnly bug fix; added 'Last Activity Time'; last activity thresholds and color options; battery threshold option; catching some exceptions when a device is deleted from HE, but was present in the list; added device status
  • ver. 1.0.4 2023-02-06 - added 'HE Status' red/green colors; added hideModelAndManufacturerColumns and hideVirtualAndUnknownDevices (show physical devices only) filtering options; app instance name can be changed; added Presence column
  • ver. 1.0.5 2023-02-08 - added toggle 'Show only offline (INACTIVE / not present) devices'
  • ver. 1.0.6 2023-02-15 - IntelliJ lint; merged Tonesto7 pull request;
  • ver. 1.0.7 2023-02-16 (FriedCheese2006 )- Added DataTables for enhance table sorting/searching
  • ver. 1.0.8 2023-11-12 - added "MAT" controllerType

TODO :

  • Export the results table to a csv or html file
  • Color red these ZGB and ZWV devices which are missing Model or Manufacturer data
  • Add headers and footers to the report (above/below the table) - date/time generated, filters that were applied.
  • Skip disabled devices from being shown in the table.
  • Handle the exceptions thrown when a device in the list is DELETED from HE.
  • Add room name to the device for easier identification.
  • Find a solution for Philips Hue Dimmer buttons to support healthStatus (currently using system driver).
  • Find a solution for Lightify Smart 2&4 buttons dimmers to support healthStatus (currently using system driver) - W.I.P.
  • Show the time elapsed in a format (999d,23h) / (23h,59m) / (59m,59s) since the last battery report. Display the battery percentage remaining in red, if last report was before more than 25 hours. (will this work for all drivers ?)
  • Add column w/ 'X' button to easily deselect a device when it is not applicable for health monitoring
  • Add a column w/ ''R'' button for these devices that have a Refresh capability.
  • Automatically refresh the table if any of the subscribed devices changes healthStatus or lastActivity time
  • Add a column to show the battery type (custom Data field)
  • Sort by a different column - DONE! (thanks @FriedCheese2006 )
8 Likes

This is a dedicated thread for a new Device Health Status custom application.

It is kind of a proof-of-a-concept project, that hopefully may have a better implementation in the future on Hubitat platform system level.
.
This simple application provides a single-page view of the HE-connected devices healthStatus .

Analyzing the data displayed in the table, we should have a better understanding of whether a device is operational (online to HE hub) or it may have stopped working (offline to HE hub) and needs attention.

After the most appropriate and reliable method for detecting the online/offline status of a particular device is determined, the actual alarm/notification can be configured using the HE community popular apps Device Activity Check , Device Watchdog or use the HE inbuilt Rule Machine or webCoRE.


The recommended way to install the app is from Hubitat Package Manager (HPM)- search for "Device Health Status". If you have already installed the app manually, do a 'Match Up' first and then Update.

The application code is available at this link (Github)


A very simple driver that can be used by HE developers for tests when assigned to a virtual device is here.

10 Likes

Nice! I just kicked you a PR for some tweaks that were lessons learned for me when using the table for my energy calc app.

5 Likes

Thank you, I will gladly accept it! :slight_smile:

1 Like

Feel free to use/copy any code in Device Watchdog. :grin:

7 Likes

@kkossev,
Your todo list looks impressive, look forward to these updates!

Devices supported

Devices not supported

1 Like

Thank you for the feedback! You can use the 'Import' button within the driver editor to update to the latest version, it should be 1.0.3 time stamp 2023/02/05 4:10 PM.

Look at the last column, named 'Device Status' This is the status returned from the hub, and has possible values of 'ACTIVE', 'INACTIVE' and 'UNKNOWN'. With most of my devices, it seems to be close to the online/offline status but is not correct for all of the cases.

You can also try using the eWeLink motion sensors with Tuya multi sensor 4 in 1 driver.

1 Like

Great stuff, this looks great - thank you!

Summary

Edit: living room sensor (sonoff) - paired again and now working and showing battery as power source.

1 Like

All devices show up, even virtuals and zwave. Of course these can be filtered out.

Funneling down to the intended functionality (zigbee devices)

Here is what is working for me;

And these are not (yet) working;


Nice to report; zwave battery level IS reported for some devices. As well as manufacturar ID

Using version 1.03 from; https://raw.githubusercontent.com/kkossev/Hubitat/main/Apps/Device%20Health%20Status.groovy

1 Like

@H_Local you are using a bit older version, use the 'Import' button to load the latest one. As I was making multiple small incremental updates today, I do not increase the app version every time, but only the 'time stamp' - the latest should be 2023/02/05 4:10 PM

Pay attention to the 'Device Status' column - seems that it reflects the 'Last Activity Time'. What is not clear is the ACTIVE threshold.

1 Like

Impossible to keep up with you @kkossev :laughing::muscle:t3:

I updated the code… let me see if anything changes

EDIT;

No changes from before,
All Tuya device report active recently.

The Osram (Ledvance) miniswitch report battery but no health status
The Tuya Multisensor (TS0601, Humidity, Temp & Batt) reports no health status in the app

All three work fine in the device section.

1 Like

I loaded the app code, the driver code and created the virtual device. Now can you provide a way to utilize these together to get the chart you are referencing? I am familiar with Webcore. My old piston that checked Online Status dues not work in the new Hubitat Webcore version, so I am hoping somehow I can get guidance on how to utilize the apps code, driver code and health checker device in tandem to get the results. Thanks in advance.

Hi @user3347 ,

At its current stage, this is more of a Project to find the best approach for monitoring the devices online/offline status in Hubitat, rather than a ready-to-be-used solution. One of the goals is to stop missing the Presence capability in some of HE custom drivers and replace it with something better.

You don't need the 'healthStatus test driver' if you are not developing drivers or apps for Hubitat. The 'Device Health Status' custom app currently does not provide any other functionalities, except a view at a glance of all your devices in a table, which I find useful for analyzes.

Can you post a sample piston / part of a piston code that you used in SmartThings to check the Online Status?

This is what I had in the smartthings Webcore and tried to use it in Hubitat Webcore but everything reports Offline as it appears that Status is not the right data to check.

This is a good idea. If I can find the time, I'll work on this for my app and share. If you beat me to it, I'm gonna steal :rofl:

2 Likes

@kkossev,
Can you please confirm how frequently the health status is polled?

Summary

Bedroom 3 button controller, see summary above, may have dropped off the network around 2.37am, as it was not working in the morning. I removed the battery at 8am and left in that state. However, it is still showing online after 6 plus hours?
Please advise.
Thanks
EDIT: just inserted a brand new battery and button controller started working straight away (measured voltages: new battery 3.2V, old battery 2.8V)

The healthStatus update period is driver-dependant.
For the TS004F driver currently, the offline status will be reported between 12 and 15 hours after the message was received from the device. The driver every 3 hours for any messages received from the device (keypress or battery report). If 4 consecutive 3-hour periods have passed without anything received, the healthStatus attribute will be set to offline.

1 Like

WebCoRE must have access to HE device object device.status or device.lastActivity properties .. I don't know if these are available or not. Probably we can ask WebCore devs?

The Zigbee Repeaters online/offline status was a bit difficult to track. These devices typically don't need a driver - they operate when simply paired to HE as a 'device'. The HE inbuilt driver "Ikea TRADFRI Signal Repeater" does not have any polling implemented and does not send any events to the hub, thus the 'Last Activity' and the HE 'Status' properties are not handled properly and HE reported the repeater as 'INACTIVE'.

This is the first of the series of the popular Markus's drivers where the misused "Presence Sensor" capability is now replaced by the "Health Check" capability and the "healthStatus" property.

The "Zigbee - Generic Repeater (w/ healthStatus)"driver can be downloaded from this URL :
https://raw.githubusercontent.com/kkossev/hubitat-Markus-Li-fork/release/drivers/expanded/zigbee-generic-repeater-expanded.groovy

Now the ZIgbee repeaters devices online/offline stratus can be tracked using either by the healthStatus or by the 'LastActivityAt' properties :

7 Likes