AppDaemon docker container: unable to find module <x> - <x> is not intialized

Hi everybody,

could somebody please help me to initially set up AppDaemon to work with my Home Assistant?

I ran both hass and appdaemon as separate docker containers.

appdaemon.yaml

log:
  logfile: STDOUT
  errorfile: STDERR

appdaemon:
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: "http://<url>:8123"
      token: "<token>
hadashboard:
  dash_url: "http://<url>:<port>"

Multiple AppDaemon scripts are installed in home assistant via HACS. They are placed in config/appdaemon/apps/<each_script>/. Then there is config/appdaemon/apps/apps.yaml, which currently contains

people_at_home:
  module: people_tracker
  class: PeopleTracker
  guest_entity_id: input_boolean.guests # took this from the example config; this entity does not actually exist
  entities:
    - entity.1
    - entity.2
    - entity.3

The appdaemon container path contains

  • docker-compose.yaml
  • apps/ (…)
  • compiled/
    • css/default/hello_application.css
    • html/default/
      • hello_body.html
      • hello_head.html
    • javascript/
      • application.js
      • default/hello_init.js
    • dashboards/Hello.dash

The apps.yaml file looks exactly the same as the config/appdaemon/apps/apps.yaml in the Home Assistant docker file. This is the output when I run docker-compose up

Starting appdaemon ... done
Attaching to appdaemon
appdaemon    | 2020-05-03 09:14:27.724792 INFO AppDaemon Version 3.0.5 starting
appdaemon    | 2020-05-03 09:14:27.725102 INFO Configuration read from: /conf/appdaemon.yaml
appdaemon    | 2020-05-03 09:14:27.726539 INFO AppDaemon: Starting Apps
appdaemon    | 2020-05-03 09:14:27.729741 INFO AppDaemon: Loading Plugin HASS using classHassPlugin from module hassplugin
appdaemon    | 2020-05-03 09:14:27.862385 INFO AppDaemon: HASS: HASS Plugin Initializing
appdaemon    | 2020-05-03 09:14:27.862780 INFO AppDaemon: HASS: HASS Plugin initialization complete
appdaemon    | 2020-05-03 09:14:27.863024 INFO Starting Dashboards
appdaemon    | 2020-05-03 09:14:27.868647 INFO API is disabled
appdaemon    | 2020-05-03 09:14:27.920905 INFO AppDaemon: HASS: Connected to Home Assistant 0.109.1
appdaemon    | 2020-05-03 09:14:28.123383 INFO AppDaemon: Got initial state from namespace default
appdaemon    | 2020-05-03 09:14:29.991703 INFO AppDaemon: Reading config
appdaemon    | 2020-05-03 09:14:29.994291 INFO AppDaemon: /conf/apps/apps.yaml added or modified
appdaemon    | 2020-05-03 09:14:29.994457 INFO AppDaemon: /conf/apps/apps.yaml added or modified
appdaemon    | 2020-05-03 09:14:29.994656 INFO AppDaemon: App 'people_at_home' added
appdaemon    | 2020-05-03 09:14:29.994824 INFO AppDaemon: Adding /conf/apps to module import path
appdaemon    | 2020-05-03 09:14:29.995047 INFO AppDaemon: Initializing app people_at_homeusing class PeopleTracker from module people_tracker
appdaemon    | 2020-05-03 09:14:29.995148 WARNING AppDaemon: Unable to find module modulepeople_tracker - people_at_home is not initialized
appdaemon    | 2020-05-03 09:14:29.995778 INFO AppDaemon: App initialization complete

I am not sure how to initialize anything; also, the hello dashboard (which will only display a box containing “hello world”) is the only thing displayed under http://<ip>:<appdaemon-port>; there is not a single entity within Home Assistant indicating that AppDaemon is connected, or anything related to appdaemon at all.

What am I doing wrong? Thank you for your help :slight_smile:

Hi @prankousky,

I do not run AppDaemon with Docker, but there is something I might be able to help you with.

This warning from AppDaemon, appears because it did not find any Python module (python file) called people_tracker inside the apps/ folder. So this means that you are trying to use people_tracker and this is not present in the apps folder.

1 Like

Add admin and api to your config, i.e.

log:
  logfile: STDOUT
  errorfile: STDERR

appdaemon:
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: "http://<url>:8123"
      token: "<token>
hadashboard:
  dash_url: "http://<url>:<port>"
admin:
api:

and restart the container.

1 Like

Thank you both. I copied the *.py files from Home Assistant config/appdaemon/apps/<name>/ to appdaemon config/apps, and now it seems to work. I also added the admin and api part, but this did not work until I also copied the python files.

As it actually possible to have Home Assistant and AppDaemon share those files (otherwise I don’t see the point of installing them via HACS in Home Assistant, when they actually need to be in a completely different path and/or docker container); I guess I could try linking the Home Assistant appdaemon path to the appdaemon container, but usually I try not to share any volumes between my containers.

1 Like