Change your rgb lights color according to spotify album background

I provided you with some totally erroneous information in my last post, it isn’t automation-driven at all.

This is the condition of my apps.yaml in appdaemon:

tv_lights_sync:
    module: tv_lights_sync
    class: tv_lights_sync
    ha_url: http://hassio/homeassistant
    media_player: "media_player.spotify"
    photo_attribute: "entity_picture"
    condition:
        entity: sensor.living_room_shield_tv_app_name
        state: "Spotify"
    lights:
      - "light.hue_lightstrip"
      - "light.nanoleaf"
      - "light.living_room_lamps"
      - "light.drinks_shelf"
      - "light.kitchen_floor"
      - "light.death_ball"
      - "light.lounge_ceiling_spots"

The sensor in the condition is as follows:

        living_room_shield_tv_app_name:
            value_template: "{{ state_attr('media_player.living_room_shield_tv', 'app_name') }}"
            friendly_name: Living Room Shield TV App Name

So basically when the Living Room Shield TV is playing the Spotify app, those lights specified will change colour. I honestly thought I’d updated this to include the sun’s horizon position… obviously not!

I’ll have a go at this later and report back.

This is mine and it doesn’t seem to work do you know why? if I turn off the input_boolean it still changes the colours

tv_lights_sync:
  module: tv_lights_sync
  class: tv_lights_sync
  ha_url: http://hassio/homeassistant
  media_player: "media_player.small_tv"
  condition: 
  entity: "input_boolean.album_art_sync"
  state: "on"
  lights:
    - "light.hue_color_lamp_1"
    - "light.led_strip_bed"
    - "light.led_strip_bench"
    - "light.desk_light"

All looks OK, except for the indentation of entity and state in `condition. Try fixing that first.

you are right, should have seen that. it works now

It’s often the simplest things, and it usually just takes a second pair of eyes to notice it. Glad it’s all working for you again.

1 Like

@Luukotje Following a recent upgrade, the AppDaemon was refusing to startup for me due to a problem resolving one of the dependencies. I took the opportunity to finally go through them and remove the ones that were no longer required. I can confirm that the following config works and resolves the latest issue:

{
  "disable_auto_token": false,
  "system_packages": [
    "libjpeg",
    "tiff"
  ],
  "python_packages": [
    "pip",
    "Pillow"
  ]
}

nice, thank you for keeping me up to date I will test it very soon.

Has anyone gotten this to work recently? Now all I can get is:

“FATAL: Failed installing package pillow”

For anyone else having trouble I got this working with the following setup:

{
  "disable_auto_token": false,
  "system_packages": [
    "libcurl",
    "zlib-dev",
    "libjpeg-turbo-dev",
    "libwebp",
    "tk",
    "openjpeg",
    "python3-dev",
    "curl-dev",
    "gcc",
    "g++"
  ],
  "python_packages": [
    "pip==19.0.3",
    "pycurl",
    "Pillow"
  ],
  "init_commands": [],
  "log_level": "info"
}

Like some past setups I’m sure there are unnecessary things in there but I mostly just stole the list from here.

Hey, thanks for your work.

I tried to add it on my install, and I have noticed I get the following error :

Any idea?

Thanks!

I’m getting an error when trying to use this… The service is “not found”.

I’ve added the __init__.py in a folder called color_recognizer, and added color_recognizer: to my configuration.yaml… Am I missing something?