Need a hand upgradeing to v4

Trying to upgrade from v3 to v4 and I’m having trouble starting, I get the following:

-----------------------------------------------------------
 Hass.io Add-on: AppDaemon 4
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.1.2
 You are running the latest version of this add-on.
 System: Ubuntu 18.04.4 LTS  (amd64 / intel-nuc)
 Home Assistant version: 0.105.3
 Supervisor version: 200
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing... 
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[05:59:36] INFO: Starting AppDaemon...
2020-02-13 05:59:38.494428 INFO AppDaemon: AppDaemon Version 4.0.1 starting
2020-02-13 05:59:38.494955 INFO AppDaemon: Python version is 3.8.1
2020-02-13 05:59:38.495390 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-02-13 05:59:38.495743 INFO AppDaemon: Added log: AppDaemon
2020-02-13 05:59:38.496128 INFO AppDaemon: Added log: Error
2020-02-13 05:59:38.496492 INFO AppDaemon: Added log: Access
2020-02-13 05:59:38.496831 INFO AppDaemon: Added log: Diag
2020-02-13 05:59:38.531633 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-02-13 05:59:38.586959 INFO HASS: HASS Plugin Initializing
2020-02-13 05:59:38.587368 INFO HASS: HASS Plugin initialization complete
2020-02-13 05:59:38.588406 INFO AppDaemon: HTTP is disabled
2020-02-13 05:59:38.598626 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-13 05:59:38.612451 INFO AppDaemon: App 'hello_world' added
2020-02-13 05:59:38.614204 INFO AppDaemon: Found 1 total apps
2020-02-13 05:59:38.615259 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2020-02-13 05:59:43.609879 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-13 05:59:48.628264 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-13 05:59:53.639732 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-13 05:59:58.653894 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
....................

My current appdaemon.yaml:

secrets: /config/secrets.yaml
logs:

appdaemon:
  latitude: snip
  longitude: snip
  elevation: 172
  time_zone: America/New_York
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.0.89/:8123
     #NewToken
      #token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJiMGI2ZmQwYWIwM2Y0YmI5YjU2ZmQwN2Q2MTMxMTc4NCIsImlhdCI6MTU4MTU4ODAzOSwiZXhwIjoxODk2OTQ4MDM5fQ.NpjPEFSaGL3ca7slneSJqEbd21uI6SlmiCc6SPA3UbI
     #old token
      token: 05c97b00e4fb7e741cd07bc9521db429f81316a8e55ac2ac4484e15c4aea912b5d121b7fc3be9ee96873a40242120ea5e6668d644add8d4d

hadashboard:
  dash_url: http://127.0.0.1:5050
  dash_dir: /config/appdaemon/dashboards
admin:
api:

My old config:

secrets: /config/secrets.yaml
log:
  logfile: STDOUT
  errorfile: STDERR
appdaemon:
  threads: 10
  app_dir: /config/appdaemon/apps
  plugins:
    HASS:
      type: hass
      ha_url: http://hassio/homeassistant
      token: 05c97b00e4fb7e741cd07bc9521db429f81316a8e55ac2ac4484e15c4aea912b5d121b7fc3be9ee96873a40242120ea5e6668d644add8d4d
hadashboard:
  dash_url: http://127.0.0.1:5050
  dash_dir: /config/appdaemon/dashboards

I thought it was a token problem so I created a new long lived token, as seen by the comments in the config. However both tokens don’t seem to work with the new version. Same error with both.

Not sure what I’m doing wrong. Need a hand please.
System info:
Host OS: Ubuntu 18.04
hass

I only have one simple dashboard setup with a few buttons. Nothing to complicated.

Many thanks.

1 Like

I see you are using Home Assistant (formerly hass.io). Did you read the instructions on the add-on page? This is from the official add-on docs

By default, this add-on ships without a token and without the ha_url in the appdaemon.yaml config file. This is not an error!

The add-on takes care of these settings for you and you do not need to provide or set these in the AppDaemon configuration.

This automatic handling of the URL and token conflicts with the AppDaemon official documentation. The official documentation will state ha_url and token options are required. For the add-on, these aren’t needed.

However, you are free to set them if you want to override, however, in general usage, that should not be needed and is not recommended for this add-on.

So you need to remove the lines “ha_url” and “token” because the add-on already handles this.

Yes I had tried that. but it threw another error, so I was trying different things. I got off on a tangent error and became stuck with that path.

With the config as:

secrets: /config/secrets.yaml
logs:

