muckelba / dynamic-lights-homeassistant

💡 Spicetify extension that changes Home Assistant lights based on the album cover color
16 stars 0 forks source link
home-assistant spicetify spicetify-extensions

Dynamic Lights Home Assistant

A Spicetify extension that dynamically sets your RGB lights to match the current album cover color using Home Assistant.

Demo

A GIF showing the color change of a lamp in realtime The settings screen

Prerequisites

Setup Instructions

1. Home Assistant Configuration

  1. Create a new automation in Home Assistant
  2. Add a webhook trigger
  3. Copy the Webhook ID (you'll need this later)
  4. (Optional) Click on the cog icon on the right and uncheck the "Only accessible from the local network" option when using some external proxy (e.g. Nabu Casa Cloud or cloudflared)
  5. (Optional) Add conditions (e.g., only run 2 hours before sunset)
  6. Add a Light: Turn on action
  7. Select your light entities
  8. Switch to the YAML editor (click the three dots)
  9. Paste the following code:

    data:
     rgb_color: "{{trigger.json.rgb}}"

[!NOTE]

  • You can modify the automation, but ensure you keep the "{{trigger.json.rgb}}" string intact.
  • Have a look at automation-example.yaml for a full automation example.
  • When using Yeelight lamps, you may want to enable their music mode.

2. Spicetify Extension Installation

  1. Install the extension using the Spicetify Marketplace
  2. Configure the extension:
    • Click on your profile picture in the top right corner
    • Choose "Home Assistant Settings"
    • Fill in the required information:
      • Home Assistant URL: Your full Home Assistant URL (must start with http:// or https://)
      • Webhook ID: The ID you copied from the Home Assistant automation