Home Assistant Community Add-on: AppDaemon 4

I just upgraded to appdaemon addon 4, changed the appdaemon.yaml according to the breaking changes, started the addon and got these errors:

2020-01-16 15:22:29.825724 INFO AppDaemon: AppDaemon Version 4.0.0 starting
2020-01-16 15:22:29.827128 INFO AppDaemon: Python version is 3.8.1
2020-01-16 15:22:29.828290 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-01-16 15:22:29.829532 INFO AppDaemon: Added log: AppDaemon
2020-01-16 15:22:29.830592 INFO AppDaemon: Added log: Error
2020-01-16 15:22:29.831784 INFO AppDaemon: Added log: Access
2020-01-16 15:22:29.832860 INFO AppDaemon: Added log: Diag
2020-01-16 15:22:30.108930 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-01-16 15:22:30.921020 INFO HASS: HASS Plugin Initializing
2020-01-16 15:22:30.923231 INFO HASS: HASS Plugin initialization complete
2020-01-16 15:22:30.928280 INFO AppDaemon: Initializing HTTP
2020-01-16 15:22:30.931853 INFO AppDaemon: Using 'ws' for event stream
2020-01-16 15:22:30.981361 INFO AppDaemon: Starting API
2020-01-16 15:22:31.001760 INFO AppDaemon: Starting Admin Interface
2020-01-16 15:22:31.003710 INFO AppDaemon: Starting Dashboards
2020-01-16 15:22:31.006380 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:31.007824 WARNING AppDaemon: Unexpected error during HADashboard initialization
2020-01-16 15:22:31.009200 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:31.015100 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/dashboard.py", line 77, in __init__
    os.makedirs(self.compile_dir)
  File "/usr/lib/python3.8/os.py", line 221, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/config/appdaemon/compiled'
2020-01-16 15:22:31.016735 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:31.021889 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:31.023349 WARNING AppDaemon: Unexpected error in HTTP module
2020-01-16 15:22:31.024720 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:31.066033 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/aiohttp/web_urldispatcher.py", line 512, in __init__
    raise ValueError('Not a directory')
