NiklasReiche / ad-spotify-mood-lights-sync

AppDaemon app that synchronizes rgb lights to the mood of the currently playing spotify song in Home Assistant.
MIT License
35 stars 5 forks source link

Issue running when AppDaemon is inside Docker - numpy not found #6

Closed proffalken closed 2 years ago

proffalken commented 2 years ago

Hey!

This looks like a great project, but I'm having issues getting it up and running when I'm running AppDaemon inside a docker container.

The log output is as follows:

2022-03-15 14:46:09.543082 INFO AppDaemon: Loading App Module: /conf/apps/spotify_mood_lights_sync.py
2022-03-15 14:46:09.549759 WARNING Error: ------------------------------------------------------------
2022-03-15 14:46:09.550081 WARNING Error: Unexpected error loading module: /conf/apps/spotify_mood_lights_sync.py:
2022-03-15 14:46:09.550396 WARNING Error: ------------------------------------------------------------
2022-03-15 14:46:09.553188 WARNING Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 993, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 784, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 14:46:09.553498 WARNING Error: ------------------------------------------------------------
2022-03-15 14:46:09.553803 WARNING AppDaemon: Removing associated apps:
2022-03-15 14:46:09.554131 WARNING AppDaemon: spotify_mood_lights_sync

My configuration looks like this:

# appdaemon.yaml
# ... other stuff
system_packages:
  - py3-pillow
  - py3-numpy
python_packages:
  - spotipy
  - Pillow
; requirements.txt
spotipy
numpy
; system_packages.txt
py3-numpy

I see that the various packages get installed, but for some reason it can't find them on the path (full log including error above):

