Community Hass.io Add-on: AppDaemon 3

That’s strange, there should be an indication there that it lost the connection with Home Assistant. What does your add-on configuration look like?

Yes, strange indeed. This is my 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: mytoken
hadashboard:
  dash_url: http://127.0.0.1:5050
  dash_dir: /config/appdaemon/dashboards

change STDOUT and STDERR to a valid filename, so that you can find out what is going on.

i dont know if addons are restarted when you restart homeassistant, but appdaemon normally goes on and something in your apps can cause trouble when it cant reach homeassistant.

some thing with complete device restart. you could have a race problem.
but that can only been seen with good logfiles.

Done:)

After a cold boot (hassio host restart) the below is logged. The error log remains empty (no errors). The apps however are not working.

AppDaemon log in logfile:

2019-02-18 21:43:07.823321 INFO AppDaemon Version 3.0.2 starting
2019-02-18 21:43:07.824786 INFO Configuration read from: /config/appdaemon/appdaemon.yaml
2019-02-18 21:43:07.832515 INFO AppDaemon: Starting Apps
2019-02-18 21:43:07.850015 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2019-02-18 21:43:08.705671 INFO AppDaemon: HASS: HASS Plugin Initializing
2019-02-18 21:43:08.707137 INFO AppDaemon: HASS: HASS Plugin initialization complete
2019-02-18 21:43:08.708196 INFO Starting Dashboards
2019-02-18 21:43:08.747830 INFO API is disabled
2019-02-18 21:43:08.767640 INFO AppDaemon: HASS: Connected to Home Assistant 0.87.1
2019-02-18 21:43:09.999860 INFO AppDaemon: Got initial state from namespace default
2019-02-18 21:43:13.040011 INFO AppDaemon: Reading config
2019-02-18 21:43:13.403917 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-18 21:43:13.405348 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-18 21:43:13.406486 INFO AppDaemon: App 'app_carport_motion' added
2019-02-18 21:43:13.408341 INFO AppDaemon: App 'app_carport_motion2' added
2019-02-18 21:43:13.409502 INFO AppDaemon: App 'door_notifications' added
2019-02-18 21:43:13.411083 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2019-02-18 21:43:13.414811 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/door_notifications.py
2019-02-18 21:43:14.303290 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/carport_motion.py
2019-02-18 21:43:14.315312 INFO AppDaemon: Initializing app app_carport_motion using class carport_motion_detection from module carport_motion
2019-02-18 21:43:14.701466 INFO app_carport_motion: Initializing carport_motion_detection stuff
2019-02-18 21:43:14.703335 INFO AppDaemon: Initializing app app_carport_motion2 using class carport_motion_detection from module carport_motion
2019-02-18 21:43:14.712214 INFO app_carport_motion2: Initializing carport_motion_detection stuff
2019-02-18 21:43:14.719877 INFO AppDaemon: Initializing app door_notifications using class DoorMonitor from module door_notifications
2019-02-18 21:43:14.722388 INFO AppDaemon: App initialization complete

AppDaemon log in add-on page:

