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

It doesn't seem to work #13

Closed kronkinatorix closed 4 months ago

kronkinatorix commented 11 months ago

I THINK I've set up the appdaemon and spotfy mood light sync correctly. The sdpotify integration seems to work fine anyway, appdaemon logs aren't raising alarm bells, and the apps.yaml file - no noticeable issues. Nothing happens when I'm playing anything on spotify though. Hoping it's because I'm missing something and not a bug.

GNU nano 7.2 appdaemon/apps.yaml
spotify_mood_lights_sync: module: spotify_mood_lights_sync class: SpotifyMoodLightsSync client_id: !secret ccccccccc client_secret: !secret cccccccccccccccc media_player: media_player.spotify_mememememe source: mmanjaro constrain_input_boolean: input_boolean.spotify_mood_lights light:

appdaemon.yaml secrets: /config/secrets.yaml appdaemon: latitude: 43.6529 longitude: -79.3849 elevation: 209 time_zone: AMERICA/Toronto plugins: HASS: type: hass http: url: http://192.168.0.63:5050 admin: api: hadashboard: system_packages:

Any insigh will be appreciated!

Of note is that from the spotfy integration page nowehere does it mention what htis is or what it does or where it goes

Selecting output source

To play media Spotify first needs a device selected for audio output known as the source.

Example code to select an AV receiver as the output device

service: media_player.select_source entity_id: media_player.spotify data: source: "Denon AVR-X2000"

YAML The Spotify API cannot initiate playback to a device not already known to the Spotify API. The source list of available devices can be found in the Details section of the Spotify Media Player Control and the source_list attribute in the Developer Tools States.

NiklasReiche commented 11 months ago

Could you try specifying just a single entity name for the light: option like it is shown in the readme? I'm not sure, but I think the turn_on command that I use only works on strings and not lists. If you wanted to control multple lights, you'd have to create a group in Home Assistant and use that group's entity name for the light: option. If that doesn't solve it, then another thing you could try is to set the log level in appdaemon to DEBUG, so we can see at which point the app stops working.

maxscc commented 10 months ago

I'm also having an issue. This is my appdaemon yaml:

appdaemon: latitude: 52.379189 longitude: 4.899431 elevation: 2 time_zone: Europe/Amsterdam plugins: HASS: type: hass ha_url: http://homeassistant.local:8123 token: http: url: http://homeassistant.local:5050 admin: api: hadashboard: system_packages:

My apps.yaml: spotify_mood_lights_sync: module: spotify_mood_lights_sync class: SpotifyMoodLightsSync client_id: key client_secret: key media_player: media_player.spotify_useraccount light: light.lights constrain_input_boolean: input_boolean.spotify_mood_lights

Appdaemon shows SpotifyMoodLightsSync as loaded. I also see in the appdaemon logs: "{"event_type":"stream_connected","data":{"client_name":"Admin Client"},"namespace":"admin","time_received":"2023-12-01T17:36:43.090Z"}"

I do see this happening in appdaemon also: call_service default 12/1/2023, 3:11:40 PM
"{"event_type":"call_service","data":{"domain":"input_boolean","service":"turn_on","service_data":{"entity_id":"input_boolean.spotify_mood_lights"},"metadata":{"origin":"LOCAL","time_fired":"2023-12-01T20:11:40.808034+00:00","context":{"id":"01HGKG48W7KAQMWSB09N7FQQQA","parent_id":null,"user_id":"391e9387cd6e4a66bdbb758ea29bc802"}}},"namespace":"default","time_received":"2023-12-01T20:11:40.805Z"}"

NiklasReiche commented 9 months ago

Hi @maxscc, I don't see anything wrong in your configuration. If the app is loaded correctly, you should see INFO spotify_mood_lights_sync: App started. Listening on media_player.spotify_useraccount in your Appdeamon log. Also, note that the app does not switch on immediately after switching your input_boolean. To see the light change color, you'll have to wait until the next time that the spotify integration notices the track changing. Given that you don't see any errors or warnings in your appdaemon log, you could try adding log_level: DEBUG to the app config and see if any logs in the form of DEBUG spotify_mood_lights_sync: ... show up. That would at least tell us whether the app is making any progress. Note that the Appdaemon admin dashboard does not seem to show logs above level INFO, so you'd have to look at the logs elsewhere, depending on your setup (for the HA-addon version of Appdaemon this would be the log tab on the addon page in HA).