Go to any of the sections (integrations, frontend, automation).
Click on the 3 dots in the top right corner.
Select “Custom repositories”
Add the URL to the repository.
Select the correct category.
Click the “ADD” button.
Go to Home Assistaat settings → Integrations and add Mopidy
Restart HA
But when at the step #8 i can’t find the Mopidy integration. When I go to “HACS - integrations - custom repositories” the “Mopidy Media Playes component” is there. But when I go to “Settings - Devices and Services” and try add the Mopidy integration I get this answer: " No integrations matched your search, the integration you want to set up might not be available to set up via the UI yet. "
What’s wrong? What’s my mistake?
Does anyone know where to find a detailed tutorial on how to install Mopidy?
Hi Bushvin. Thanks for your hint. Yes, the component is there:
Indeed, after some attempts, now I have the component installed. But I can’t succeed in configuring it. A configuration dialog appears, asking for name and address of a server:
Seems that I just installed a client. Should I install also a server? How?
Let me stress that my purpose is to play some mp3 file though the 3.5mm audio port.
Yes, this integration is the “client” part to the Mopidy Server. You do indeed need to install a mopidy server, either on another machine, or using @frenck 's awesome mopidy addon
Hey @pklemy
I have recently come across your issue, I believe: mopidy resuming normal play before your notification tone is played.
I believe it has to do with the speed at which the automation is executed compared to mopidy actually playing the tune.
adding a static wait resolved it for me.
I have discovered mopidy is not the only one to actually have this issue…
I believe
- wait_template: "{{ not is_state('media_player.ha_player', 'playing') }}"
is the real culprit, as the media_player doesn’t start playing (or report it is playing) immediately. It needs to perform whatever protocol/app handshake before reporting it is playing, so your wait_template actually sees the player is not playing and does what it needs to do: continue.
So my advice is to add a 5 second wait before your wait_template:
- delay: 5
- wait_template: "{{ not is_state('media_player.ha_player', 'playing') }}"
this way your media player gets the time to actually start playing.
I installed it yesterday but I dont have the link - if I remember correctly since you might be having the same issue from the website tutorial im thinking of - I didn’t copy/paste the full text box from that site you might be on. I split the sudo commands in separate lines but once I copied the entire text box and pasted - it ended up working.
I installed the integration via HACS, but when I try to add it via the “add integrations” it shows an error when I try to config it. “Cannot Connect to Mopidy host” I used my IP 192.168.1.xx for the hostname. Do I have to start the server first? I already restarted Home Assistant.
First off, thank you all for using my integration, and providing feedback for the past 3 years!
I am currently re-factoring the integration to take advantage of features introduced in Home assistant (queueing, …), replacing some code that is deprecated, try to make it better, and a bit more future proof in general.
I would really appreciate it if anyone is willing to test my new integration before I release it out into the wild.
Testing it does require knowledge on basic git usage and how to manually install custom components, so you need to be comfortable with that. It is currently not (yet) available in HACS.
I am using it myself, and am happy with the performance and stability. I do not expect it to break your setup. But in the event it does, it is just a matter or putting back your original files.
There is no need to remove your mopidy entities in HA, replacing the files and restarting your ha instance is all that is needed.
Git repo
Branch namefeature/compat
Howto
Download and extract or clone the repo to your HA instance or computer
make a backup of your existing mopidy component on your HA instance (just in case)
copy the files to the custom component directory (custom_components/mopidy/)
restart HA
Unfortunately, I cannot offer any compensation for helping out other than making you immortal in the acknowledgements section in the README.
After a Home Assistant upgrade, my Mopidy didn’t work anymore, so I upgraded to the latest version of your integration using HACS.
Now I’m getting this error in my Home Assistant logs:
2023-11-22 12:10:14.586 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up mopidy platform for media_player
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
await asyncio.shield(task)
File "/home/homeassistant/.homeassistant/custom_components/mopidy/media_player.py", line 117, in async_setup_entry
speaker = MopidySpeaker(hass, hostname, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/homeassistant/.homeassistant/custom_components/mopidy/speaker.py", line 555, in __init__
self.__connect()
File "/home/homeassistant/.homeassistant/custom_components/mopidy/speaker.py", line 587, in __connect
self.api.add_callback('options_changed', self.__ws_options_changed)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MopidyAPI' object has no attribute 'add_callback'
Could it be that I am missing a python library that should be installed with pip?
Hi @bushvin
Thank you very much for your afford and great work! Your integration brings a lot of joy in our daily life, given that we use it to play audio books and music in all rooms
Would you please add information on how to support your work on your GitHub page? Thank you!
@dikt, you are too kind!
While I do not mind receiving your precious gift, please consider a couple of my favorite charities in stead of donating to me:
Thank you! This is excellent, simple install and very easy to link to my Mopidy+Snapcast set up.
I couldn’t follow the directions for search, it was all a little over my head, but being able to search and add to the playlist from HA would certainly be the icing on the cake.
Thanks for sharing this, and continuing to develop it @bushvin!
I’ve just installed it and really enjoying it so far!
I was wondering if anyone has been able to interrupt a stream with e.g., TTS, wrapped with a snapshot and resume? My initial attempts were not successful.
According to what I have been reading, the way this works is a bit different with each integration, device, etc. so I thought I might ask here for starters.
In the meantime, I’ll keep plugging away trying to figure it out.
Details (thank you for looking!)
I am piping the output of Mopidy into snapserver, via a named pipe on the same machine, bog standard per the (Snapcast) docs. I can hear music (and/or TTS) on the snapclient(s), and can pause, resume, etc. from HA, just not the way I want/expect from a script (yet). The Mopidy source is SomaFM if that matters (and maybe I will try some other sources as well).
EDIT:
I got it working. For some reason, it wouldn’t work from the ‘Run script’ option inside the 3 dot menu in the scrip edit UI. But it did work once I saved it and called it as a service. And then I had to play with the timing a bit, while watching ‘States’ in ‘Developer tools’.
Next steps will be to parameterize it, possibly set volume of various snapclients (still need to install that integration), etc.