Music Assistant and Home Assistant: Get config_entry_id

I’m running Music Assistant and Home Assistant to manage my smart home, automations and music playback at home. Both systems integrate nicely with each other through various integrations. I can press a button on a light switch and make Home Assistant turn on a smart outlet, some lights and play music from Spotify, Apple Music, YouTube Music, or even files from my local file system on my Sonos speakers. That’s great!
I just always had a hard time finding the right URI or address to include in my automations to trigger the right album or playlist to be sent from Home Assistant to Music Assistant.
Here is some more information about how to get the URI.
Search Music Assistant from Home Assistant
When you open the Developer Tools => Actions menu in Home Assistant, you can select an action called Music Assistant: Search Music Assistant. You can pre-fill this with some information, for example:
action: music_assistant.search
data:
name: Down Under
artist: Men at Work
limit: 25
library_only: true
It’ll then complain that the config_entry_id is missing. This information was a bit hard to find.
Get Music Assistant config_entry_id
In Home Assistant, open the Music Assistant integration, click on the devices or entities link, and then you’ll find the config_entry_id in your browser’s address bar. You can then plug the config ID into your Music Assistant Developer Actions to interact with Music Assistant, like so:
action: music_assistant.search
data:
config_entry_id: 01JEfoobarbaz
name: Down Under
artist: Men at Work
limit: 25
library_only: true


