Git Product home page Git Product logo

hass-music-assistant's Introduction

Music Assistant

latest version discord hacs sponsor

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favourite media to Home Assistant media players.

Introduction

Music Assistant is a music library manager for your offline and online music sources, combined with the power of Home Assistant to easily stream your favourite music to a wide range of supported players.

Music Assistant consists of multiple building blocks:

  • Music Assistant Server (2.0): the core part that runs the Music Assistant engine and keeps track of your Music sources. This will be installed automatically as an addon in HAOS when installing the Integration. Alternatively, you can manually install the addon in HAOS or install the server in a separate docker container.
  • Music Assistant integration for Home Assistant: Connects Home Assistant to your Music Assistant Server to automate your music!
  • Home Assistant Plugin for Music Assistant: Import Home Assistant media players into the Music Assistant engine to use as targets for playback.

Documentation

See here https://music-assistant.io

Installation of the Music Assistant Server

MA requires a 64bit Operating System and a minimum of 2GB of RAM on the physical device or the container (physical devices are recommended to have 4GB+ if they are running anything else)

Installation instructions are here https://music-assistant.io/installation/

Installation of the Home Assistant integration

See here https://music-assistant.io/integration/installation/

OpenAI features

During Chapter 5 of "Year of the Voice", JLo showed something he had been working on to use the OpenAI integration along with Music Assistant. We now have this feature baked in to the integration code directly, although some extra setup is still required.

See the instructions here https://music-assistant.io/integration/installation/#openai-features

I need help, I have feedback

  • Documentation
  • Issue tracker to create bug reports, please include detailed info and logfiles. Please check if your issue has already been reported.
  • Feature requests: Give your vote to an existing request, join the discussion or add a new request.
  • Q&A section Frequently asked questions and tutorials
  • Discord community Join the community and get support!

I want to help

See here https://music-assistant.io/help/

hass-music-assistant's People

Contributors

arretx avatar arsenicks avatar dasfuu avatar dependabot[bot] avatar dobby5 avatar erkr avatar gelokatil avatar github-actions[bot] avatar jacobswe avatar jesserockz avatar jhansche avatar jozefkruszynski avatar juan11perez avatar leandroissa avatar lukaszp2 avatar marcelveldt avatar marvinschenkel avatar nagyrobi avatar ozgav avatar robbert229 avatar sirs0ri avatar y-solo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-music-assistant's Issues

Playback doesn't actually start