appdaemon:
  latitude:snip
  longitude: snip
  elevation: 172
  time_zone: America/New_York
  plugins:
    HASS:
      type: hass
      #ha_url: http://192.168.0.89/:8123
      #ha_url: http://hassio/homeassistant
      #token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJiMGI2ZmQwYWIwM2Y0YmI5YjU2ZmQwN2Q2MTMxMTc4NCIsImlhdCI6MTU4MTU4ODAzOSwiZXhwIjoxODk2OTQ4MDM5fQ.NpjPEFSaGL3ca7slneSJqEbd21uI6SlmiCc6SPA3UbI
      #token: 05c97b00e4fb7e741cd07bc9521db429f81316a8e55ac2ac4484e15c4aea912b5d121b7fc3be9ee96873a40242120ea5e6668d644add8d4d

hadashboard:
  dash_url: http://127.0.0.1:5050
  dash_dir: /config/appdaemon/dashboards
admin:
api:
hadashboard:

All offending config errors commented out.
I have this error in the log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Hass.io Add-on: AppDaemon 4
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.1.2
 You are running the latest version of this add-on.
 System: Ubuntu 18.04.4 LTS  (amd64 / intel-nuc)
 Home Assistant version: 0.105.3
 Supervisor version: 200
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing... 
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[07:16:15] INFO: Starting AppDaemon...
2020-02-13 07:16:16.832989 INFO AppDaemon: AppDaemon Version 4.0.1 starting
2020-02-13 07:16:16.833760 INFO AppDaemon: Python version is 3.8.1
2020-02-13 07:16:16.834157 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-02-13 07:16:16.834478 INFO AppDaemon: Added log: AppDaemon
2020-02-13 07:16:16.834834 INFO AppDaemon: Added log: Error
2020-02-13 07:16:16.835190 INFO AppDaemon: Added log: Access
2020-02-13 07:16:16.835483 INFO AppDaemon: Added log: Diag
2020-02-13 07:16:16.871084 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-02-13 07:16:16.926971 INFO HASS: HASS Plugin Initializing
2020-02-13 07:16:16.927450 INFO HASS: HASS Plugin initialization complete
2020-02-13 07:16:16.928423 INFO AppDaemon: HTTP is disabled
2020-02-13 07:16:16.948879 INFO HASS: Connected to Home Assistant 0.105.3
2020-02-13 07:16:17.009251 INFO AppDaemon: App 'hello_world' added
2020-02-13 07:16:17.012025 INFO AppDaemon: Found 1 total apps
2020-02-13 07:16:17.013076 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2020-02-13 07:16:17.072668 INFO HASS: Evaluating startup conditions
2020-02-13 07:16:17.124332 INFO AppDaemon: Got initial state from namespace default
2020-02-13 07:16:19.025741 INFO AppDaemon: Scheduler running in realtime
2020-02-13 07:16:19.033485 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-02-13 07:16:19.038057 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2020-02-13 07:16:19.053137 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-02-13 07:16:19.055662 WARNING hello_world: ------------------------------------------------------------
2020-02-13 07:16:19.056546 WARNING hello_world: Unexpected error initializing app: hello_world:
2020-02-13 07:16:19.057198 WARNING hello_world: ------------------------------------------------------------
2020-02-13 07:16:19.060901 WARNING hello_world: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 820, in check_app_updates
    await self.init_object(app)
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 279, in init_object
    "object": app_class(
  File "/usr/lib/python3.8/site-packages/appdaemon/plugins/hass/hassapi.py", line 46, in __init__
    adbase.ADBase.__init__(self, ad, name, logging, args, config, app_config, global_vars)
  File "/usr/lib/python3.8/site-packages/appdaemon/adbase.py", line 75, in __init__
    self.dashboard_dir = self.AD.http.dashboard_dir
AttributeError: 'NoneType' object has no attribute 'dashboard_dir'

2020-02-13 07:16:19.061498 WARNING hello_world: ------------------------------------------------------------
2020-02-13 07:16:19.062454 WARNING AppDaemon: Unable to find module hello_world - initialize() skipped
2020-02-13 07:16:19.064026 INFO AppDaemon: App initialization complete

Many thanks.

This looks “better” at least the connection to HA worked. I just saw that you are missing the http: part.
Add this to your appdaemon.yaml

http:
  url: http://127.0.0.1:5050

and remove this part from hadashboard:

dash_url: http://127.0.0.1:5050

New errors with this config:

secrets: /config/secrets.yaml
logs:

appdaemon:
  latitude: snip
  longitude: snip
  elevation: 172
  time_zone: America/New_York
  plugins:
    HASS:
      type: hass
      #ha_url: http://192.168.0.89/:8123
      #ha_url: http://hassio/homeassistant
      #token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJiMGI2ZmQwYWIwM2Y0YmI5YjU2ZmQwN2Q2MTMxMTc4NCIsImlhdCI6MTU4MTU4ODAzOSwiZXhwIjoxODk2OTQ4MDM5fQ.NpjPEFSaGL3ca7slneSJqEbd21uI6SlmiCc6SPA3UbI
      #token: 05c97b00e4fb7e741cd07bc9521db429f81316a8e55ac2ac4484e15c4aea912b5d121b7fc3be9ee96873a40242120ea5e6668d644add8d4d
http: 
  http://127.0.0.1:5050
hadashboard:
#  dash_url: http://127.0.0.1:5050
  dash_dir: /config/appdaemon/dashboards
admin:
api:

Partial log:

File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.963469 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.964354 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.964884 WARNING AppDaemon: Unexpected error during process_event()
2020-02-13 07:47:04.965445 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.966490 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.967144 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.968055 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.968472 WARNING AppDaemon: Unexpected error during process_event()
2020-02-13 07:47:04.969054 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.970131 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.970779 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.971994 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.972538 WARNING AppDaemon: Unexpected error during process_event()
2020-02-13 07:47:04.973021 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.974055 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.974679 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.975635 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.976064 WARNING AppDaemon: Unexpected error during process_event()
2020-02-13 07:47:04.976521 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.977343 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.977857 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.978705 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.979180 WARNING AppDaemon: Unexpected error during process_event()
2020-02-13 07:47:04.979660 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.980453 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.980978 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.981817 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.982219 WARNING AppDaemon: Unexpected error during process_event()
2020-02-13 07:47:04.982666 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.983523 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.984033 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.984902 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.985323 WARNING AppDaemon: Unexpected error during process_event()
2020-02-13 07:47:04.985801 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.986596 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/events.py", line 208, in process_event
    await self.AD.http.stream_update(namespace, mydata)
  File "/usr/lib/python3.8/site-packages/appdaemon/http.py", line 657, in stream_update
    self.AD.thread_async.call_async_no_wait(self.stream.send_update, data)
AttributeError: 'HTTP' object has no attribute 'stream'

2020-02-13 07:47:04.987282 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.987960 WARNING AppDaemon: ------------------------------------------------------------
2020-02-13 07:47:04.988454 WARNING AppDaemon: Unexpected error during run()
2020-02-13 07:47:04.988907 WARNING AppDaemon: ------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/__main__.py", line 135, in run
    loop.run_until_complete(asyncio.gather(*pending))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete
    return future.result()
  File "/usr/lib/python3.8/site-packages/appdaemon/admin_loop.py", line 19, 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-02-13 07:47:04.992121 INFO AppDaemon: Previous message repeated 1 times
2020-02-13 07:47:04.992564 INFO AppDaemon: AppDaemon Exited
/usr/lib/python3.8/site-packages/appdaemon/__main__.py:134: DeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead
  pending = asyncio.Task.all_tasks()
[07:47:05] INFO: Starting AppDaemon...

Many thanks.

This:

http: 
  http://127.0.0.1:5050

Needs to be like this:

http: 
  url: http://127.0.0.1:5050

That did it!

Many thanks for the help.

Edit: getting java errors opening dashboard pages, (just main page and hello dashboard) on chrome but all ok on firefox for some reason.

Glad that you got it to work :slight_smile:

Can’t help you on the java errors with the browsers.

Hello, I have a same problem.

Just upgraded from v3 to v4 trough pip:

....
cd appdaemon
source bin/activate
pip3 install --upgrade pip
pip3 install --upgrade wheel
pip3 install --upgrade appdaemon

Altered config by doc:

logs:
  main_log:
    filename: /var/log/appdaemon/appdaemon.log
    log_generations: 5
    log_size: 100000000
  access_log:
    filename: /var/log/appdaemon/access.log
  error_log:
    filename: /var/log/appdaemon/error.log
  diag_log:
    filename: /var/log/appdaemon/diag.log
appdaemon:
  latitude: 11.11
  longitude: 11.11
  elevation: 200
  time_zone: Europe/Berlin
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      namespace: mqtt
      client_id: APP_Daemon
      client_user: mqtt
      client_password: xxxxxx
      event_name: MQTT_EVENT
admin:
api:

Log:

2020-02-20 23:32:29.041468 INFO AppDaemon: AppDaemon Version 4.0.1 starting
2020-02-20 23:32:29.041604 INFO AppDaemon: Python version is 3.7.5
2020-02-20 23:32:29.041712 INFO AppDaemon: Configuration read from: /home/homeassistant/.homeassistant/appdaemon.yaml
2020-02-20 23:32:29.041888 INFO AppDaemon: Added log: AppDaemon
2020-02-20 23:32:29.042009 INFO AppDaemon: Added log: Error
2020-02-20 23:32:29.042095 INFO AppDaemon: Added log: Access
2020-02-20 23:32:29.042170 INFO AppDaemon: Added log: Diag
2020-02-20 23:32:29.048273 WARNING AppDaemon: config_dir: /home exists, but is not writeable, owner: root
2020-02-20 23:32:29.049137 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-02-20 23:32:29.052777 INFO HASS: HASS Plugin Initializing
2020-02-20 23:32:29.052907 WARNING HASS: ha_url not found in HASS configuration - module not initialized
2020-02-20 23:32:29.053013 INFO HASS: HASS Plugin initialization complete
2020-02-20 23:32:29.053134 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2020-02-20 23:32:29.055498 INFO MQTT: MQTT Plugin Initializing
2020-02-20 23:32:29.055626 INFO MQTT: Using 'app_daemon/status' as Will Topic
2020-02-20 23:32:29.055713 INFO MQTT: Using 'app_daemon/status' as Birth Topic
2020-02-20 23:32:29.056209 INFO AppDaemon: HTTP is disabled
2020-02-20 23:32:29.057393 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-20 23:32:34.060522 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-20 23:32:39.063111 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-20 23:32:44.066258 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds

When add ha_url: http://10.0.0.1:8123 as mentoined in log:

2020-02-21 00:04:21.928022 INFO HASS: Connected to Home Assistant 0.105.5
2020-02-21 00:04:21.928522 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-21 00:04:26.936429 INFO HASS: Connected to Home Assistant 0.105.5
2020-02-21 00:04:26.936913 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-02-21 00:04:31.944141 INFO HASS: Connected to Home Assistant 0.105.5
2020-02-21 00:04:31.944317 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds

Did you try adding the http section to appdaemon.yaml like this:

http: 
  url: http://127.0.0.1:5050

As I do not have a Hass plugin but pip install method, I had to add ha_url and token. Now it works.

You DO have a HASS plugin, your are just using a venv to install AppDaemon instead of the AppDaemon add-on for Home Assistant (formerly hass.io). That’s why your config is a bit different. The add-on handles the authentication to Home Assistant. I should have noticed, I somehow ignored the first part of your post and focused too much on your config.

Sorry, I mean I haven’t AppDaemon add-on.

I have similar issue.
I’ve been running AppDaemon 4 addon without problem and suddenly, it starts every 5 secs.
I need to stress that I did not change neither yaml files, nor appdaemon config, not even dashboards files.

2020-04-02 18:55:45.667813 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-04-02 18:55:50.696489 INFO HASS: Connected to Home Assistant 0.107.7

for all entities used on dashboards it displays message like this:

2020-04-02 19:44:59.248826 WARNING AppDaemon: Unknown entity: sensor.teplota_vody requested by None

My appdaemon.yaml

---
secrets: /config/secrets.yaml
appdaemon:
  latitude: 49...edited
  longitude: 17...edited
  elevation: 200
  time_zone: Europe/Prague
  plugins:
    HASS:
      type: hass
http:
  url: http://127.0.0.1:5050
hadashboard:
admin:
api:

full appdaemon log after addon restart:

 Latest add-on version: null
 Please consider upgrading as soon as possible.
 System: HassOS 3.12  (armv7 / raspberrypi3)
 Home Assistant Core: 0.107.7
 Home Assistant Supervisor: 214
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing... 
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/armv7/APKINDEX.tar.gz
v3.11.5-29-g9743c9490d [http://dl-cdn.alpinelinux.org/alpine/v3.11/main]
v3.11.5-30-gd0ff5181c1 [http://dl-cdn.alpinelinux.org/alpine/v3.11/community]
v20200319-837-g6623be2cab [http://dl-cdn.alpinelinux.org/alpine/edge/main]
v20200319-836-g3efb478cba [http://dl-cdn.alpinelinux.org/alpine/edge/community]
v20200319-838-gdf8be9f495 [http://dl-cdn.alpinelinux.org/alpine/edge/testing]
OK: 26181 distinct packages available
(1/39) Installing sdl2 (2.0.10-r0)
(2/39) Installing libxau (1.0.9-r0)
(3/39) Installing libbsd (0.10.0-r0)
(4/39) Installing libxdmcp (1.1.3-r0)
(5/39) Installing libxcb (1.13.1-r0)
(6/39) Installing libx11 (1.6.9-r0)
(7/39) Installing alsa-lib (1.2.1.2-r0)
(8/39) Installing libpng (1.6.37-r1)
(9/39) Installing freetype (2.10.1-r0)
(10/39) Installing libuuid (2.34-r1)
(11/39) Installing fontconfig (2.13.1-r2)
(12/39) Installing fribidi (1.0.8-r0)
(13/39) Installing libass (0.14.0-r0)
(14/39) Installing gmp (6.1.2-r1)
(15/39) Installing nettle (3.5.1-r0)
(16/39) Installing p11-kit (0.23.18.1-r0)
(17/39) Installing libtasn1 (4.15.0-r0)
(18/39) Installing libunistring (0.9.10-r0)
(19/39) Installing gnutls (3.6.10-r1)
(20/39) Installing lame (3.100-r0)
(21/39) Installing opus (1.3.1-r0)
(22/39) Installing libogg (1.3.4-r0)
(23/39) Installing libtheora (1.1.1-r14)
(24/39) Installing libjpeg-turbo (2.0.4-r0)
(25/39) Installing v4l-utils-libs (1.18.0-r0)
(26/39) Installing libxext (1.3.4-r0)
(27/39) Installing libxfixes (5.0.3-r2)
(28/39) Installing libdrm (2.4.100-r0)
(29/39) Installing wayland-libs-client (1.17.0-r0)
(30/39) Installing libva (2.6.0-r0)
(31/39) Installing libvdpau (1.3-r0)
(32/39) Installing libvorbis (1.3.6-r2)
(33/39) Installing libvpx (1.8.1-r0)
(34/39) Installing x264-libs (20191119-r0)
(35/39) Installing libstdc++ (9.2.0-r4)
(36/39) Installing x265-libs (3.2.1-r0)
(37/39) Installing xvidcore (1.3.5-r0)
(38/39) Installing ffmpeg-libs (4.2.1-r3)
(39/39) Installing ffmpeg (4.2.1-r3)
Executing busybox-1.31.1-r9.trigger
OK: 106 MiB in 73 packages
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:37:14] INFO: Starting AppDaemon...
2020-04-02 19:37:18.400417 INFO AppDaemon: AppDaemon Version 4.0.3 starting
2020-04-02 19:37:18.401896 INFO AppDaemon: Python version is 3.8.2
2020-04-02 19:37:18.403253 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-04-02 19:37:18.404101 INFO AppDaemon: Added log: AppDaemon
2020-04-02 19:37:18.405496 INFO AppDaemon: Added log: Error
2020-04-02 19:37:18.406325 INFO AppDaemon: Added log: Access
2020-04-02 19:37:18.407519 INFO AppDaemon: Added log: Diag
2020-04-02 19:37:18.477766 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2020-04-02 19:37:18.553105 INFO HASS: HASS Plugin Initializing
2020-04-02 19:37:18.554147 INFO HASS: HASS Plugin initialization complete
2020-04-02 19:37:18.556575 INFO AppDaemon: Initializing HTTP
2020-04-02 19:37:18.558435 INFO AppDaemon: Using 'ws' for event stream
2020-04-02 19:37:18.612302 INFO AppDaemon: Starting API
2020-04-02 19:37:18.632661 INFO AppDaemon: Starting Admin Interface
2020-04-02 19:37:18.634490 INFO AppDaemon: Starting Dashboards
2020-04-02 19:37:18.690983 INFO HASS: Connected to Home Assistant 0.107.7
2020-04-02 19:37:18.718364 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-04-02 19:37:18.727286 INFO AppDaemon: App 'hello_world' added
2020-04-02 19:37:18.731975 INFO AppDaemon: Found 1 total apps
2020-04-02 19:37:18.734708 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2020-04-02 19:37:18.739179 INFO AppDaemon: Running on port 5050
2020-04-02 19:37:23.748552 INFO HASS: Connected to Home Assistant 0.107.7
2020-04-02 19:37:23.771872 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-04-02 19:37:26.873153 INFO AppDaemon: New client Main Panel connected
2020-04-02 19:37:28.801708 INFO HASS: Connected to Home Assistant 0.107.7
2020-04-02 19:37:28.822124 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-04-02 19:37:33.852031 INFO HASS: Connected to Home Assistant 0.107.7
2020-04-02 19:37:33.873489 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2020-04-02 19:37:38.905540 INFO HASS: Connected to Home Assistant 0.107.7
2020-04-02 19:37:38.934286 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds

Any advice pls?

For two days I’ve been searching for a solution to this problem. Came across your comment and thought, “no way”. I tried it and it worked. Thank you so much for posting this.