Spotify Playlist via Airplay in Home Assistant

Hi everyone! I’ve been exploring ways to integrate Spotify playlists with my Airplay speakers in Home Assistant. It’s been a fun journey, and I thought I’d share my experience in case anyone else is looking to do something similar.

First off, I have a setup with Ubuntu on my laptop running Home Assistant, and a few Airplay speakers around the house. I also use macOS Sierra with iTunes, though I’m slowly transitioning to newer systems. The goal was to play my Spotify playlists through these Airplay speakers without any hiccups.

I came across some components that allow controlling Airplay speakers and another for Spotify. The idea was to combine these to play Spotify playlists through Airplay. I started by setting up the Spotify component in Home Assistant, which was straightforward. Then, I looked into the Airplay integration, which also seemed manageable.

The challenge was figuring out how to bridge Spotify playlists to Airplay. I found that using a virtual media player in Home Assistant helped. By creating a template switch, I could trigger the playback of a specific Spotify playlist and route it to the desired Airplay speaker. It took some tweaking with automations to get everything seamless, but it’s working beautifully now!

One thing I learned is the importance of proper configuration files and understanding how variables work in templates. For instance, defining the correct Spotify URI and ensuring the Airplay device is properly recognized in Home Assistant were crucial steps.

I’d love to hear if anyone else has tackled this or has tips for improving the setup. It’s been a great way to enhance my home entertainment system, and I’m excited to see how this integration evolves with future updates to Home Assistant and Spotify’s API.

Cheers! :headphones: