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

Doesn’t Work?? #8

Closed mclemente1987 closed 1 year ago

mclemente1987 commented 1 year ago

Hi! I tríed this ad, but i can not run it.

On logs usually have this error: 2022-12-26 23:12:01.822254 WARNING spotify_mood_lights_sync: ------------------------------------------------------------

WARNING spotify_mood_lights_sync: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/spotipy/oauth2.py", line 265, in _request_access_token response.raise_for_status() File "/usr/lib/python3.10/site-packages/requests/models.py", line 953, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/token During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 917, in worker funcref( File "/config/appdaemon/apps/ad-spotify-mood-lights-sync/spotify_mood_lights_sync.py", line 134, in sync_lights_from_spotify self.sync_light(new_uri) File "/config/appdaemon/apps/ad-spotify-mood-lights-sync/spotify_mood_lights_sync.py", line 170, in sync_light color = self.color_from_uri(track_uri) File "/config/appdaemon/apps/ad-spotify-mood-lights-sync/spotify_mood_lights_sync.py", line 189, in color_from_uri track_features = self.call_api(partial(self.sp.audio_features, track_uri))[0] File "/config/appdaemon/apps/ad-spotify-mood-lights-sync/spotify_mood_lights_sync.py", line 272, in call_api return func() File "/usr/lib/python3.10/site-packages/spotipy/client.py", line 1689, in audio_features results = self._get("audio-features/?ids=" + trackid) File "/usr/lib/python3.10/site-packages/spotipy/client.py", line 297, in _get return self._internal_call("GET", url, payload, kwargs) File "/usr/lib/python3.10/site-packages/spotipy/client.py", line 221, in _internal_call headers = self._auth_headers() File "/usr/lib/python3.10/site-packages/spotipy/client.py", line 212, in _auth_headers token = self.auth_manager.get_access_token(as_dict=False) File "/usr/lib/python3.10/site-packages/spotipy/oauth2.py", line 238, in get_access_token token_info = self._request_access_token() File "/usr/lib/python3.10/site-packages/spotipy/oauth2.py", line 269, in _request_access_token self._handle_oauth_error(http_error) File "/usr/lib/python3.10/site-packages/spotipy/oauth2.py", line 146, in _handle_oauth_error raise SpotifyOauthError( spotipy.oauth2.SpotifyOauthError: error: invalid_client, error_description: Invalid client

Any ideas?

NiklasReiche commented 1 year ago

Hi, it seems like something is wrong with your spotify credentials. Is your spotify integration in homeassistant working, i.e. the spotify entity is connected and shows the correct states when spotify is playing something? If so, you should just need to supply your spotify client id and client secret from the developer dashboard to the app.

NiklasReiche commented 1 year ago

Also note that the example config in the readme assumes the presence of a secrets file, so when setting the client_id and client_secret without a secrets file you have to omit the !secret prefix.

NiklasReiche commented 1 year ago

Hey @mclemente1987, did you try checking whether you supply the app with the correct Spotify credentials?

mclemente1987 commented 1 year ago

it works!

I just replaced !secret an used directly and it works ok.

thanks for your help.

El mar, 14 feb 2023 a las 19:37, Niklas Reiche @.***>) escribió:

Hey @mclemente1987 https://github.com/mclemente1987, did you try checking whether you supply the app with the correct Spotify credentials?

— Reply to this email directly, view it on GitHub https://github.com/NiklasReiche/ad-spotify-mood-lights-sync/issues/8#issuecomment-1430202226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6S5CPSK3II24E46ORONOTWXPGGFANCNFSM6AAAAAATJ5S4ZI . You are receiving this because you were mentioned.Message ID: @.***>

NiklasReiche commented 1 year ago

Glad to hear that! I'll update the documentation to make that point a bit clearer.