Appdaemon doesn't want to work

Hi everyone !
I have some issue regarding Appdaemon installation on docker…

I have installed home-assistant core on docker via docker-compose. Everything is working properly with other dockers (mqtt, zigbee2mqtt and even qt-openzwave) but i want to perform automations via Python using Appdaemon.
As per the instructions for raspberry, i have to build the image by myself by cloning the home assistant repository

I have done that using my docker-compose by typing this:
1- git clone https://github.com/home-assistant/appdaemon.git
which create repository of the Appdaemon github.

Then i create the docker-compose to build the image:
2-

  appdaemon:
    build: ${USERDIR}/docker/images/appdaemon
    image: appdaemon:latest
    container_name: appdaemon
    volumes:
      - ${USERDIR}/docker/appdaemon:/conf
    environment:
      - HA_URL="my_url"
      - TOKEN="mytoken"
    restart: always

After some times, everything seems to be good as i have that in the logs:


2020-06-11 12:23:37.382830 INFO AppDaemon: AppDaemon Version 4.0.4 starting,
2020-06-11 12:23:37.385486 ERROR AppDaemon: elevation not specified in appdaemon.cfg,
2020-06-11 12:23:37.383177 INFO AppDaemon: Python version is 3.8.3,
2020-06-11 12:23:37.383459 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml,
2020-06-11 12:23:37.383735 INFO AppDaemon: Added log: AppDaemon,
2020-06-11 12:23:37.384023 INFO AppDaemon: Added log: Error,
2020-06-11 12:23:37.384281 INFO AppDaemon: Added log: Access,
2020-06-11 12:23:37.384526 INFO AppDaemon: Added log: Diag,
2020-06-11 12:23:37.384791 ERROR AppDaemon: time_zone not specified in appdaemon.cfg,
2020-06-11 12:23:37.385022 ERROR AppDaemon: latitude not specified in appdaemon.cfg,
2020-06-11 12:23:37.385254 ERROR AppDaemon: longitude not specified in appdaemon.cfg

I stop the container, add the missing info and restart the container and here comes the problem:


2020-06-11 14:27:18.529152 WARNING AppDaemon: ------------------------------------------------------------,
2020-06-11 14:27:18.529887 INFO AppDaemon: Previous message repeated 1 times,
2020-06-11 14:27:18.530257 WARNING AppDaemon: Unexpected error during process_event(),
2020-06-11 14:27:18.530660 WARNING AppDaemon: ------------------------------------------------------------,
2020-06-11 14:27:18.531281 WARNING AppDaemon: Traceback (most recent call last):,
  File "/usr/local/lib/python3.8/site-packages/appdaemon/events.py", line 235, in process_event,
    await self.AD.http.stream_update(namespace, mydata),
  File "/usr/local/lib/python3.8/site-packages/appdaemon/http.py", line 699, in stream_update,
    self.AD.thread_async.call_async_no_wait(self.stream.process_event, data),
AttributeError: 'HTTP' object has no attribute 'stream',
2020-06-11 14:27:18.531715 WARNING AppDaemon: ------------------------------------------------------------,
2020-06-11 14:27:18.538304 WARNING AppDaemon: ------------------------------------------------------------,
2020-06-11 14:27:18.538835 WARNING AppDaemon: Unexpected error during run(),
2020-06-11 14:27:18.539269 WARNING AppDaemon: ------------------------------------------------------------,
Traceback (most recent call last):,
  File "/usr/local/lib/python3.8/site-packages/appdaemon/__main__.py", line 134, in run,
    loop.run_until_complete(asyncio.gather(*pending)),
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete,
    return future.result(),
  File "/usr/local/lib/python3.8/site-packages/appdaemon/admin_loop.py", line 18, in loop,
    if self.AD.http.stats_update != "none" and self.AD.sched is not None:,
AttributeError: 'HTTP' object has no attribute 'stats_update',
2020-06-11 14:27:18.541929 INFO AppDaemon: Previous message repeated 1 times,
2020-06-11 14:27:18.542319 INFO AppDaemon: AppDaemon Exited,
/usr/local/lib/python3.8/site-packages/appdaemon/__main__.py:133: DeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead,
  pending = asyncio.Task.all_tasks()

I found this. https://github.com/home-assistant/appdaemon/issues/845

I had the same problem. You can checkout dev branch and rebuild your docker image. This bug has been fixed at issues 845 that I mentioned above. And remember to add url: http://localhost:5050 into your appdaemon.yaml file, not just http://:5050$HOSTNAME or http://:5050.

I have managed to get appdaemon working by using this repo on Raspberry Pi 4

https://github.com/grewhit25/docker-appdaemon