appdaemon icon indicating copy to clipboard operation
appdaemon copied to clipboard

AppDaemon Health Sensor in Home Assistant.

Open jeroenvdwaal opened this issue 5 years ago • 3 comments

First of all, thank you very much for making AppDeamon

Would it be nice to have AppDeamon 'Health-Sensor' that informs about the health of all configured App's?

So 'Healthy' means that all apps could be loaded and are running without throwing exceptions. 'Not Healthy' means that one or more apps are having troubles.

The Not Healthy status can be used for the developer to start digging in the logs about what is wrong.

One solution is observing the log file to match particular texts. But maybe it is nicer if AppDeamon just submits an event which can be listened for. This happens every time when something goes wrong in any of the running Apps. This event can be used to create the AppDaemon Health-Sensor in HA.

The sensor may help in the following example scenarios:

  • The device name of a sensor is changed, but the AppDaemon script that uses that sensor is not changed.
  • An App is added but the app.yaml configuration is not correct. When the App tries to do operate on the configured items it fails.
  • A callback does not have the right signature.
  • turn_on is called on a non-existing entity

jeroenvdwaal avatar Sep 29 '19 06:09 jeroenvdwaal

If you could do that, that would be great.

arnoldpistorius avatar Oct 02 '19 05:10 arnoldpistorius

Some kind of an enhanced version of a mixture of https://github.com/benleb/ad-healthcheck and https://github.com/benleb/ad-ench ?

I like (some parts of) the idea, maybe I will implement them sometime... If nobody else did it until then...

benleb avatar Oct 02 '19 20:10 benleb

We already have some of this and a framework to expand it in AD 4.0. Each app has it's own entity with a status value, which is visible form the Admin Interface. We already catch apps that don;t initialize, it wouldn't be too hard to add some additional info, we have already planned some enhancements to what is currently there. A summary sensor or entity would be fairly easy to add, and some enhanced information around errors and overall state of the app would be doable.

acockburn avatar Oct 02 '19 20:10 acockburn