My sole source is Spotify Premium atm. I can browse my favs and playlist just fine but no playback to any of my devices (Volumio, Sonos, Kodi, Samsung TV and various Echo Dot devices) actually starts. I can play and pause playback that's been added from a different source (such as Spotify app on my PC) but that's it (and the UI doesn't reflect that - it stays on what I picked to play from Music Assistant and the Play button stays on Play no matter when paused or playing).

I don't see anything relevant in log despite being set to "debug".

v1.0.15 - AttributeError: 'NoneType' object has no attribute 'to_dict'

Got this this error after a scan:

Logger: music_assistant.mass
Source: /usr/local/lib/python3.9/site-packages/music_assistant/mass.py:242
First occurred: 9:32:12 AM (1 occurrences)
Last logged: 9:32:12 AM

Job [Add filesystem://album/Fleetwood Mac to database] failed with error 'NoneType' object has no attribute 'to_dict'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 70, in add
    db_item = await self.add_db_item(item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 118, in add_db_item
    return await self.update_db_item(cur_item.item_id, album)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 189, in update_db_item
    "artist": json_serializer(ItemMapping.from_item(album_artist)),
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/media_items.py", line 260, in from_item
    return cls.from_dict(item.to_dict())
AttributeError: 'NoneType' object has no attribute 'to_dict'

[feature request] Send ICY metadata with audio stream

The audio stream is sent as raw audio stream (optionally encoded to flac or other codec) to a player.
This means that players with a small display do not show any metadata whats playing.

One of the solutions could be to implement ICY metadata but I'm not so sure if players do still request/support that.
I have checked a few players in my house (e.g. Chromecast) and None of them actually sent the ICY-Meta header but maybe I'm overlooking something.

If enough interest I can add this in but for now I consider this low prio.

Anyone interested in (re)acting to the metadata of MA can subscribe to the HA eventbus mass_event

Wrong play title

This happens in a scenario of first starting music on individual chrome-cast devices, and then overrule them by starting a group cast that includes the same devices.
When re-selecting one of the individual devices, the original title that was overruled is displayed

Error in log - Failed to retrieve artist-mb.php

Got this error after a scan

Logger: music_assistant.mass.audiodb
Source: /usr/local/lib/python3.9/site-packages/music_assistant/controllers/metadata/audiodb.py:268
First occurred: 9:33:55 AM (4 occurrences)
Last logged: 9:39:06 AM

Failed to retrieve artist-mb.php

Exception while doing nothing

No music playing, no CC's the network available. After just shortly opening the MA dashboard, this exception was logged:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/mass/__init__.py:162 
Integration: Music Assistant (documentation, issues) 
First occurred: 16:02:49 (2 occurrences) 
Last logged: 16:03:00

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/mass/__init__.py", line 109, in handle_hass_event
    await async_intercept_play_media(event, controls)
  File "/config/custom_components/mass/__init__.py", line 162, in async_intercept_play_media
    entity_id = event.data["service_data"]["entity_id"]
KeyError: 'entity_id'

AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'

Hi! I'm trying to make Hass Music Assistant to work on single mp3 file in a specific folder. The mp3 file is tagged with Song Title, Artist and Album. I have configured nothing as a music provider but filesystem provider and typed the folder containing that mp3 file. I get this error in the logs:

2022-05-10 09:31:43 ERROR (MainThread) [music_assistant.mass] Job [Library sync of tracks for provider Filesystem] failed with error 'NoneType' object has no attribute 'musicbrainz_id'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 397, in _library_items_sync
    db_item = await controller.add_db_item(prov_item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/tracks.py", line 145, in add_db_item
    or await self.mass.music.albums.add_db_item(track.album)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 121, in add_db_item
    if album.artist.musicbrainz_id and album.artist.provider != "database":
AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'

It came out that this was due to missing infos in the id3 tag. As a minimum requirement, it looks like that you need at least the following:

Song Title: SongTitle
Artist: ArtistName
Album: AlbumName
Track: 5
Year: 2022

so that it gets the proper musicbrainz_id. A software like MusicBrainz Picard could be used to properly tag the mp3s.

I did not find specific details in the docs, maybe this should be added :)

Music added from Albums or Artists don't play

After a bit of trial and error, I've seen that any music I try to play or add to the queue from the Albums or Artists won't play and no log errors are logged. I can only play music if I select from Tracks. The following screenshot shows the queue - any music starting with database:// was added from Tracks and will play fine - any starting with filesystem:// were added from Artists/Albums and wont play - you'll see that Hells Bells is listed in both - database:// will play and the others won't

Screen Shot 253

Play / Pause glitch

Now everything is roughly working, it's time for mentioning glitches. The play / pause button doesn't update when pressed:
image
When I refresh the page, it has the correct state again

Use a toggle entity as power control for a player

Add possibility to use a toggle entity (switch, light, input_boolean) as power control for a media player.
This allows for example the usecase to turn on/off an external amplifier etc. without the need to use a template media player.

Not really an issue

First my compliments for this great initiative! I was searching for a solution like this for a long time. That said I plumbed several items together to be able to cast Spotify playlists to any Chromecast.
Before installing music assistant, I would like to understand what are prerequisites and what needs to be replaced.
So I installed:

  • the official Spotify integration. Still Needed for music assistant, or will it conflict?
  • On top of that I installed the HACS SpotCast and Spotify playlist card. These become obsoleted I guess.
    Looking forward to start using your solution ๐Ÿฅณ

No navigate back button in Companion app (iOS)

Hi
A small glitch in the UI when using the iOS companion app. When I navigate into the music assistant dashboard, there is no menu button or left arrow to navigate back to the navigation bar (marked green):
image

When I open the same dashboard via the media browser, there is a left arrow to navigate back:
image

Local files not found

Hi, i have my music, properly tagged in /config/media yet its not found in MA
any ideas what i'm doing wrong ?
Thanks in advance

Can't configure

Hi

Can't configure Music Assistant. So I stripped my settings to just one Chromecast:
image

And then only my Spotify account:
image

After applying these settings:
image

But the integration has an error:
image

Don't see hints in the logfile. Reload doesn't help.
Probably something I missed.
Eric

[feature request] Integration with Alexa Media Player?

Trying to play music from Spotify to my Alexa devices, which are set as media devices using Alexa Media Player. Alexa gives an error stating that the proper service calls must be made.

If this could be integrated in some way, it would be a game changer for playing music via HA. Happy to test anything as needed.

Casting intermittently stopped

I'm casting a Spotify playlist to a Chromecast group. Works great!! But intermittently the Music stops (happens once in the few hours / few times per day).
Just pressing play and everything resumes. When it happens I see a Google Cast error in the log:

Logger: homeassistant.components.cast.media_player
Source: components/cast/media_player.py:388
Integration: Google Cast (documentation, issues)
First occurred: 20:21:01 (1 occurrences)
Last logged: 20:21:01

Failed to cast media http://192.168.178.47:8095/media_player.everywhere_57.flac. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

The error itself probably is unavoidable, but maybe a retry can be done when it happens.
Best
Eric

Players lost when re-opening the configurator

Hi

Reopened the configurator (to add the local files option) and notices that my previous selection of players seems lost:
image

Note 1: At the moment of configuring these players where not avaliable
Note 2: I checked the Core.config_entries after re-adding them and they where added properly (no doubles):

                    "player_entities": [
                        "media_player.audio57keuken",
                        "media_player.audio57woonkmr",
                        "media_player.audio57serre",
                        "media_player.everywhere_57"

Best Eric

Parsing local files stopped after a few minutes

I have a large local collection and just configured them in. The parsing stopped after ca 2 minutes with these errors:
image
Clearly my ID3 tags are not fit to import (many files skipped). But here the detailed log:

...
2022-05-10 11:00:55 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Type O Negative/Type o negative - Out of fire.mp3
2022-05-10 11:01:07 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Behemoth/2004 -Demigod/01 - Behemoth - Sculpting the throne ov Seth.mp3
2022-05-10 11:01:07 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Behemoth/2004 -Demigod/01 - Behemoth - Sculpting the throne ov Seth.mp3
2022-05-10 11:01:07 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Behemoth/2004 -Demigod/01 - Behemoth - Sculpting the throne ov Seth.mp3
2022-05-10 11:01:25 ERROR (MainThread) [music_assistant.mass] Job [Library sync of albums for provider Filesystem] failed with error 'NoneType' object has no attribute 'musicbrainz_id'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 397, in _library_items_sync
    db_item = await controller.add_db_item(prov_item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 121, in add_db_item
    if album.artist.musicbrainz_id and album.artist.provider != "database":
AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'
2022-05-10 11:01:25 ERROR (MainThread) [music_assistant.mass] Job [Library sync of tracks for provider Filesystem] failed with error 'NoneType' object has no attribute 'musicbrainz_id'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 397, in _library_items_sync
    db_item = await controller.add_db_item(prov_item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/tracks.py", line 145, in add_db_item
    or await self.mass.music.albums.add_db_item(track.album)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 121, in add_db_item
    if album.artist.musicbrainz_id and album.artist.provider != "database":
AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'
2022-05-10 11:01:26 WARNING (MainThread) [music_assistant.mass.metadata] Unable to get musicbrainz ID for artist Madonna !
2022-05-10 11:01:30 WARNING (MainThread) [music_assistant.mass.metadata] Unable to get musicbrainz ID for artist Original Soundtrack !
2022-05-10 11:01:36 WARNING (MainThread) [music_assistant.mass.metadata] Unable to get musicbrainz ID for artist  !
2022-05-10 11:01:36 ERROR (MainThread) [music_assistant.mass.audiodb] Failed to retrieve artist-mb.php
2022-05-10 11:01:36 ERROR (MainThread) [music_assistant.mass] Job [Library sync of artists for provider Filesystem] failed with error .
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 390, in _library_items_sync
    db_item = await controller.get(
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/media_controller.py", line 68, in get
    return await self.add(details)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/artists.py", line 67, in add
    db_item = await self.add_db_item(item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/artists.py", line 120, in add_db_item
    assert artist.musicbrainz_id
AssertionError

[feature request] Show metadata on target player

Thank you for this wonderful integration.

I'm the maintainer of the linkplay media player component.

One thing I notice is that the target media player (the one really playing out the media) doesn't show any metadata (from Spotify). So for example:

  • go to lovelace, where you have a (physical) media player entity (eg. media_player.hang_up2stream)
  • go to media browser selection
  • choose Music Assistant
  • choose Playlists: you can see all metadata appears at this level, tracks info and coverart etc
  • select a playlist, press play
  • playback starts on the media player, but no metadata is being shown
  • also metadata is missing on the auxiliary media_player.mass_hang_up2stream

Usually linkplay devices provide some metadata via UPnP so when such information is available I parse it and import it. From Media Browser local files I just parse for "Artist - Title.ext" and if that matches I also grab cover from Last.FM. For Icecast radio streams, I look for ICY-Meta in the headers of the stream.

Is there a way I could fetch rich metadata from music assistant? Or should I provide a service for you to push metadata in (would be more accurate and less stressful)?

Error Trying to play stream

I only have tune-in playlists enabled, and they populated fine, but trying to play any of them results in nothing happening. The following is found in the logs:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/mass/websockets.py:947
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:18:06 AM (1 occurrences)
Last logged: 11:18:06 AM

[140192534498800] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/mass/websockets.py", line 90, in async_get_mass_func
    await orig_func(hass, connection, msg, mass)
  File "/config/custom_components/mass/websockets.py", line 947, in websocket_play_media
    await player_queue.play_media(msg[URI], msg[COMMAND])
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/player_queue.py", line 416, in play_media
    media_item = await self.mass.music.get_item_by_uri(uri)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 160, in get_item_by_uri
    return await self.get_item(
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 174, in get_item
    return await ctrl.get(
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/media_controller.py", line 66, in get
    details = await self.get_provider_item(provider_item_id, provider_id)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/media_controller.py", line 179, in get_provider_item
    item = await provider.get_item(self.media_type, item_id)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/provider.py", line 193, in get_item
    return await self.get_radio(prov_item_id)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/providers/tunein.py", line 90, in get_radio
    return await self._parse_radio(item, stream)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/providers/tunein.py", line 124, in _parse_radio
    radio.sort_name = details["preset_number"]
KeyError: 'preset_number'

add Web Browser as a Player entity

The native Media browser has the ability to play media files on the actual device (iPad,iPhone,PC etc) that Home Assistant is being displayed on as can be seen in this screenshot:

Image 006

It would be great if MA was also able to use the Web browser option

v1.0.15 - after a restart of HA, I've lost Albums and Artists in list

After upgrading to v1.0.15 I let the scan finish and it found 355 Albums and 18 Artists.

I restarted HA about an hour after the initial scan finished and I now only have 2 Artists and 25 Albums listed - a rescan is also underway so potentially the "missing" ones will be rediscovered? Wondering why they were lost?

Was:
Image 008

Now:
Image 015

Errors in log when casting to a Chrome Cast group?!

I started a Cast to a Chromecast group (everywhere) . That works!, But I noticed these loggings:
image

2022-05-08 11:13:16 INFO (MainThread) [music_assistant.mass] Finished job [Analyze audio for spotify://track/6D1i1hoMyjs843XbMhNq8J] in 6.85 seconds.
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:14 ERROR (MainThread) [frontend.js.latest.202205040] http://ha57:8123/lib/mass/mass.iife.js:54:128759 Uncaught TypeError: Cannot convert undefined or null to object
2022-05-08 11:14:22 ERROR (Thread-13) [pychromecast.socket_client] [Everywhere_57(192.168.178.142):32034] Error reading from socket.
2022-05-08 11:14:22 WARNING (Thread-13) [pychromecast.socket_client] [Everywhere_57(192.168.178.142):32034] Error communicating with socket, resetting connection
2022-05-08 11:14:23 DEBUG (MainThread) [music_assistant.mass.stream] Finished Streaming queue track: ea837a5e-f12b-4c70-937a-073cb5e49e63 (Crimson Sun - Feed the Fire) on queue Audio57keuken

Errors in filesystem music provider

I'm seeing this error when adding a local library via the Enable filesystem provider tick box - the files have correct ID3 Tags and I'm using the directory /media which contains my .mp3 files. Here's the error log.

Logger: music_assistant.mass
Source: /usr/local/lib/python3.9/site-packages/music_assistant/mass.py:242
First occurred: 8:53:36 PM (9 occurrences)
Last logged: 9:51:18 PM

Job [Library sync of artists for provider Filesystem] failed with error argument of type 'NoneType' is not iterable.
Job [Library sync of albums for provider Filesystem] failed with error argument of type 'NoneType' is not iterable.
Job [Library sync of tracks for provider Filesystem] failed with error argument of type 'NoneType' is not iterable.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 380, in _library_items_sync
    for prov_item in await music_provider.get_library_items(media_type):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/provider.py", line 172, in get_library_items
    return await self.get_library_artists()
  File "/usr/local/lib/python3.9/site-packages/music_assistant/providers/filesystem.py", line 124, in get_library_artists
    for track in await self.get_library_tracks(False):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/providers/filesystem.py", line 152, in get_library_tracks
    if track := await self._parse_track(filename):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/providers/filesystem.py", line 307, in _parse_track
    name, version = parse_title_and_version(tag.title)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/helpers/util.py", line 90, in parse_title_and_version
    if splitter in title:
TypeError: argument of type 'NoneType' is not iterable

Radio stations already sorted by name

Small feature request: The radio list retrieved from TuneIn is always sorted by name, and the menu option to sort by name can not be deselected either. I would like to add the option to select the original order as provided by TuneIn.
image
By the way, I'm impressed wrt the functional completeness of this new integration. You clearly polished it before releasing ๐Ÿ‘

Cannot find media files on directory

What is the path structure required to find media files on disk? I keep getting message "Retrying setup: Setup failed of provider filesystem: Music Directory does not exist.
Do the files have to be located in the HA instance or can I play from Network?

port 8095 is already used

Retrying setup: [Errno 98] error while attempting to bind on address ('::', 8095, 0, 0): address already in use

Can we set another port in configuration?

Fix playback to Airplay devices

The current state of the atv integration in HA is that it won't stream audio to Airplay speakers.
An official ATV 4K does work (sometimes) and Homepod is hit and miss.

Maybe we can fix something to send the stream directly to the pyatv library because MA is using a raw PCM stream internally.

Group stops playing when one CC is powered off

Hi.
I have configured 3 CC's as a group 'everywhere'.
Starting a Cast to the group, while one of the CC's is powered on afterwards, works great (automatically starts playing as well)
Powering off of one of the CC's interrupts the CAST with this error:

Logger: pychromecast.socket_client
Source: /usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py:396 
First occurred: 20:49:05 (2 occurrences) 
Last logged: 21:18:15

[Everywhere_57([::ffff:c0a8:b220]):32034] Failed to connect to service ServiceInfo(type='host', data=('[::ffff:c0a8:b220]', 32034)), retrying in 5.0s
[Audio57Serre([::ffff:c0a8:b220]):8009] Failed to connect to service ServiceInfo(type='host', data=('[::ffff:c0a8:b220]', 8009)), retrying in 5.0s

Definitely an edge case ๐Ÿค”,
Best
Eric

Syntax error in mass.umd.js

This looks great and I'd love to try it out! I installed via HACS but see the following in the Chrome console when I go to the Music Assistant tab, and the frame is just white:

Uncaught SyntaxError: Unexpected token '}' mass.umd.js:formatted:55

Because that file is generated / minified, I'm having some trouble correcting this error.

Config flow could not be loaded: undefined

Having installed the Music Assistant I get no errors on installation and it finds numerous devices and entities... However, I am unable to adjust the configuration without removing and reinstalling as I get the following error message:

Error
Config flow could not be loaded: undefined

Any help would be gratefully received.

v1.0.15 - Artists not fully populated

I'm seeing strange behaviour with v1.0.15.

I only have 15 Artists listed, all starting with Letter A, one starting with letter B and one with letter E. If I look at Albums, I have 355 and the Artists names are all listed, but these artists don't appear in the Artists list. Screen shots:

Image 007
Image 008

Error importing music

I've got my music folder loaded (it's on a network share mapped to /music/media) in Home Assistant. I am able to see everything in Media in HA and play on my Google Home speakers, which I have a couple (not my echo's though, will deal with that issue later). When I load Music Assistant it does not pick up anything. The errors from my logs are below:
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:46 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:46 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:46 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:46 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:47 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:48 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:48 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:49 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
2022-05-09 05:59:49 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 334, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"

Use HA theme colors in custom panel

It should be possible to use all colors from the selected HA theme.
At this time only dark/light mode is derived from HA colors and the color of the topbar.

Configuration doesn't reload after making changes

Hi

When rerunning the configuration the integration crashed (After a restart it works again!):

2022-05-07 22:12:58 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Music Assistant for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 395, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2022-05-07 22:12:58 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Music Assistant for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 87, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2022-05-07 22:12:58 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Music Assistant for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 87, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2022-05-07 22:12:58 INFO (MainThread) [music_assistant.mass] Stop called, cleaning up...
2022-05-07 22:12:58 INFO (MainThread) [music_assistant.mass.stream] Streamserver exited.

Error installing

Just tried to install this integration, but I get an error right off the bat. I only enabled Tune-in.

Here is the trace from HA logs:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/mass/__init__.py:57
Integration: Music Assistant (documentation, issues)
First occurred: 6:38:38 PM (2 occurrences)
Last logged: 6:44:00 PM

Error setting up entry Music Assistant for mass
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/mass/__init__.py", line 89, in async_setup_entry
    raise exc
  File "/config/custom_components/mass/__init__.py", line 57, in async_setup_entry
    await mass.setup()
  File "/usr/local/lib/python3.9/site-packages/music_assistant/mass.py", line 80, in setup
    await self.database.setup()
  File "/usr/local/lib/python3.9/site-packages/music_assistant/helpers/database.py", line 46, in setup
    await self._migrate()
  File "/usr/local/lib/python3.9/site-packages/music_assistant/helpers/database.py", line 158, in _migrate
    prev_version = int(prev_version["value"])
TypeError: 'NoneType' object is not subscriptable

Just 19 artists detected

I only have local files. Folders with flac files. (Structure: /Artist/Album). These flac files, are tagged with the name of the artist, name of the track, album, number of the track, year of publishing, etc.

Of all the folders I have, only 19 artists are detected. No albums, no songs in the default view. If I zoom on the artist, I see some tracks in the album view, but only with the album name, instead of the track title.

FolderViewMedia
DetectedFirstScreen
Detected Artists
Toptracks
Albums

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.