Media Player platform for Mopidy

Tags: #<Tag:0x00007fc405206fb8>

I created a Mopidy platform integration for media_player, and I thought I’d share it with the world.

Feel free to try, it should be quite stable.
Feedback and requests are welcome.

Once I’m happy, I’d like to get it into home assistant core.

Here’s the URL:
https://github.com/bushvin/hass-integrations

Currenlty supports integration autodetection (zeroconf), integration configuration and manual configuration.
Version: 1.4.0

10 Likes

good work… what is difference between this and the mpd platform?

  • native mopidy
  • media browser

That sounds great! Especially the media browser!
Will try it as soon as possible.

Hi,

Installed, tested, approved. It works very well and it’s just what I was expecting for my multi-room audio system. I was using a panel-iframe with Iris and Spotify, it will replace it.
The only missing thing is the search function.
Hope this will receive official support.

2 Likes

You are too kind!
Much appreciated!

Dunno about the search, but I’ll look into it

This works great so far, that’s awesome. Going to add this to my multiroom control dashboard, now that Media Browser is supported.

Should album art be shown in the media player created in HA? I don’t have any album art yet in Mopidy, just wondering if it should show up.

I haven’t tested all mopidy extensions yet, so your mileage may vary.

Tested extensions:

  • dleyna
  • Spotify
  • TuneIn
  • Podcasts (not iTunes)

Should I see artwork with Spotify? I don’t see anything.

Yes.

Can you tell me which browser, what your hass setup is?

On mine, I can see the artworks when playing Spotify.

I think this is on mopidy side, but I can’t see my Spotify playlists or artists in the browser. Only the albums and tracks.

I just noticed that I also don’t seeit on mopidy side, will check that first. At least I know that it should be working :slight_smile:

I just did some troubleshooting, and it does seem like a limit on Mopidy’s side. Probably the API.

I believe I know what to do, but evening, kids to feed, etc…

I actually think it is a Spotify throtling issue…

My Mopidy server has this error:

Jan 09 17:28:54 figrindan mopidy[4477]: ERROR    [SpotifyBackend-6] mopidy_spotify.web Spotify Web API request failed: {'status': 400, 'message': 'too many ids requested'}

I fixed it. Pull an update from my git project.

Happy hunting!

Thanks for helping me with pointers, btw…

I discovered why this happens, and fixed it.
The URL for the images is relative to the mopidy server, not HA, which caused them not to be loaded.

The fix I implemented only works when browsing your library from the same network your mopidy server is in: It will prefix the url with http://<mopidy server>:<mopidy port>. This will not work when you access hass from the internet.
If anybody knows if there’s a way to cache or proxy images through HA, I’d like to know.

That sounds great! Will test as soon as possible.

Thx for this platform, which I’d love to replace my current MPD mediaplayer integration with.
Please allow me one remark: contrary to other/most mediaplayer platforms, it seems impossible to be switched ‘off’, but remains in ‘idle’ state when not playing. As the MPD player acts normally in this respect, this is probably not due to restrictions imposed by the underlying mopidy server ?

And whilst we’re at it: would you see fit to include the ‘source_list’ feature, which most other mediaplayers have - including the MPD player ? Thanks for considering …

1 Like

I’m using HA 2021.1 in docker installation.
I install mopidy component in <config dir>/custom_components/ but when I restart HA I have this error

ERROR (MainThread) [homeassistant.components.homeassistant] Platform error media_player.mopidy - No module named 'mopidyapi'

Mopidy is running in a different raspberryPi

Hi Paul,

Thanks you for your interest in the platform.
There was a reason why I kept it in Idle, that was before I implemented the Library. Maybe it’s time to get rid of that. I will see what is possible here.

I will have a look at the source_list feature. I don’t understand it’s meaning at this point in time.
I will definitely have a look at what MPD provides as source_list. Or if anyone can provide a pointer, I would be grateful.

RIght now I’m overhauling the media library integration, as there are serious gaps due to my lack of understaning and documentation of the python classes, but I think I’m almost there.

Keep an eye open!