Pi audio component

The VM is running HA OS so I’m hoping it works like the Pi. Anyway, I managed to get output on the VM, but only using the file:// prefix. Have I missed something?

service: media_player.play_media
data:
  media_content_type: music
  media_content_id: file:///media/audio/good_morning.mp3
target:
  entity_id: media_player.mpd

I think different integrations use different ‘file’ notations. E.g. tunein:station:s117327 for a TuneIn radio station so I need to check on the integration specifics.

@Poeschl, is it possible to install extra extensions on top of your setup and if so how? I’d like to add the Spotify, Local and Youtube integrations. From looking at your, repo the only please where packages seem to be specified is in the Docker file but I don’t imagine this can be overwritten for each install.

Sry for not responding :sweat_smile:
Try to play a track over the mopidy interface, if I remember correctly the used path is shown on the logs :wink:

You can build your own version of the addon by putting the addon folder in the /addon volume. After removing the line “image:…” from the config.json Home Assistant will build the image locally.
Then you can alter the Dockerfile with the needed packages.

I tried a lot to get the Spotify and Youtube extensions working, but couldn’t find any way to make them work. :slightly_smiling_face: For Spotify I use the Spotify Connect Addon as workaround.

No worries at all, thanks for the update. I managed to get them running on a separate Mopidy Server (Virtualbox VM) but I couldn’t get the panel to connect to the URL, even though it’s on the same network. Your version is a neater integration.
Re the files, I searched for a file and used the ‘Copy URI’ to get the location. It’s just that is uses the file: notation. I think I read somewhere that means that the media folder isn’t ‘included’. I’ve probably just missed something in the examples dotted around… media/local/media/media_source/source/media/local_media/local :laughing:

To the point of this thread, it is possible to get audio, as long as the Pi runs the mopidy server. The media player is just a controller (as far as my limited understanding goes). The type of audio depends on the extensions… which is why I’m try to test a separate mopidy against the HA Addon

So just so I have this correct, I can copy the folder Hassio-Addons/mopidy/ from your Github to my <HA ip>/addons folder and then if remove the line "image": "ghcr.io/poeschl/ha-mopidy-{arch}" from the config.json… I can try installing more extensions via the Dockerfile directly?

Exactly. Its like remote testing the addon as described here: https://developers.home-assistant.io/docs/add-ons/testing#remote-development

This ended up in quite a rabbit hole…
I started by trying to include the first element, spotify, and just ended up with error after error. I added several extra packages but I think it’s just too much time at the moment so I’m going back to using the Mopidy on a VM. The biggest issue seems to be that the suggested installation method for the extras is apt-get and this isn’t available as the Docker is based on HA’s Alpine Linux (apk).
At some point, when I understand this more, I’ll probably try again, but for now Spotify and YouTube (kind of) are working using the VM (Debian/Ubuntu — Mopidy 3.1.1-1-gf17acacf documentation).
Thanks for your help though, I appreciate it.

I tried also a Debian-based environment also no luck there. The libspotify library of the Spotify extension is the thing I couldn’t bring to work. :wink:

I hit quite a few dependencies but libspotify was the last one that finally made me put it to one side. I found the code (with api.h) and download it but it was taking too long to find how to include it in the dockerfile as local.
I only wanted to play audio on my Pi!!! :rofl:
Like I said, maybe when I have more time (and knowledge) I’ll come back to it.