I’m trying to configure AppDaemon from a pip install, and have the following (basic) appdaemon.yaml file in ~/.homeassistant/conf:
appdaemon:
logfile: STDOUT
errorfile: STDERR
threads: 10
plugins:
HASS:
type: hass
ha_url: https://<REDACTED>.duckdns.org
ha_key: !secret home_assistant_key
cert_path: /etc/letsencrypt/live/<REDACTED>.duckdns.org
When I start appdaemon (using sudo), I get the following error:
Traceback (most recent call last):
File "/usr/local/bin/appdaemon", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/appdaemon/admain.py", line 230, in main
conf.logfile = config['AppDaemon'].get("logfile")
KeyError: 'AppDaemon'
But, if I edit the apdaemon.yaml file so that the entry for appdaemon is in camelcase, i.e.:
AppDaemon:
logfile: STDOUT
errorfile: STDERR
…etc…
I get the following error instead:
Traceback (most recent call last):
File "/usr/local/bin/appdaemon", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/appdaemon/admain.py", line 248, in main
conf.timeout = config['HASS'].get("timeout")
KeyError: 'HASS'
Following the same line of thought, if I then edit the appdaemon.yaml file to:
appdaemon:
logfile: STDOUT
errorfile: STDERR
threads: 10
plugins:
HASS:
type: hass
ha_url: https://<REDACTED>.duckdns.org
ha_key: !secret home_assistant_key
cert_path: /etc/letsencrypt/live/<REDACTED>.duckdns.org
AppDaemon:
logfile: STDOUT
errorfile: STDERR
threads: 10
HASS:
ha_url: https://<REDACTED>.duckdns.org
ha_key: !secret home_assistant_key
cert_path: /etc/letsencrypt/live/<REDACTED>.duckdns.org
With this configuration, appdaemon connects to HomeAssistant but my example app (hello.py, as per the install docs) throws this error:
File "/usr/local/lib/python3.5/dist-packages/appdaemon/appdaemon.py", line 901, in read_app
conf.modules[module_name] = importlib.import_module(module_name)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/simon/.homeassistant/conf/apps/hello.py", line 2, in <module>
import appdaemon.plugins.hass.hassapi as hass
ImportError: No module named 'appdaemon.plugins'
Any idea how to fix these errors / why they’re occuring? I’m fairly sure I’ve followed all the install steps detailed in the latest appdaemon docs… I’m running HomeAssistant 0.60.0 and AppDaemon 2.1.12.