I have a collection of automations, scripts and python that is currently working well on my HA/MA setup. I’m considering turning it into a HACS integration if there’s interest.
The way it works is that you define “stations” with a prompt something like this:
“Classic Rock Foundations”: “Generate a playlist of classic rock songs from artists such as The Beatles, The Rolling Stones, The Kinks, Led Zeppelin, The Doors, Jefferson Airplane, Jimi Hendrix, The Byrds, The Animals, Steve Miller Band, The Who, The Zombies, Tom Petty, Van Morrison, Warren Zevon, Grand Funk Railroad, Free, Santana, Cream, Crosby Stills & Nash, The Eagles. Include similar songs and artists that fit the classic rock foundation style.”
It will generate an initial playlist and then call music_assistant.play_media which will match the track against your providers. It monitors the queue and reloads new tracks as it gets low, with deduping for a configurable number of tracks in history. I originally used “don’t stop the music”, but found for more niche stations it tended to drift and have more dups.
I have about 30 different prompts and have been using using this with my own library and Apple Music for several months and tweaking it along the way. It’s pretty solid for me at least, it’s been a fun way to expand my music listening too. If there’s interest I’ll see about making it a HACS integration. If not, I’ll just keep listening…
I assume you mean for if you’re using assist without an LLM …and you want the richness of an LLM response for different music and mixes etc? (totally see that use case)
(because an agent operating the MA LLM scripts can already do this…)
AI-powered playlist generation for Home Assistant + Music Assistant.
Uses any AI Task provider (Anthropic, OpenAI, Google, Ollama, etc.) to generate tracks based on text prompts, enqueue them on Music Assistant speakers, and automatically refill as you listen.
AI Assisted
Full disclosure, although this was originally a set of scripts, automations and pyscript I wrote myself, in it’s current form it’s probably 80% AI coded using Claude Code.
Prerequisites
Home Assistant 2025.8+ (required for AI Task integration)
I’m mostly using it with dashboards and scene controllers, not assist. I wanted more than just artists/albums and broad genres, and it didn’t seem like anything existing offered that when I started down this path. I think it’s a different approach than MA LLM, but maybe I didn’t dig deep enough when looking for what I wanted.