Appdaemon startup error + some beginner questions

Getting an error in appdaemon.py, but the error message is very confusing. It says the file is “/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py” but that folder doesn’t exist on my RPi.

Cannot get the Hello World app to run. I’m running on RPI3 with the Hassio install. Appdaemon was installed using the addon from here: https://github.com/vkorn/hassio-addons/tree/master/appdaemon

Here is my error:

2017-09-22 13:02:34.016885 INFO /config/hadaemon/appdaemon.yaml modified
2017-09-22 13:02:34.091987 INFO App 'HASS' changed - reloading
2017-09-22 13:02:34.093473 WARNING ------------------------------------------------------------
2017-09-22 13:02:34.094702 WARNING Unexpected error:
2017-09-22 13:02:34.095922 WARNING ------------------------------------------------------------
2017-09-22 13:02:34.097879 WARNING Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 845, in check_config
    name, new_config[name]["class"],
KeyError: 'class'
2017-09-22 13:02:34.098858 WARNING ------------------------------------------------------------

My appdaemon.yaml

AppDaemon:
  cert_verify: False
  logfile: STDOUT
  errorfile: STDERR
  threads: 10
  app_dir: /config/hadaemon/apps
  time_zone: America/Los_Angeles
  latitude: 37.698734
  longitude: -121.746732
  # latitude: !secret latitude
  # longitude: !secret longitude
  elevation: 116
HASS:
  ha_url: https://[redacted].synology.me:8123
  ha_key: [redacted]

# Apps
hello_world:
  module: hello
  class: HelloWorld

My apps.yaml

hello_world:
  module: hello
  class: HelloWorld

It’s not clear in the docs, but I’m guessing you only define the apps in appdaemon.yaml or apps.yaml and not both. I’ve tried all variations.

you must only declare the apps in apps.yaml

please delete it from appdaemon.yaml and restart appdaemon.
the error shows that you edited your appdaemon.yaml and you didnt restart appdaemon.

i wonder if appdaemon did start allright, because i didnt know that the hassio problems were solved.

Wow, now it’s working. I’d tried so many combinations of small changes over 2 days and restarted hassio at least 20 times, so I’m confused on what just got fixed. I was always restarting hass.io and not just appdaemon.

Another beginner question. I’m seeing hello.py loading, but I’m not seeing log output. Tried several variations with no luck. One time, I purposely tried a syntax error and saw output in the log and error log.

2017-09-25 09:13:21.008989 INFO Reloading Module: /config/hadaemon/apps/hello.py
2017-09-25 09:14:06.007868 INFO Reloading Module: /config/hadaemon/apps/hello.py
2017-09-25 09:21:11.008414 INFO Reloading Module: /config/hadaemon/apps/hello.py
2017-09-25 09:21:29.007831 INFO Reloading Module: /config/hadaemon/apps/hello.py
2017-09-25 09:21:29.024718 WARNING Logged an error to /config/hadaemon/logs/appdaemon_error.log
2017-09-25 09:21:55.008188 INFO Reloading Module: /config/hadaemon/apps/hello.py
2017-09-25 09:22:04.008066 INFO Reloading Module: /config/hadaemon/apps/hello.py
2017-09-25 09:22:27.008291 INFO Reloading Module: /config/hadaemon/apps/hello.py
2017-09-25 09:23:47.008412 INFO Reloading Module: /config/hadaemon/apps/hello.py

I’ve tried all these combinations of log statements.

def initialize(self):
     self.log("Hello from AppDaemon")
     self.log("Hello from AppDaemon", level = "ERROR")
     self.log("You are now ready to run Apps!", level = "INFO")
     self.log("You are now ready to run Apps!", level = "DEBUG")
     self.error("You are now ready to run Apps!")

I would have thought after the app was loaded that the initialize method would fire.

i dont think you have added the app to apps.yaml correctly.

it resloads the py file, but it doesnt restart the app.
look in /config/hadaemon/logs/appdaemon_error.log if you have other errors.