FO AppDaemon: Scheduler running in realtime
2022-03-15 13:10:27.220499 INFO AppDaemon: Reading config
2022-03-15 13:10:27.233393 WARNING AppDaemon: App 'unifi_username' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.233696 WARNING AppDaemon: App 'unifi_password' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.234048 WARNING AppDaemon: App 'unifi_host' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.234479 WARNING AppDaemon: App 'google_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.234834 WARNING AppDaemon: App 'google_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.235185 WARNING AppDaemon: App 'google_fit_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.235558 WARNING AppDaemon: App 'google_fit_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.235901 WARNING AppDaemon: App 'spotify_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.236226 WARNING AppDaemon: App 'spotify_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.236585 WARNING AppDaemon: App 'sonos_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.237076 WARNING AppDaemon: App 'sonos_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.237441 WARNING AppDaemon: App 'sp_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.237789 WARNING AppDaemon: App 'sp_dc' missing 'class' or 'module' entry - ignoring
2022-03-15 13:10:27.238171 INFO AppDaemon: /conf/apps/secrets.yaml added or modified
2022-03-15 13:10:27.242589 INFO AppDaemon: Found 2 total apps
2022-03-15 13:10:27.244386 INFO AppDaemon: Adding /conf/apps to module import path
2022-03-15 13:10:27.247204 INFO AppDaemon: Loading App Module: /conf/apps/spotify_mood_lights_sync.py
2022-03-15 13:10:27.253861 WARNING Error: ------------------------------------------------------------
2022-03-15 13:10:27.254183 WARNING Error: Unexpected error loading module: /conf/apps/spotify_mood_lights_sync.py:
2022-03-15 13:10:27.254481 WARNING Error: ------------------------------------------------------------
2022-03-15 13:10:27.257194 WARNING Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 993, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 784, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 13:10:27.257559 WARNING Error: ------------------------------------------------------------
2022-03-15 13:10:27.257906 WARNING AppDaemon: Removing associated apps:
2022-03-15 13:10:27.258205 WARNING AppDaemon: spotify_mood_lights_sync
2022-03-15 13:10:27.260975 INFO AppDaemon: Loading App Module: /conf/apps/hello.py
2022-03-15 13:10:27.263648 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-03-15 13:10:27.323754 INFO hello_world: Hello from AppDaemon
2022-03-15 13:10:27.324569 INFO hello_world: You are now ready to run Apps!
2022-03-15 13:10:27.325550 INFO AppDaemon: App initialization complete
2022-03-15 13:10:30.920919 INFO AppDaemon: New client Admin Client connected
2022-03-15 13:12:05.833915 INFO AppDaemon: Reading config
2022-03-15 13:12:05.847631 WARNING AppDaemon: App 'unifi_username' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.847948 WARNING AppDaemon: App 'unifi_password' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.848235 WARNING AppDaemon: App 'unifi_host' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.848639 WARNING AppDaemon: App 'google_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.848997 WARNING AppDaemon: App 'google_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.849379 WARNING AppDaemon: App 'google_fit_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.849727 WARNING AppDaemon: App 'google_fit_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.850065 WARNING AppDaemon: App 'spotify_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.850418 WARNING AppDaemon: App 'spotify_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.850754 WARNING AppDaemon: App 'sonos_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.851082 WARNING AppDaemon: App 'sonos_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.851435 WARNING AppDaemon: App 'sp_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.851753 WARNING AppDaemon: App 'sp_dc' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:05.852113 INFO AppDaemon: /conf/apps/apps.yaml added or modified
2022-03-15 13:12:05.858213 INFO AppDaemon: App 'spotify_mood_lights_sync' changed
2022-03-15 13:12:05.860265 INFO AppDaemon: Found 2 total apps
2022-03-15 13:12:05.864857 INFO AppDaemon: Terminating spotify_mood_lights_sync
2022-03-15 13:12:05.866022 INFO AppDaemon: Initializing app spotify_mood_lights_sync using class SpotifyMoodLightsSync from module spotify_mood_lights_sync
2022-03-15 13:12:05.870867 WARNING spotify_mood_lights_sync: ------------------------------------------------------------
2022-03-15 13:12:05.871190 WARNING spotify_mood_lights_sync: Unexpected error initializing app: spotify_mood_lights_sync:
2022-03-15 13:12:05.871547 WARNING spotify_mood_lights_sync: ------------------------------------------------------------
2022-03-15 13:12:05.872094 WARNING spotify_mood_lights_sync: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 1026, in check_app_updates
    await self.init_object(app)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 321, in init_object
    modname = await utils.run_in_executor(self, __import__, app_args["module"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 13:12:05.872434 WARNING spotify_mood_lights_sync: ------------------------------------------------------------
2022-03-15 13:12:05.873182 WARNING AppDaemon: Unable to find module spotify_mood_lights_sync - initialize() skipped
2022-03-15 13:12:19.419757 INFO AppDaemon: SIGTERM Received
2022-03-15 13:12:19.420161 INFO AppDaemon: AppDaemon is shutting down
2022-03-15 13:12:19.425385 INFO HASS: Disconnecting from Home Assistant
2022-03-15 13:12:19.952241 INFO AppDaemon: Removing module /conf/apps/spotify_mood_lights_sync.py
2022-03-15 13:12:19.952590 INFO AppDaemon: Removing module /conf/apps/hello.py
2022-03-15 13:12:19.952964 INFO AppDaemon: Terminating hello_world
2022-03-15 13:12:19.954196 INFO AppDaemon: Terminating spotify_mood_lights_sync
2022-03-15 13:12:19.955324 INFO AppDaemon: Shutting down webserver
2022-03-15 13:12:20.394197 INFO AppDaemon: Saving all namespaces
2022-03-15 13:12:20.394611 INFO AppDaemon: AppDaemon is stopped.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/4) Installing libquadmath (10.3.1_git20211027-r0)
(2/4) Installing libgfortran (10.3.1_git20211027-r0)
(3/4) Installing openblas (0.3.18-r1)
(4/4) Installing py3-numpy (1.21.4-r0)
OK: 980 MiB in 73 packages
Collecting spotipy
  Downloading spotipy-2.19.0-py3-none-any.whl (27 kB)
Requirement already satisfied: urllib3>=1.26.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.26.8)
Requirement already satisfied: six>=1.15.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: requests>=2.25.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (2.26.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2.0.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (3.3)
Installing collected packages: spotipy
Successfully installed spotipy-2.19.0
2022-03-15 13:12:26.327050 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-03-15 13:12:26.327204 INFO AppDaemon: Python version is 3.9.9
2022-03-15 13:12:26.327326 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml
2022-03-15 13:12:26.327461 INFO AppDaemon: Added log: AppDaemon
2022-03-15 13:12:26.327593 INFO AppDaemon: Added log: Error
2022-03-15 13:12:26.327712 INFO AppDaemon: Added log: Access
2022-03-15 13:12:26.327816 INFO AppDaemon: Added log: Diag
2022-03-15 13:12:26.339193 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-03-15 13:12:26.367177 INFO HASS: HASS Plugin Initializing
2022-03-15 13:12:26.367322 INFO HASS: HASS Plugin initialization complete
2022-03-15 13:12:26.367638 INFO AppDaemon: Initializing HTTP
2022-03-15 13:12:26.367885 INFO AppDaemon: Using 'ws' for event stream
2022-03-15 13:12:26.370103 INFO AppDaemon: Starting API
2022-03-15 13:12:26.372245 INFO AppDaemon: Starting Admin Interface
2022-03-15 13:12:26.372584 INFO AppDaemon: Starting Dashboards
2022-03-15 13:12:26.402311 INFO HASS: Connected to Home Assistant 2022.3.0
2022-03-15 13:12:26.419899 WARNING AppDaemon: App 'unifi_username' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.420103 WARNING AppDaemon: App 'unifi_password' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.420306 WARNING AppDaemon: App 'unifi_host' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.420482 WARNING AppDaemon: App 'google_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.420655 WARNING AppDaemon: App 'google_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.420843 WARNING AppDaemon: App 'google_fit_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.420996 WARNING AppDaemon: App 'google_fit_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.421152 WARNING AppDaemon: App 'spotify_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.421316 WARNING AppDaemon: App 'spotify_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.421468 WARNING AppDaemon: App 'sonos_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.421617 WARNING AppDaemon: App 'sonos_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.421765 WARNING AppDaemon: App 'sp_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.421911 WARNING AppDaemon: App 'sp_dc' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:26.423884 INFO AppDaemon: App 'hello_world' added
2022-03-15 13:12:26.424824 INFO AppDaemon: App 'spotify_mood_lights_sync' added
2022-03-15 13:12:26.425373 INFO AppDaemon: Found 2 total apps
2022-03-15 13:12:26.425618 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2022-03-15 13:12:26.426315 INFO AppDaemon: Running on port 80
2022-03-15 13:12:26.468507 INFO HASS: Evaluating startup conditions
2022-03-15 13:12:26.471765 INFO HASS: Startup condition met: hass state=RUNNING
2022-03-15 13:12:26.471935 INFO HASS: All startup conditions met
2022-03-15 13:12:26.484370 INFO AppDaemon: Got initial state from namespace default
2022-03-15 13:12:28.430912 INFO AppDaemon: Scheduler running in realtime
2022-03-15 13:12:28.433366 INFO AppDaemon: Reading config
2022-03-15 13:12:28.446888 WARNING AppDaemon: App 'unifi_username' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.447215 WARNING AppDaemon: App 'unifi_password' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.447566 WARNING AppDaemon: App 'unifi_host' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.447949 WARNING AppDaemon: App 'google_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.448315 WARNING AppDaemon: App 'google_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.448819 WARNING AppDaemon: App 'google_fit_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.449209 WARNING AppDaemon: App 'google_fit_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.449634 WARNING AppDaemon: App 'spotify_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.450035 WARNING AppDaemon: App 'spotify_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.450462 WARNING AppDaemon: App 'sonos_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.450802 WARNING AppDaemon: App 'sonos_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.451189 WARNING AppDaemon: App 'sp_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.451545 WARNING AppDaemon: App 'sp_dc' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:28.451890 INFO AppDaemon: /conf/apps/secrets.yaml added or modified
2022-03-15 13:12:28.456557 INFO AppDaemon: Found 2 total apps
2022-03-15 13:12:28.458380 INFO AppDaemon: Adding /conf/apps to module import path
2022-03-15 13:12:28.461140 INFO AppDaemon: Loading App Module: /conf/apps/spotify_mood_lights_sync.py
2022-03-15 13:12:28.467640 WARNING Error: ------------------------------------------------------------
2022-03-15 13:12:28.467964 WARNING Error: Unexpected error loading module: /conf/apps/spotify_mood_lights_sync.py:
2022-03-15 13:12:28.468249 WARNING Error: ------------------------------------------------------------
2022-03-15 13:12:28.471128 WARNING Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 993, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 784, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 13:12:28.471462 WARNING Error: ------------------------------------------------------------
2022-03-15 13:12:28.471777 WARNING AppDaemon: Removing associated apps:
2022-03-15 13:12:28.472323 WARNING AppDaemon: spotify_mood_lights_sync
2022-03-15 13:12:28.474846 INFO AppDaemon: Loading App Module: /conf/apps/hello.py
2022-03-15 13:12:28.477029 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-03-15 13:12:28.529827 INFO hello_world: Hello from AppDaemon
2022-03-15 13:12:28.530496 INFO hello_world: You are now ready to run Apps!
2022-03-15 13:12:28.531459 INFO AppDaemon: App initialization complete
2022-03-15 13:12:32.890445 INFO AppDaemon: New client Admin Client connected
2022-03-15 13:12:51.651551 INFO AppDaemon: Reading config
2022-03-15 13:12:51.664884 WARNING AppDaemon: App 'unifi_username' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.665210 WARNING AppDaemon: App 'unifi_password' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.665605 WARNING AppDaemon: App 'unifi_host' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.666018 WARNING AppDaemon: App 'google_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.666438 WARNING AppDaemon: App 'google_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.666842 WARNING AppDaemon: App 'google_fit_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.667140 WARNING AppDaemon: App 'google_fit_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.667500 WARNING AppDaemon: App 'spotify_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.667938 WARNING AppDaemon: App 'spotify_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.668311 WARNING AppDaemon: App 'sonos_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.668734 WARNING AppDaemon: App 'sonos_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.669101 WARNING AppDaemon: App 'sp_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.669473 WARNING AppDaemon: App 'sp_dc' missing 'class' or 'module' entry - ignoring
2022-03-15 13:12:51.669849 INFO AppDaemon: /conf/apps/apps.yaml added or modified
2022-03-15 13:12:51.676980 INFO AppDaemon: Found 2 total apps
2022-03-15 13:13:08.765446 INFO AppDaemon: SIGTERM Received
2022-03-15 13:13:08.765899 INFO AppDaemon: AppDaemon is shutting down
2022-03-15 13:13:08.771384 INFO HASS: Disconnecting from Home Assistant
2022-03-15 13:13:08.774868 INFO AppDaemon: Removing module /conf/apps/spotify_mood_lights_sync.py
2022-03-15 13:13:08.775204 INFO AppDaemon: Removing module /conf/apps/hello.py
2022-03-15 13:13:08.775663 INFO AppDaemon: Terminating hello_world
2022-03-15 13:13:08.777169 INFO AppDaemon: Terminating spotify_mood_lights_sync
2022-03-15 13:13:08.778612 INFO AppDaemon: Shutting down webserver
2022-03-15 13:13:09.484719 INFO AppDaemon: Saving all namespaces
2022-03-15 13:13:09.485108 INFO AppDaemon: AppDaemon is stopped.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
  numpy (no such package):
    required by: world[numpy]
Collecting spotipy
  Downloading spotipy-2.19.0-py3-none-any.whl (27 kB)
Requirement already satisfied: urllib3>=1.26.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.26.8)
Requirement already satisfied: requests>=2.25.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (2.26.0)
Requirement already satisfied: six>=1.15.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2.0.10)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (3.3)
Installing collected packages: spotipy
Successfully installed spotipy-2.19.0
2022-03-15 13:13:13.606882 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-03-15 13:13:13.606999 INFO AppDaemon: Python version is 3.9.9
2022-03-15 13:13:13.607154 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml
2022-03-15 13:13:13.607245 INFO AppDaemon: Added log: AppDaemon
2022-03-15 13:13:13.607383 INFO AppDaemon: Added log: Error
2022-03-15 13:13:13.607507 INFO AppDaemon: Added log: Access
2022-03-15 13:13:13.607627 INFO AppDaemon: Added log: Diag
2022-03-15 13:13:13.619157 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-03-15 13:13:13.648264 INFO HASS: HASS Plugin Initializing
2022-03-15 13:13:13.648441 INFO HASS: HASS Plugin initialization complete
2022-03-15 13:13:13.648859 INFO AppDaemon: Initializing HTTP
2022-03-15 13:13:13.649118 INFO AppDaemon: Using 'ws' for event stream
2022-03-15 13:13:13.651425 INFO AppDaemon: Starting API
2022-03-15 13:13:13.653580 INFO AppDaemon: Starting Admin Interface
2022-03-15 13:13:13.653812 INFO AppDaemon: Starting Dashboards
2022-03-15 13:13:13.685114 INFO HASS: Connected to Home Assistant 2022.3.0
2022-03-15 13:13:13.705721 WARNING AppDaemon: App 'unifi_username' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.705944 WARNING AppDaemon: App 'unifi_password' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.706152 WARNING AppDaemon: App 'unifi_host' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.706367 WARNING AppDaemon: App 'google_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.706532 WARNING AppDaemon: App 'google_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.706676 WARNING AppDaemon: App 'google_fit_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.706873 WARNING AppDaemon: App 'google_fit_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.707022 WARNING AppDaemon: App 'spotify_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.707186 WARNING AppDaemon: App 'spotify_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.707327 WARNING AppDaemon: App 'sonos_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.707476 WARNING AppDaemon: App 'sonos_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.707612 WARNING AppDaemon: App 'sp_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.707761 WARNING AppDaemon: App 'sp_dc' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:13.709766 INFO AppDaemon: App 'hello_world' added
2022-03-15 13:13:13.710516 INFO AppDaemon: App 'spotify_mood_lights_sync' added
2022-03-15 13:13:13.711135 INFO AppDaemon: Found 2 total apps
2022-03-15 13:13:13.711505 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2022-03-15 13:13:13.712334 INFO AppDaemon: Running on port 80
2022-03-15 13:13:13.755013 INFO HASS: Evaluating startup conditions
2022-03-15 13:13:13.758057 INFO HASS: Startup condition met: hass state=RUNNING
2022-03-15 13:13:13.758254 INFO HASS: All startup conditions met
2022-03-15 13:13:13.770356 INFO AppDaemon: Got initial state from namespace default
2022-03-15 13:13:15.717134 INFO AppDaemon: Scheduler running in realtime
2022-03-15 13:13:15.720217 INFO AppDaemon: Reading config
2022-03-15 13:13:15.733943 WARNING AppDaemon: App 'unifi_username' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.734318 WARNING AppDaemon: App 'unifi_password' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.734693 WARNING AppDaemon: App 'unifi_host' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.735025 WARNING AppDaemon: App 'google_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.735344 WARNING AppDaemon: App 'google_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.735687 WARNING AppDaemon: App 'google_fit_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.735976 WARNING AppDaemon: App 'google_fit_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.736265 WARNING AppDaemon: App 'spotify_client_id' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.736638 WARNING AppDaemon: App 'spotify_client_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.736987 WARNING AppDaemon: App 'sonos_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.737320 WARNING AppDaemon: App 'sonos_secret' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.737697 WARNING AppDaemon: App 'sp_key' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.738181 WARNING AppDaemon: App 'sp_dc' missing 'class' or 'module' entry - ignoring
2022-03-15 13:13:15.738538 INFO AppDaemon: /conf/apps/secrets.yaml added or modified
2022-03-15 13:13:15.743210 INFO AppDaemon: Found 2 total apps
2022-03-15 13:13:15.745172 INFO AppDaemon: Adding /conf/apps to module import path
2022-03-15 13:13:15.748040 INFO AppDaemon: Loading App Module: /conf/apps/spotify_mood_lights_sync.py
2022-03-15 13:13:15.754857 WARNING Error: ------------------------------------------------------------
2022-03-15 13:13:15.755207 WARNING Error: Unexpected error loading module: /conf/apps/spotify_mood_lights_sync.py:
2022-03-15 13:13:15.755611 WARNING Error: ------------------------------------------------------------
2022-03-15 13:13:15.758625 WARNING Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 993, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 784, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 13:13:15.758982 WARNING Error: ------------------------------------------------------------
2022-03-15 13:13:15.759349 WARNING AppDaemon: Removing associated apps:
2022-03-15 13:13:15.759638 WARNING AppDaemon: spotify_mood_lights_sync
2022-03-15 13:13:15.762492 INFO AppDaemon: Loading App Module: /conf/apps/hello.py
2022-03-15 13:13:15.765669 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-03-15 13:13:15.829902 INFO hello_world: Hello from AppDaemon
2022-03-15 13:13:15.830803 INFO hello_world: You are now ready to run Apps!
2022-03-15 13:13:15.832132 INFO AppDaemon: App initialization complete
2022-03-15 13:13:16.861503 INFO AppDaemon: New client Admin Client connected
2022-03-15 13:13:18.849697 INFO AppDaemon: Reading config
2022-03-15 13:13:18.857465 INFO AppDaemon: /conf/apps/secrets.yaml deleted
2022-03-15 13:13:18.860935 INFO AppDaemon: Found 2 total apps
2022-03-15 13:14:13.253444 INFO AppDaemon: SIGTERM Received
2022-03-15 13:14:13.253837 INFO AppDaemon: AppDaemon is shutting down
2022-03-15 13:14:13.258513 INFO HASS: Disconnecting from Home Assistant
2022-03-15 13:14:14.165089 INFO AppDaemon: Removing module /conf/apps/spotify_mood_lights_sync.py
2022-03-15 13:14:14.165480 INFO AppDaemon: Removing module /conf/apps/hello.py
2022-03-15 13:14:14.165904 INFO AppDaemon: Terminating hello_world
2022-03-15 13:14:14.167148 INFO AppDaemon: Terminating spotify_mood_lights_sync
2022-03-15 13:14:14.168581 INFO AppDaemon: Shutting down webserver
2022-03-15 13:14:14.170038 INFO AppDaemon: Saving all namespaces
2022-03-15 13:14:14.170410 INFO AppDaemon: AppDaemon is stopped.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
  numpy (no such package):
    required by: world[numpy]
