How to set up and use Music Assistant for Home Assistant

Disclosure: This post contains affiliate links. If you click through and make a purchase, I’ll earn a commission, at no additional cost to you. Read my full disclosure here.
Advertisement

Music Assistant, a relatively new application that was written for Home Assistant, was broadly announced during the Let’s get loud! stream, earlier this month. While it is a completely separate project from Home Assistant, I can see it becoming one of the most popular third-party services that integrates tightly with it.

Advertisement

Table of Contents

Music Assistant is more than just an extension or custom component

Even though you will find Music Assistant listed as an integration in the Home Assistant Community Store (HACS), it is so much more. First off, you have the Music Assistant integration for Home Assistant. This is the core of the app that runs the engine and keeps track of your sources for music (e.g., Spotify or local files).

Next, it will import any compatible media players you might already have configured in Home Assistant and lets you target them for playback. In reverse, you can use the imported media players in the Home Assistant for media playback and rich metadata in your Dashboard.

Advertisement

As if that weren’t enough, Music Assistant also integrates with Home Assistant’s native Media panel, and it has its very own user interface. This interface provides many more features compared to what is natively available in Home Assistant.

Adding Music Assistant to Home Assistant

With all the components I just mentioned, you might be worried that Music Assistant is an add-on and won’t be compatible with any other systems but those running Home Assistant OS. But fret not, you install Music Assistant using HACS, and it will run on any system. I am running Home Assistant Core in a Docker container on Unraid and can run Music Assistant without any issues.

Advertisement

Music Assistant is available in HACS without having to add any custom repositories. Simply search for it in the integrations section, and you will find what you are looking for. Once installed and Home Assistant restarted, you will need to add it as an integration in the appropriate settings.

A screenshot showing Music Assistant in HACS
Music Assistant in HACS
A screenshot showing how Music Assistant can be integrated with Home Assistant
Adding the Music Assistant integration to Home Assistant
A screenshot showing various Home Assistant media players being added to Music Assistant
Adding media players to music assistant

Once you add the integration, you are guided through the configuration, where you will first have to select which media players you want to import. Music Assistant will automatically prevent you from selecting any incompatible or broken entities.

Advertisement

Which media players are compatible with Music Assistant?

Theoretically, Music Assistant supports every media player that integrates with Home Assistant and can play media from a URL. Practically, however, not all media players implement the play_media service equally. As Music Assistant becomes more ubiquitous, code workarounds should start appearing. So far, MusicAssistant supports the following media players, as confirmed by developers and users:

  • Anything that uses Google Cast (RIP Chromecast Audio)
  • Squeezebox players that integrate using SlimProto or Logitech Media Server (LMS)
  • Sonos media players and those that integrate with the service (e.g., IKEA SYMFONISK)
  • Audio devices based on Linkplay A31
  • Speakers in the Bose SoundTouch family
  • DLNA enabled TVs or radios which use the DLNA Digital Media Renderer

When using Music Assistant, which media players should be avoided (for now)?

Unfortunately, Music Assistant, through no fault of its own, doesn’t support some very popular media players. Most notably, Amazon Echo and other players with integrated Alexa support do not play music from URLs. There is hope, though, as the Matter connectivity standard might adopt media players. As of now, there is no way of making Music Assistant play nicely with Alexa.

Furthermore, Apple AirPlay compatible devices are currently unsupported. This includes the Apple TV and Apple HomePod.

Advertisement

Which music services does Music Assistant support?

Currently, Music Assistant supports the following music services, with upcoming support for both Tidal and Deezer already announced.

  • Spotify Premium
  • Qobuz
  • Tune-In Radio
  • Locally stored files

The locally stored files, do need to be stored – or be accessible – locally. Music Assistant does not support mounting shares directly. I have solved this by mounting my media folder as a Docker mount. That way, Music Assistant sees the files as local files, despite them being located in another folder.

As of now, Music Assistant will only import and display items that are in your library, i.e., those that you have marked as favourites. A feature that will let you browse a streaming service’s recommendations is planned for a future release.

Music Assistant can’t import services already integrated with Home Assistant. For example, if you have the Spotify integration already set up, you will need to add your credentials again during the configuration of Music Assistant. This is unlikely to change anytime soon, as the Spotify integration with Home Assistant acts as a media player, and won’t import your library.

A screenshot showing the configuration of Spotify and TuneIn in Music Assistant

Hiding source players and creating media players for Music Assistant

A screenshot showing Music Assistant's advanced options: One setting allows the user to hide source players in the  Home Assistant Dashboard. The other setting allows the user to have Music Assistant create media players from those already configured in Home Assistant.
New users should leave the advanced settings in their default position

The final step is to choose which advanced settings you want to enable or disable. I suggest leaving these settings enabled, as they are by default. Let’s go through these options, as it will help you understand Music Assistant somewhat better:

