How to debug in Hassio

I am using Appdaemon as my primary automation tool in Hassio on a pi. Sometimes I wonder what possibilities there is for debugging and testing? So far I have primarily been using trial/error when I am testing if the state of an entity is what I expect. I am missing the print() function etc, which guess is tricky in Hassio as I am using Visual Studio Code on my win 10 computer and then justing saving the .Py filed via the Samba addon. Can I somehow run my scripts via the pi so I can use the normal Python functions instead of just saving the app and see if it works?

use self.log in your code . You will see the output in the Appdaemon Add-on logs

self.log("value for var1 is {}".format(var1))

You can set the log level in add-in but not very useful. I believe the next version 4.0 will have more detailed logs.

I created a very simple debug option in my code . You can adapt that if you want

1 Like