Collecting spotipy
  Downloading spotipy-2.19.0-py3-none-any.whl (27 kB)
Collecting numpy
  Downloading numpy-1.22.3.zip (11.5 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied: requests>=2.25.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (2.26.0)
Requirement already satisfied: six>=1.15.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: urllib3>=1.26.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.26.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2.0.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (3.3)
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517): started
2022-03-15 13:14:55.881675 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-03-15 13:14:55.881847 INFO AppDaemon: Python version is 3.9.9
2022-03-15 13:14:55.881988 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml
2022-03-15 13:14:55.882149 INFO AppDaemon: Added log: AppDaemon
2022-03-15 13:14:55.882296 INFO AppDaemon: Added log: Error
2022-03-15 13:14:55.882429 INFO AppDaemon: Added log: Access
2022-03-15 13:14:55.882567 INFO AppDaemon: Added log: Diag
2022-03-15 13:14:55.894476 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-03-15 13:14:55.924417 INFO HASS: HASS Plugin Initializing
2022-03-15 13:14:55.924604 INFO HASS: HASS Plugin initialization complete
2022-03-15 13:14:55.924979 INFO AppDaemon: Initializing HTTP
2022-03-15 13:14:55.925290 INFO AppDaemon: Using 'ws' for event stream
2022-03-15 13:14:55.927856 INFO AppDaemon: Starting API
2022-03-15 13:14:55.929979 INFO AppDaemon: Starting Admin Interface
2022-03-15 13:14:55.930197 INFO AppDaemon: Starting Dashboards
2022-03-15 13:14:55.965452 INFO HASS: Connected to Home Assistant 2022.3.0
2022-03-15 13:14:55.979408 INFO AppDaemon: App 'hello_world' added
2022-03-15 13:14:55.980330 INFO AppDaemon: App 'spotify_mood_lights_sync' added
2022-03-15 13:14:55.980747 INFO AppDaemon: Found 2 total apps
2022-03-15 13:14:55.981006 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2022-03-15 13:14:55.981608 INFO AppDaemon: Running on port 80
2022-03-15 13:14:56.027508 INFO HASS: Evaluating startup conditions
2022-03-15 13:14:56.030708 INFO HASS: Startup condition met: hass state=RUNNING
2022-03-15 13:14:56.030933 INFO HASS: All startup conditions met
2022-03-15 13:14:56.042669 INFO AppDaemon: Got initial state from namespace default
2022-03-15 13:14:57.986994 INFO AppDaemon: Scheduler running in realtime
2022-03-15 13:14:57.989955 INFO AppDaemon: Adding /conf/apps to module import path
2022-03-15 13:14:57.992670 INFO AppDaemon: Loading App Module: /conf/apps/spotify_mood_lights_sync.py
2022-03-15 13:14:57.999397 WARNING Error: ------------------------------------------------------------
2022-03-15 13:14:57.999756 WARNING Error: Unexpected error loading module: /conf/apps/spotify_mood_lights_sync.py:
2022-03-15 13:14:58.000069 WARNING Error: ------------------------------------------------------------
2022-03-15 13:14:58.003202 WARNING Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 993, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 784, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 13:14:58.003607 WARNING Error: ------------------------------------------------------------
2022-03-15 13:14:58.003996 WARNING AppDaemon: Removing associated apps:
2022-03-15 13:14:58.004376 WARNING AppDaemon: spotify_mood_lights_sync
2022-03-15 13:14:58.007244 INFO AppDaemon: Loading App Module: /conf/apps/hello.py
2022-03-15 13:14:58.010515 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-03-15 13:14:58.073938 INFO hello_world: Hello from AppDaemon
2022-03-15 13:14:58.074595 INFO hello_world: You are now ready to run Apps!
2022-03-15 13:14:58.075532 INFO AppDaemon: App initialization complete
2022-03-15 13:15:12.895995 INFO AppDaemon: New client Admin Client connected
2022-03-15 14:45:25.236458 INFO AppDaemon: SIGTERM Received
2022-03-15 14:45:25.236851 INFO AppDaemon: AppDaemon is shutting down
2022-03-15 14:45:25.242168 INFO HASS: Disconnecting from Home Assistant
2022-03-15 14:45:25.467677 INFO AppDaemon: Removing module /conf/apps/spotify_mood_lights_sync.py
2022-03-15 14:45:25.468141 INFO AppDaemon: Removing module /conf/apps/hello.py
2022-03-15 14:45:25.468764 INFO AppDaemon: Terminating hello_world
2022-03-15 14:45:25.470308 INFO AppDaemon: Terminating spotify_mood_lights_sync
2022-03-15 14:45:25.471933 INFO AppDaemon: Shutting down webserver
2022-03-15 14:45:25.480333 INFO AppDaemon: Saving all namespaces
2022-03-15 14:45:25.480869 INFO AppDaemon: AppDaemon is stopped.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
  numpy (no such package):
    required by: world[numpy]