[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 v1.6.0
 Python Apps and HADashboard using AppDaemon 3.x for Home Assistant
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 armhf / HassOS 1.13 / HA 0.87.1 / SU 143 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-compiled-dir.sh: executing... 
[cont-init.d] 21-compiled-dir.sh: exited 0.
[cont-init.d] 30-auto-token.sh: executing... 
INFO: Updating Hass.io API token in AppDaemon with the current one...
[cont-init.d] 30-auto-token.sh: exited 0.
[cont-init.d] 31-ha-url.sh: executing... 
[cont-init.d] 31-ha-url.sh: exited 0.
[cont-init.d] 50-compiled-symlink.sh: executing... 
[cont-init.d] 50-compiled-symlink.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-python-packages.sh: executing... 
[cont-init.d] 81-python-packages.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

After restarting the AppDaemon via the add-on page, the logging is as below.

Log file is appended with the following:

2019-02-18 21:51:06.778124 INFO SIGTERM Recieved
2019-02-18 21:51:06.794719 INFO AppDaemon: HASS: Disconnecting from Home Assistant
2019-02-18 21:51:06.962800 INFO AppDaemon: Removing module /config/appdaemon/apps/door_notifications.py
2019-02-18 21:51:06.970221 INFO AppDaemon: Removing module /config/appdaemon/apps/carport_motion.py
2019-02-18 21:51:06.972342 INFO AppDaemon: Terminating app_carport_motion
2019-02-18 21:51:06.973852 INFO AppDaemon: Terminating app_carport_motion2
2019-02-18 21:51:06.975236 INFO AppDaemon: Terminating door_notifications
2019-02-18 21:51:06.988703 INFO AppDeamon Exited
2019-02-18 21:52:07.774674 INFO AppDaemon Version 3.0.2 starting
2019-02-18 21:52:07.776308 INFO Configuration read from: /config/appdaemon/appdaemon.yaml
2019-02-18 21:52:07.783606 INFO AppDaemon: Starting Apps
2019-02-18 21:52:07.802279 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2019-02-18 21:52:08.414273 INFO AppDaemon: HASS: HASS Plugin Initializing
2019-02-18 21:52:08.416745 INFO AppDaemon: HASS: HASS Plugin initialization complete
2019-02-18 21:52:08.418636 INFO Starting Dashboards
2019-02-18 21:52:08.463184 INFO API is disabled
2019-02-18 21:52:08.505998 INFO AppDaemon: HASS: Connected to Home Assistant 0.87.1
2019-02-18 21:52:10.260703 INFO AppDaemon: Got initial state from namespace default
2019-02-18 21:52:12.032155 INFO AppDaemon: Reading config
2019-02-18 21:52:12.107774 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-18 21:52:12.109085 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-18 21:52:12.110050 INFO AppDaemon: App 'app_carport_motion' added
2019-02-18 21:52:12.111234 INFO AppDaemon: App 'app_carport_motion2' added
2019-02-18 21:52:12.112164 INFO AppDaemon: App 'door_notifications' added
2019-02-18 21:52:12.114418 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2019-02-18 21:52:12.118232 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/door_notifications.py
2019-02-18 21:52:12.202106 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/carport_motion.py
2019-02-18 21:52:12.206992 INFO AppDaemon: Initializing app app_carport_motion using class carport_motion_detection from module carport_motion
2019-02-18 21:52:12.659889 INFO app_carport_motion: Initializing carport_motion_detection stuff
2019-02-18 21:52:12.661189 INFO AppDaemon: Initializing app app_carport_motion2 using class carport_motion_detection from module carport_motion
2019-02-18 21:52:12.665794 INFO app_carport_motion2: Initializing carport_motion_detection stuff
2019-02-18 21:52:12.666780 INFO AppDaemon: Initializing app door_notifications using class DoorMonitor from module door_notifications
2019-02-18 21:52:12.669227 INFO AppDaemon: App initialization complete

AppDaemon 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 v1.6.0
 Python Apps and HADashboard using AppDaemon 3.x for Home Assistant
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 armhf / HassOS 1.13 / HA 0.87.1 / SU 143 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-compiled-dir.sh: executing... 
[cont-init.d] 21-compiled-dir.sh: exited 0.
[cont-init.d] 30-auto-token.sh: executing... 
INFO: Updating Hass.io API token in AppDaemon with the current one...
[cont-init.d] 30-auto-token.sh: exited 0.
[cont-init.d] 31-ha-url.sh: executing... 
[cont-init.d] 31-ha-url.sh: exited 0.
[cont-init.d] 50-compiled-symlink.sh: executing... 
[cont-init.d] 50-compiled-symlink.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-python-packages.sh: executing... 
[cont-init.d] 81-python-packages.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Now the Apps work again and I get the following in my log to confirm:

2019-02-18 21:54:31.156854 INFO app_carport_motion2: Jeej, it's dark and the motion app called by input_boolean.virtual_carport_motion
2019-02-18 21:54:31.160757 INFO app_carport_motion2: Light status before motion is dimmed restoring lights after motion

what kind of app are that?
do they connect to anything?

it is very well possible that you start a service in your apps that needs to be terminated, before AD closes.
from the logs it shows that everything should be working correct.

In essence the app monitors the state of device (e.g. sensor) and once triggered (e.g. motion detected) a certain action (e.g. lights on) needs to be executed if a condition (e.g. dusk sensor is on) is met. The ‘trick’ here is that after the action is performed, the previous condition needs to be restored.

Below a link to my app:

answered you in that topic, because your app is wrongly build, which causes that your app initialises, but never starts the listen_state.

Thanks! :slight_smile:

:tada: Release v1.7.0

Full Changelog

This release adds a workaround for a long time ongoing issue with using secrets in the AppDaemon configuration file. The automatic token update behavior can now be disabled using the add-on configuration.

Changed

  • Configure Renovate (#33)
  • Updates maintenance year to 2019
  • Removes BountySource links
  • Removes Anchore.io links
  • Refactor of GitLab CI
  • Moves Python requirements out of the Dockerfile
  • Replaces add-on link with GitHub link
  • Python PIP to 18.1
  • Fixes spelling error in Dockerfile
  • Adds option to disable auto token update
  • Upgrades add-on base image to 2.3.2

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

Just did a update to Home Assistant 0.90.0 and i get this in my log at home assistant startup.

api_password is going to deprecate. You need to use a bearer token to access /api/ from 172.30.32.2
api_password is going to deprecate. You need to use a bearer token to access /api/config from 172.30.32.2
api_password is going to deprecate. You need to use a bearer token to access /api/states from 172.30.32.2

appdeamon.yaml

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: 575e8951e0501ed14d0e7e41742772ecc51e95fa713bb1b15d1aa009ed1b4dd2
hadashboard:
  dash_url: http://192.168.50.92:5050
  dash_dir: /config/appdaemon/dashboards

Figured out it was appdeamon after deactivating it i get no warning at home assistant startup

:tada: Release v2.0.0

Full Changelog

Changed

  • :arrow_up: Upgrades add-on base image to 3.0.1
  • :sparkles: Adds ARMv7 support
  • :fire: Removes custom log format override
  • :hammer: Makes log_level optional
  • :arrow_up: Upgrades gcc to 8.2.0-r2
  • :arrow_up: Upgrades libffi to 3.2.1-r6
  • :arrow_up: Upgrades Python to 3.6.8-r1
  • :arrow_up: Upgrades Python PIP to 19.0.3
  • :hammer: Rewrite add-on onto Bashio
  • :ambulance: Fixes old library call

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

Hi there
I’m just starting to look into this, it’s very interesting, and I really hope I can make some good use of my lowly old tablet.
I’m trying to get different things shown on it, it’s a bit difficult to get cool stuff like satelite weather images, as I’m in Denmark and a decent weather prediction (I’m using SMHI), but I’ve gotten a few other things in it.
I don’t get that % settings for lights in a group doesn’t work.
Another thing is with my nest videodoorbell.
I would love to have the camera shown on the tablet, it is shown in the HA, so I guess it’s possible, but so far I’ve not been able to get it shown. Anybody that has an idea on how to get that working?
I also have some switches from fritz that measure temperature, and I would like to show the temperature from them, but so far I just get a NaN shown, and the temperature is shown below with a + and -. I would of course like to show the real temperature instead of NaN, and then nothing betwen the + and -.

:tada: Release v2.0.1

Full Changelog

Changed

  • :ambulance: Fixes incorrect exit code when auto token is disabled

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

hello, someone install the new 2.0.1 version? after that my appdaemon won’t start…

2019-04-02 08:06:18.483523 INFO AppDaemon Version 3.0.2 starting
2019-04-02 08:06:18.484520 INFO Configuration read from: /config/appdaemon/appdaemon.yaml
2019-04-02 08:06:18.490103 INFO AppDaemon: Starting Apps
2019-04-02 08:06:18.503257 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2019-04-02 08:06:18.868299 INFO AppDaemon: HASS: HASS Plugin Initializing
2019-04-02 08:06:18.870215 INFO AppDaemon: HASS: HASS Plugin initialization complete
2019-04-02 08:06:18.871775 INFO Starting Dashboards
2019-04-02 08:06:18.902663 INFO API is disabled
2019-04-02 08:06:18.928922 INFO AppDaemon: HASS: Connected to Home Assistant 0.90.2
2019-04-02 08:06:19.389395 INFO AppDaemon: Got initial state from namespace default
2019-04-02 08:06:20.607871 INFO HADashboard: New dashboard connected: Main Panel
2019-04-02 08:06:21.197695 INFO AppDaemon: Reading config
2019-04-02 08:06:21.219554 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-04-02 08:06:21.220853 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-04-02 08:06:21.221780 INFO HADashboard: New dashboard connected: Main Panel
2019-04-02 08:06:21.222434 INFO AppDaemon: App 'hello_world' added
2019-04-02 08:06:21.224141 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2019-04-02 08:06:21.225831 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2019-04-02 08:06:21.261369 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2019-04-02 08:06:21.388596 INFO HADashboard: New dashboard connected: Main Panel
2019-04-02 08:06:21.404584 INFO HADashboard: New dashboard connected: Main Panel
[08:06:21] INFO: Starting AppDaemon...
[08:06:22] INFO: Starting AppDaemon...
[08:06:23] INFO: Starting AppDaemon...
[08:06:24] INFO: Starting AppDaemon...
[08:06:25] INFO: Starting AppDaemon...
[08:06:26] INFO: Starting AppDaemon...
[08:06:27] INFO: Starting AppDaemon...
[08:06:28] INFO: Starting AppDaemon...
[08:06:29] INFO: Starting AppDaemon...
[08:06:30] INFO: Starting AppDaemon...
[08:06:31] INFO: Starting AppDaemon...

Same for me. I’m running HA v0.90.2 plus the default config and I get that INFO: Starting AppDaemon... message for as long as I am prepared to sit there tapping refresh. It won’t start!

Also tried a complete uninstall, deleted my appdaemon folder in config, then installed v2.0.1 from scratch. Still no joy.

SHould be fixed now - there was an issue with one of the AppDaemon libraries so I forced it to use an earlier known good version. This should have propagated through to the hass.io addon by now.

Great! So does this fix mean I should see a version higher than v2.0.1 ? Not sure if time zones affect update availability. I’m in Australia, can only see 2.0.1 still, did the update anyway in case your fix was embedded somehow. But still dont have a working AppDaemon. Hope it flows through soon. Thanks again.

In Italy same thing, only 2.0.1. Probably we must only wait!

:tada: Release v2.0.2

Full Changelog

Changed

  • :arrow_up: Updates appdaemon to v3.0.3 (#40)

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

Hi Frenck. Thanks for the update. I was hoping a new version + the change that @aimc applied would help with AppDaemon’s failure to start.

With v2.0.2, I’m still getting INFO: Starting AppDaemon... over and over.