ValueError: Not a directory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 271, in __init__
    self.setup_dashboard_routes()
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 707, in setup_dashboard_routes
    self.app.router.add_static('/compiled_javascript', self.dashboard_obj.compiled_javascript_dir)
  File "/usr/lib/python3.8/site-packages/aiohttp/web_urldispatcher.py", line 1053, in add_static
    resource = StaticResource(prefix, path,
  File "/usr/lib/python3.8/site-packages/aiohttp/web_urldispatcher.py", line 514, in __init__
    raise ValueError(
ValueError: No directory exists at '/data/compiled/javascript'
2020-01-16 15:22:31.068797 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:31.121833 INFO HASS: Connected to Home Assistant 0.103.6
2020-01-16 15:22:31.460918 INFO AppDaemon: App 'hello_world' added
2020-01-16 15:22:31.466991 INFO AppDaemon: Found 1 total apps
2020-01-16 15:22:31.469942 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2020-01-16 15:22:31.477319 INFO AppDaemon: Running on port 5050
2020-01-16 15:22:31.584336 INFO HASS: Evaluating startup conditions
2020-01-16 15:22:31.942420 INFO AppDaemon: Got initial state from namespace default
2020-01-16 15:22:33.503872 INFO AppDaemon: Scheduler running in realtime
2020-01-16 15:22:33.517782 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-01-16 15:22:33.519663 INFO AppDaemon: Adding /config/appdaemon/apps/illuminate_door to module import path
2020-01-16 15:22:33.529360 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2020-01-16 15:22:33.567062 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/illuminate_door/illuminate_door.py - ignoring
2020-01-16 15:22:33.570680 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-01-16 15:22:34.356781 INFO hello_world: Hello from AppDaemon
2020-01-16 15:22:34.361406 INFO hello_world: You are now ready to run Apps!
2020-01-16 15:22:34.370600 INFO AppDaemon: App initialization complete
2020-01-16 15:22:47.032423 INFO AppDaemon: Loading custom skin 'default'
2020-01-16 15:22:47.276784 INFO AppDaemon: Compiling dashboard 'Main'
2020-01-16 15:22:49.407093 WARNING AppDaemon: Variable definition not found in CSS Skin variables: $black
2020-01-16 15:22:55.239968 INFO AppDaemon: Previous message repeated 3 times
2020-01-16 15:22:55.241388 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:55.243215 WARNING AppDaemon: Unexpected error during DASH creation
2020-01-16 15:22:55.244585 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:55.247265 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/dashboard.py", line 829, in get_dashboard
    dash = self._conditional_compile(name, skin, recompile)
  File "/usr/lib/python3.8/site-packages/appdaemon/dashboard.py", line 780, in _conditional_compile
    dash = self._get_dash(name, skin, skindir)
  File "/usr/lib/python3.8/site-packages/appdaemon/dashboard.py", line 651, in _get_dash
    os.makedirs(os.path.join(self.compiled_css_dir, skin))
  File "/usr/lib/python3.8/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib/python3.8/os.py", line 221, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/config/appdaemon/compiled/css'
2020-01-16 15:22:55.248753 WARNING AppDaemon: ------------------------------------------------------------
2020-01-16 15:22:55.285786 INFO AppDaemon: function [get_dashboard] finished in 8253 ms

I was able to go to the admin page and when going to the dashboard list i get correctly the list, but when choosing one of them i get those errorsā€¦
Any help?

@maurizio53 Delete the compiled folder in the /config/appdaemon/ directory, and try again :+1:

I donā€™t have a compiled folder inside /config/appdaemon directory.
Or at least i donā€™t see itā€¦

:point_up: That is a pretty clear message to meā€¦

@frenck
54
This is the tree of appdaemon folder
I tried to create that folder but it says it already exists, but i donā€™t see itā€¦

Check via SSH please.

Thanksā€¦ solvedā€¦

1 Like

@Mariusthvdb i think you better take it up with ludeus at another place.
this has nothing to do with the addon, and its also nothing that is caused by a breaking change that i know of.

maybe geopy is not compatible with python 3.8, or something there has changed, but i really cant tell.

ok I will, thanks.

not sure if itā€™s the add-on or the AD update itself, but either cause the app not to run anymoreā€¦
again, appreciate the effort you made!

Any suggestions as to how to make the ā€˜Open Web UIā€™ button work?

SSL configuration for AppDaemon is not handled by the add-on, but by AppDaemon itself. See the AppDaemon manual for more information about configuring SSL.

This also means, Hass.io is not able to track if AppDaemon uses SSL or not, and thus the ā€œOPEN WEB UIā€ button in the interface will never work for those cases.

1 Like

Ok thanks. Is it possible to configure AppDaemon so it does work?

Iā€™ve seen the HTTP Component section of the docs and it refers to this being a ā€˜Unified Frontendā€™ - is this the same as the Web UI?

That section refers to dash_ssl* settings - do those work for the Unified Frontend or just the dash?

What is the relationship between the HTTP Component and the ha_url - are they one and the same? Or is the ha_url the Open Web UI url?

The ā€œOPEN WEB UIā€ button will only work with the default setting. It cannot act upon changes in AppDaemon. If you enable SSL, the button wonā€™t work and there is no way to make it work.

Yes. (Port 5050 by default).

It is a unified frontend, it applied to all elements mentioned in the HTTP documentation. (AppDaemonā€™s Admin Interface, HADashboard, and the AppDaemon API).

No, ha_url is the Home Assistant instance URL AppDaemon itself will connect to in order to communicate with Home Assistant, it has nothing to do with the OPEN WEB UI button.

TL;DR: With SSL enabled, the button wonā€™t work and canā€™t be fixed.

2 Likes

I havenā€™t been able to configure AppDaemon to serve SSL either, for me the browser times out when trying to send an https query to port 5050. So I logged an issue against AppDaemon for this.

Once SSL is enabled on AppDaemon, you should be able to add a panel_iframe to the HA config and and use that to access AppDaemon via https, instead of the the Open Web UI button that is hard coded to use http. (Ironically, panel_iframe doesnā€™t support the embedding of http sites like AppDaemon without SSL enabled if you are accessing HA via https.)

@frenck I get and agree that the addon framework shouldnā€™t be interacting with configs for the underlying addon itself, but is it possible to add an addon config option that the user can set manually to indicate whether they themselves have configured AppDaemon for SSL or not, and if so the Open Web UI button should use https instead of http?

The open web ui button is hardcode and can only respond to addon option, there isnā€™t one. Not in the Hassio world, only in the appdaemon world. You can configure appdaemon for ssl, that works, youā€™ll loose the working button.

This is not fixable and has been this way for the past 2 years, including all previous appdaemon addons.

I investigated for adding Hassio ingress to appdaemon, but the appdaemon frontend code simply doesnā€™t allow for it. It handles web sockets in an unfriendly way for reverse proxies and all assets are loaded in various ways.

This is what it is for the addon, and where it ends as well at this point.

:tada: Release v0.1.2

Full Changelog

This is a general maintenance release.

:hammer: Changes

  • :arrow_up: Updates appdaemon to v4.0.1 (#4)

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work:
https://github.com/sponsors/frenck or https://patreon.com/frenck

latest AD update to 4.0.1 seems to have improved the handling of the address.py app mentioned above. So posting here again.

Finally I see a

2020-01-21 08:46:50.130904 INFO address: Updating state for device_tracker.life360_name

in the log. It still isnā€™t as responsive as under AD3, and the updating isnā€™t as frequent as state change would have it to be. Nor does a subsequent update keep a reverse coded address in the device_trackers stateā€¦

Will add this to the GitHub too, to track progress

reverting to AD3 again, and all is good. At least that shows that updating HA to 104.2 isnā€™t the culprit.

@frenck Hi, is it somehow possible to do sensor like below? If I try to do this for this addon like http://192.168.1.24:8123/api/hassio/addons/a0d7b954_appdaemon/info it does not work/create sensor.

For appdaemon3 it worked well (http://192.168.1.24:8123/api/hassio/addons/a0d7b954_appdaemon3/info).

Thank you in advance for your helpā€¦

  - platform: rest
    resource: http://192.168.1.24:8123/api/hassio/addons/a0d7b954_adguard/info
    name: adguard
    value_template: '{{ value_json.data.state }}'
    scan_interval: 60
    headers:
      Authorization: !secret llt
      Content-Type: application/json

Iā€™m new to appdaemon.
Iā€™ve installed the hass.io add on for appdaemon 4.

But getting this in the logs:

1

1:44:38] INFO: Starting AppDaemon...
Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 384, in main
    admain.main()
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 211, in main
    with open(config_file_yaml, 'r') as yamlfd:
FileNotFoundError: [Errno 2] No such file or directory: '/config/appdaemon/appdaemon.yaml'

Any ideas?

exactly as the error says:

No such file or directory: '/config/appdaemon/appdaemon.yaml'

and that is the needed configuration file from appdaemon.


https://appdaemon.readthedocs.io/en/latest/CONFIGURE.html