Collecting spotipy
  Downloading spotipy-2.19.0-py3-none-any.whl (27 kB)
Collecting numpy
  Downloading numpy-1.22.3.zip (11.5 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied: six>=1.15.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: urllib3>=1.26.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.26.8)
Requirement already satisfied: requests>=2.25.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (2.26.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2.0.10)
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517): started
2022-03-15 14:46:07.436807 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-03-15 14:46:07.436965 INFO AppDaemon: Python version is 3.9.9
2022-03-15 14:46:07.437064 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml
2022-03-15 14:46:07.437161 INFO AppDaemon: Added log: AppDaemon
2022-03-15 14:46:07.437299 INFO AppDaemon: Added log: Error
2022-03-15 14:46:07.437446 INFO AppDaemon: Added log: Access
2022-03-15 14:46:07.437601 INFO AppDaemon: Added log: Diag
2022-03-15 14:46:07.450720 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-03-15 14:46:07.480399 INFO HASS: HASS Plugin Initializing
2022-03-15 14:46:07.480498 INFO HASS: HASS Plugin initialization complete
2022-03-15 14:46:07.480855 INFO AppDaemon: Initializing HTTP
2022-03-15 14:46:07.481098 INFO AppDaemon: Using 'ws' for event stream
2022-03-15 14:46:07.483387 INFO AppDaemon: Starting API
2022-03-15 14:46:07.485549 INFO AppDaemon: Starting Admin Interface
2022-03-15 14:46:07.485824 INFO AppDaemon: Starting Dashboards
2022-03-15 14:46:07.515358 INFO HASS: Connected to Home Assistant 2022.3.0
2022-03-15 14:46:07.529558 INFO AppDaemon: App 'hello_world' added
2022-03-15 14:46:07.530545 INFO AppDaemon: App 'spotify_mood_lights_sync' added
2022-03-15 14:46:07.530956 INFO AppDaemon: Found 2 total apps
2022-03-15 14:46:07.531183 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2022-03-15 14:46:07.531845 INFO AppDaemon: Running on port 80
2022-03-15 14:46:07.578906 INFO HASS: Evaluating startup conditions
2022-03-15 14:46:07.582061 INFO HASS: Startup condition met: hass state=RUNNING
2022-03-15 14:46:07.582247 INFO HASS: All startup conditions met
2022-03-15 14:46:07.593880 INFO AppDaemon: Got initial state from namespace default
2022-03-15 14:46:09.536914 INFO AppDaemon: Scheduler running in realtime
2022-03-15 14:46:09.540057 INFO AppDaemon: Adding /conf/apps to module import path
2022-03-15 14:46:09.543082 INFO AppDaemon: Loading App Module: /conf/apps/spotify_mood_lights_sync.py
2022-03-15 14:46:09.549759 WARNING Error: ------------------------------------------------------------
2022-03-15 14:46:09.550081 WARNING Error: Unexpected error loading module: /conf/apps/spotify_mood_lights_sync.py:
2022-03-15 14:46:09.550396 WARNING Error: ------------------------------------------------------------
2022-03-15 14:46:09.553188 WARNING Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 993, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 784, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 14:46:09.553498 WARNING Error: ------------------------------------------------------------
2022-03-15 14:46:09.553803 WARNING AppDaemon: Removing associated apps:
2022-03-15 14:46:09.554131 WARNING AppDaemon: spotify_mood_lights_sync
2022-03-15 14:46:09.556794 INFO AppDaemon: Loading App Module: /conf/apps/hello.py
2022-03-15 14:46:09.560262 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-03-15 14:46:09.623798 INFO hello_world: Hello from AppDaemon
2022-03-15 14:46:09.624533 INFO hello_world: You are now ready to run Apps!
2022-03-15 14:46:09.625500 INFO AppDaemon: App initialization complete
2022-03-15 14:46:23.892140 INFO AppDaemon: New client Admin Client connected
2022-03-15 14:50:05.211504 INFO AppDaemon: SIGTERM Received
2022-03-15 14:50:05.211832 INFO AppDaemon: AppDaemon is shutting down
2022-03-15 14:50:05.216592 INFO HASS: Disconnecting from Home Assistant
2022-03-15 14:50:05.871510 INFO AppDaemon: Removing module /conf/apps/spotify_mood_lights_sync.py
2022-03-15 14:50:05.871831 INFO AppDaemon: Removing module /conf/apps/hello.py
2022-03-15 14:50:05.872220 INFO AppDaemon: Terminating hello_world
2022-03-15 14:50:05.873611 INFO AppDaemon: Terminating spotify_mood_lights_sync
2022-03-15 14:50:05.874839 INFO AppDaemon: Shutting down webserver
2022-03-15 14:50:05.939637 INFO AppDaemon: Saving all namespaces
2022-03-15 14:50:05.939968 INFO AppDaemon: AppDaemon is stopped.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/4) Installing libquadmath (10.3.1_git20211027-r0)
(2/4) Installing libgfortran (10.3.1_git20211027-r0)
(3/4) Installing openblas (0.3.18-r1)
(4/4) Installing py3-numpy (1.21.4-r0)
OK: 980 MiB in 73 packages
Collecting spotipy
  Downloading spotipy-2.19.0-py3-none-any.whl (27 kB)