Music Assistant needs to create its own media players to be able to function. In my setup, I have added my Squeezebox, which is integrated with Home Assistant using the Logitech Media Player integration. This integration created the entity media_player.squeezebox. As Music Assistant can’t use this entity to its full potential, it creates a new one called media_player.mass_squeezebox. Using the option to hide source players in the Home Assistant Dashboard, you can keep things cleaner and reduce mistakes.

If you intend to use Music Assistant for your media needs, you will want to add its media players to the dashboard, and not the source media player. In the screenshot below, you can see both the Music Assistant media player (top), and the source media player (bottom). The source player only presents basic controls, and shows the track info as ‘Streaming from Music Assistant’. The Music Assistant media player gives you full control, and shows the track and artist, alongside the cover art of the track playing (Lisa by Kaufmann).

The Home Assistant Dashboard displaying the Media Assistant player (top) and source player (bottom)
The Home Assistant Dashboard displaying the Music Assistant player (top) and source player (bottom)

If you want your Home Assistant Dashboard to continue looking good after setting up Music Assistant, make sure you adjust the displayed entities.

Using the Music Assistant interface

In its current state, the Music Assistant definitely opts for form over function. This is one area I hope to see improved over the coming months, as I’m sure many users would want to use it on wall-mounted tablets. Upon opening up Music Assistant, which places a link in the Home Assistant Sidebar, you will be able to select between artists, albums, tracks, playlists, or radio.

The latter will import any radio stations you have marked as favourites in TuneIn, assuming you have set it up during the configuration. Currently, Music Assistant does not import any radio stations from Home Assistant’s media browser.

The main interface of Music Assistant allowing the user to select between artists, albums, tracks, playlists, and radio.
Music Assistant’s main interface

The real magic happens once you delve into an artist and see how Music Assistant handles multiple sources. Instead of displaying duplicates, Music Assistant will merge any libraries you configured. In the example below, I have the Arctic Monkeys both in my Spotify library, and I have ripped a CD and stored the files locally. An icon indicates the source for each track. The system relies on the ID3 tags stored in the music file, so if these aren’t set up correctly, you are going to have a bad time. I can recommend the application Mp3tag for your ID3 tag editing needs.

A list containing songs by the Arctic Monkeys being shown in Music Assistant
Music Assistant will automatically merge multiple libraries

From here, you can start playing any artist, album, or track. What you can also do is use Music Assistant as a jukebox, by adding various items to your queue. It is worth noting that Music Assistant will automatically pick the highest quality track. So if not all of your local files are showing, it is because they are of lesser quality to what is available online.

Using Music Assistant entities in automations and scripts

You can use any media player created by Music Assistant as you would use any other media player. It supports the media_player.play_media and you have the same options to play your media immediately, or queuing it.

The play_media service in Home Assistant being used by a Music Assistant media player.

Music Assistants enables text to speech TTS without stopping the music

One of my favourite features of Music Assistant is its ability to use text to speech without stopping the music. There have been various scripts and apps that try to make this possible, but none are as clean and easy as Music Assistant.

For this to work, you will need to use the media player created by Music Assistant. If you use the source media player, this will not work. You can use whichever provider is your favourite, have the speaker stop the music, say whatever you told it to say, and then continue your queue from where it left off.

Music Assistant conclusion: One to look out for

While Music Assistant greatly enhances the music capabilities of Home Assistant, it isn’t for everyone. At least not yet. There is still some work to be done, especially when it comes to the interface. It still looks and behaves very much like a nerd’s tool, and not something you’d show off on a wall-mounted display or tablet.

On the one hand, if all you do is occasionally play playlists or albums using scripts or automations, there is no real need to install Music Assistant. After all, you would have to adjust all your scripts and automations to include the Music Assistant’s media player. On the other hand, if you also use text to speech (TTS) in those scripts/automations, Music Assistant does enable seamless continuation of your music, after it has made the announcement. Moreover, if you want to easily start music playback directly from Home Assistant, without having to copy URLs, Music Assistant makes the process hassle-free.

If you are looking to play local media on your network-attached speakers, then Music Assistant is a must for you. I am aware that various applications that will let you cast local media exist, but none of them support other devices I own (e.g., my old Squeezebox).

As I already mentioned, I can see Music Assistant becoming a central part of many Home Assistant users’ setup. This application already boasts some impressive feats, and I can’t wait to see what the future hold.

Philips finally offers a remote featuring a dial (and more!)

room-assistant isn’t dead, but looking for a maintainer

Advertisement
Liam Alexander Colman, the author and maintainer of Home Assistant Guides.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started off with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system, and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

2 thoughts on “How to set up and use Music Assistant for Home Assistant”

  1. hi,

    can Music Assistant ‘see’ DLNA Music sources, Home assistant introduced support and all my music files are visible via DLNA

    thanks in advance

    Darren

    Reply
    • Hi there. Music Assistant can indeed play to DLNA music sources. I just tested this with an old alarm clock. However, the controls did start acting up after some time. I can’t say who’s fault that is.

      Reply

Leave a Reply to darren hopkins Cancel reply

Advertisement
Share to...