AppDaemon throws an error with this script
2019-01-30 21:39:41.332492 INFO AppDaemon Version 3.0.2 starting
2019-01-30 21:39:41.334233 INFO Configuration read from: /home/homeassistant/conf/appdaemon.yaml
2019-01-30 21:39:41.340127 INFO AppDaemon: Starting Apps
2019-01-30 21:39:41.342120 WARNING config_dir: /home exists, but is not writeable, owner: root
2019-01-30 21:39:41.350691 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2019-01-30 21:39:42.178811 INFO AppDaemon: HASS: HASS Plugin Initializing
2019-01-30 21:39:42.180380 INFO AppDaemon: HASS: HASS Plugin initialization complete
2019-01-30 21:39:42.181903 INFO Dashboards are disabled
2019-01-30 21:39:42.183552 INFO API is disabled
2019-01-30 21:39:42.200008 INFO AppDaemon: HASS: Connected to Home Assistant 0.86.3
2019-01-30 21:39:42.253672 INFO AppDaemon: Got initial state from namespace default
2019-01-30 21:39:44.393396 INFO AppDaemon: Reading config
2019-01-30 21:39:44.402105 INFO AppDaemon: /home/homeassistant/conf/apps/apps.yaml added or modified
2019-01-30 21:39:44.402645 INFO AppDaemon: /home/homeassistant/conf/apps/apps.yaml added or modified
2019-01-30 21:39:44.403116 INFO AppDaemon: App 'kodi' added
2019-01-30 21:39:44.403465 INFO AppDaemon: App 'hello_world' added
2019-01-30 21:39:44.404003 INFO AppDaemon: Adding /home/homeassistant/conf/apps to module import path
2019-01-30 21:39:44.406009 INFO AppDaemon: Loading App Module: /home/homeassistant/conf/apps/kodi.py
2019-01-30 21:39:44.427344 WARNING AppDaemon: ------------------------------------------------------------
2019-01-30 21:39:44.427850 WARNING AppDaemon: Unexpected error loading module: /home/homeassistant/conf/apps/kodi.py:
2019-01-30 21:39:44.428252 WARNING AppDaemon: ------------------------------------------------------------
2019-01-30 21:39:44.432961 WARNING AppDaemon: Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/appdaemon/appdaemon.py", line 2026, in check_app_updates
self.read_app(mod["name"], mod["reload"])
File "/usr/local/lib/python3.5/dist-packages/appdaemon/appdaemon.py", line 1809, in read_app
self.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 673, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/homeassistant/conf/apps/kodi.py", line 3, in <module>
from homeassistant.components.media_player.kodi import (
ImportError: No module named 'homeassistant'
2019-01-30 21:39:44.433542 WARNING AppDaemon: ------------------------------------------------------------
2019-01-30 21:39:44.433978 WARNING AppDaemon: Removing associated apps:
2019-01-30 21:39:44.434373 WARNING AppDaemon: kodi
2019-01-30 21:39:44.434843 INFO AppDaemon: Loading App Module: /home/homeassistant/conf/apps/hello.py
2019-01-30 21:39:44.438074 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2019-01-30 21:39:44.659882 INFO hello_world: Hello from AppDaemon
2019-01-30 21:39:44.663363 INFO hello_world: You are now ready to run Apps!
2019-01-30 21:39:44.665367 INFO AppDaemon: App initialization complete
I start appDaemon with this commands:
sudo -u homeassistant -H -s
source /srv/homeassistant/bin/activate
appdaemon -c /home/homeassistant/conf
In the conf folder i have the appdaemon.yml:
appdaemon:
threads: 10
plugins:
HASS:
type: hass
ha_url: http://192.168.178.68:8123
token: xxxxx
And also in the conf folder is the apps folder with the kodi.py and the apps.yml. I copied the kodi.py from the link and didn’t change it. The apps.yml is this:
hello_world:
module: hello
class: HelloWorld
kodi:
module: kodi
class: DynamicKodiInputSelect
Does anybody know how i could fix this?