Collecting numpy
  Downloading numpy-1.22.3.zip (11.5 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied: six>=1.15.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: requests>=2.25.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (2.26.0)
Requirement already satisfied: urllib3>=1.26.0 in /usr/local/lib/python3.9/site-packages (from spotipy->-r /conf/requirements.txt (line 1)) (1.26.8)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/site-packages (from requests>=2.25.0->spotipy->-r /conf/requirements.txt (line 1)) (2.0.10)
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517): started
2022-03-15 14:50:49.803475 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-03-15 14:50:49.803589 INFO AppDaemon: Python version is 3.9.9
2022-03-15 14:50:49.803716 INFO AppDaemon: Configuration read from: /conf/appdaemon.yaml
2022-03-15 14:50:49.803803 INFO AppDaemon: Added log: AppDaemon
2022-03-15 14:50:49.803934 INFO AppDaemon: Added log: Error
2022-03-15 14:50:49.804052 INFO AppDaemon: Added log: Access
2022-03-15 14:50:49.804178 INFO AppDaemon: Added log: Diag
2022-03-15 14:50:49.815912 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-03-15 14:50:49.844579 INFO HASS: HASS Plugin Initializing
2022-03-15 14:50:49.844696 INFO HASS: HASS Plugin initialization complete
2022-03-15 14:50:49.845006 INFO AppDaemon: Initializing HTTP
2022-03-15 14:50:49.845297 INFO AppDaemon: Using 'ws' for event stream
2022-03-15 14:50:49.847594 INFO AppDaemon: Starting API
2022-03-15 14:50:49.849813 INFO AppDaemon: Starting Admin Interface
2022-03-15 14:50:49.850105 INFO AppDaemon: Starting Dashboards
2022-03-15 14:50:49.879431 INFO HASS: Connected to Home Assistant 2022.3.0
2022-03-15 14:50:49.893588 INFO AppDaemon: App 'hello_world' added
2022-03-15 14:50:49.894538 INFO AppDaemon: App 'spotify_mood_lights_sync' added
2022-03-15 14:50:49.894947 INFO AppDaemon: Found 2 total apps
2022-03-15 14:50:49.895181 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2022-03-15 14:50:49.895866 INFO AppDaemon: Running on port 80
2022-03-15 14:50:49.941599 INFO HASS: Evaluating startup conditions
2022-03-15 14:50:49.944699 INFO HASS: Startup condition met: hass state=RUNNING
2022-03-15 14:50:49.944877 INFO HASS: All startup conditions met
2022-03-15 14:50:49.956719 INFO AppDaemon: Got initial state from namespace default
2022-03-15 14:50:51.900876 INFO AppDaemon: Scheduler running in realtime
2022-03-15 14:50:51.903956 INFO AppDaemon: Adding /conf/apps to module import path
2022-03-15 14:50:51.906727 INFO AppDaemon: Loading App Module: /conf/apps/spotify_mood_lights_sync.py
2022-03-15 14:50:51.913599 WARNING Error: ------------------------------------------------------------
2022-03-15 14:50:51.913894 WARNING Error: Unexpected error loading module: /conf/apps/spotify_mood_lights_sync.py:
2022-03-15 14:50:51.914204 WARNING Error: ------------------------------------------------------------
2022-03-15 14:50:51.917150 WARNING Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 993, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/local/lib/python3.9/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/appdaemon/app_management.py", line 784, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/conf/apps/spotify_mood_lights_sync.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

