AppDaemon / appdaemon

:page_facing_up: Python Apps for Home Automation
Other
822 stars 417 forks source link

AppDaemon Health Sensor in Home Assistant. #739

Open jeroenvdwaal opened 4 years ago

jeroenvdwaal commented 4 years ago

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:

arnoldpistorius commented 4 years ago

If you could do that, that would be great.

benleb commented 4 years ago

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...

acockburn commented 4 years ago

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.