Roon module for Home Assistant


(N_T) #103

Thanks so much for this Shivrang. It is now working fine – and without any real intervention. Now that I reflect more carefully, I think it was a problem with my home assistant set-up. Thank you again, and thanks to Marcel for developing and sharing this.


(Marcel van der Veldt) #104

can you please try to grab the latest version from github as both issues you’re describing should be fixed.


(N_T) #105

Thank you. It appears to be working well.


(Shivrang Setlur) #106

Hi Marcel,

I’ve been running the latest version of the component (https://github.com/marcelveldt/roon-hass/commit/ff3422a140bcada23779b09ab8e60e4bfe3e456e) for a month; the player widget is still non-functional, and calling media_player.play_media through home assistant still shuffles the playlist (without enabling “shuffle” in Roon). Given that the component seems to be working perfectly both for yourself and others, I can’t help thinking that the issues I’m experiencing arise from my system setup, though I don’t understand why they would. I run roonserver and home assistant on the same server (ubuntu bionic), using the hassio docker images for a generic x64 install.

Whenever I use the player widget, my homeassistant logs show the following error (this happens with both playlists and radio):

2019-02-01 10:25:04 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/asyncio/coroutines.py”, line 212, in coro
res = func(*args, **kw)
File “/config/custom_components/media_player/roon.py”, line 722, in hass_event
if changed_entity in self.source_controls or changed_entity in self.volume_controls:
TypeError: argument of type ‘NoneType’ is not iterable

The only possible issue I can think of is that there is an issue with the networking between the hassio docker container and the host system. There are a couple peculiarities in my setup. First, autodiscovery of my Roon Core doesn’t work, so I have to manually specify the host (either localhost or LAN IP – ie. 192.168.. – addressing works). Secondly, due to a widely experienced DNS issue for those running hassio under docker on Ubuntu, I manually call socat to forward DNS queries to my home assistant container.

As for my issues playing playlists, when using the latest version of Roon.py, when I use media_player.play_media to start a playlist, the playlist entries are still shuffled (though shuffle is not ‘enabled’ on the Roon zone.


(Marcel van der Veldt) #107

I’ve updated the module again on Github. Can you give it a try and report back ?
If it’s all working fine now I’ll submit it to hass for official inclusion


(Shivrang Setlur) #108

Hi Marcel,

I’ve tried the new version of the module, and the playlist plays without shuffling. This is great for me; many thanks! Unfortunately, the module still generates an error when using the widget. I get one error when using input_select to choose a player, and another when using it to select a playlist/radio.

2019-02-02 15:44:00 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/asyncio/coroutines.py”, line 212, in coro
res = func(*args, **kw)
File “/config/custom_components/media_player/roon.py”, line 741, in hass_event
if changed_entity in self.source_controls or changed_entity in self.volume_controls:
TypeError: argument of type ‘NoneType’ is not iterable
2019-02-02 15:44:05 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/asyncio/coroutines.py”, line 212, in coro
res = func(*args, **kw)
File “/config/custom_components/media_player/roon.py”, line 741, in hass_event
if changed_entity in self.source_controls or changed_entity in self.volume_controls:
TypeError: argument of type ‘NoneType’ is not iterable


(N_T) #109

Hi -
I just tried the new version as well and had the same experience. The media player itself works very well, but I receive the exact same error message that Shivrang reports when using the widget. Thank you again for your work on this.


(Shivrang Setlur) #110

Hi Marcel,

After many days of uptime, I can also confirm that the component reconnects to Roon effectively after it loses a connection to the server.

Thanks,

Shiv


(Sjee) #111

@Marcel_van_der_Veldt can you explain how to use tts?


(Marcel van der Veldt) #112

OK, great. I have the same experience in my own setup. It now reconnects fine if the server is rebooting or the connection is temporarily lost.
Now, only thing left is to fix the issue with the playlist widgets and it’s all set for submitting to hass.


(Marcel van der Veldt) #113

Well, I kind of hacked in support for that my using mqtt and some custom code on pi roon endpoints.
So, unless you’re using roonbridge clients as endpoints, it’s kind of useless.


(Sjee) #114

Since I would like to use airplay endpoints I hacked my way around a solution using a script and shell command in HA which creates a wav file containing the TTS and puts it on a share which is accessible by Roon. I use your (highly appreciated!) custom component to play a playlist containing the TTS file to any of my endpoints. I need to do some more testing but it seems to work.


(robert Peczkowski) #115

Roon custom component doesn’t work with HA version 0.88.0 due to constants were moved.
Can you fix, please?