2022-03-15 14:50:51.917496 WARNING Error: ------------------------------------------------------------
2022-03-15 14:50:51.917848 WARNING AppDaemon: Removing associated apps:
2022-03-15 14:50:51.918187 WARNING AppDaemon: spotify_mood_lights_sync
2022-03-15 14:50:51.920692 INFO AppDaemon: Loading App Module: /conf/apps/hello.py
2022-03-15 14:50:51.925633 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-03-15 14:50:51.986994 INFO hello_world: Hello from AppDaemon
2022-03-15 14:50:51.987733 INFO hello_world: You are now ready to run Apps!
2022-03-15 14:50:51.988747 INFO AppDaemon: App initialization complete
2022-03-15 14:51:03.883937 INFO AppDaemon: New client Admin Client connected
NiklasReiche commented 2 years ago

Hey, sadly I don't know enough about docker and package management to troubleshoot this specific issue. However, since this is not the first time numpy has caused problems, I've worked on dropping the package as a dependency altogether. I still need to do some testing, but the new version could be out by tomorrow or the day after.

proffalken commented 2 years ago

Thanks @NiklasReiche, if I find time I'll have a poke around inside the container (I've been too busy to do that recently), but a numpy-free version would be amazing!

proffalken commented 2 years ago

OK, I had a poke around inside the container, it looks like numpy can't be installed via pip because the container I'm using is running on Alpine so you constantly get hit by a compilation error.

To complicate things further, apk add py3-numpy (which is what AppDaemon runs to install system packages) installs numpy into /usr/lib/python3.9/site-packages however the python path on the system is /usr/local/python3.9/site-packages, and copying from one to the other blows up as well.

Basically, it looks like the container I'm using is a bit broken, so I'm going to try and rebuild it using full debian and see if that makes a difference.

proffalken commented 2 years ago

ok, I switched to dtterastar/appdaemon and numpy is now installed, just about to try setting this up properly now.

proffalken commented 2 years ago

OK, closing this, it was an issue with the underlying OS in the docker container which is fixed if you use the container above.

I'm now seeing the following in the logs, but I'll investigate this another time:

2022-03-16 20:10:06.272379 ERROR spotify_mood_lights_sync: Could not find features for track uri x-sonos-vli:RINCON_949F3E5462E601400:2,spotify:25a25dfe566b06e42d442aa1dfbe4a72. This may be caused by trying to use a non-spotify media_player in 'direct' mode. Try using 'search' mode instead.
Reason: no track features found for uri
NiklasReiche commented 2 years ago

Hey @proffalken, for the new error message see https://github.com/NiklasReiche/ad-spotify-mood-lights-sync#media-players. In short, you should try adding mode: search to the app's config.

The problem here is that in direct mode the app expects a song ID in Spotify's format, which is provided by the Spotify integration in HA by default. It looks like you are using the Sonos integration for your media_player, which does not provide the song ID in the correct format (at least that's what I think, as I don't have a device to test this). However, as long as your media_player has the media_title and media_artist state attributes (which for Sonos should be true), you can configure the app to use search mode, where instead of querying the Spotify API by the song ID, it uses the song title and artist to find the correct track.

proffalken commented 2 years ago

@NiklasReiche spotted that, forgot to update this, it's working perfectly now, thanks!