Roon module for Home Assistant

BTW: there’s an updated version online with the fix for the players showed as off.

I am having some issues with this and not sure where the issue lies. I have followed the setup instructions and installed the Extension on Roon (has been enabled too), copied across the roon.py file into the custom-components/media_player folder and added the entry to the configuration.yaml file but I am not seeing anything show up on Hass.

Looking at the HA log the only roon messages are -

WARNING (MainThread) [custom_components.media_player.roon] input_number and input_select objects do not (yet) exist. Skip playlist generation...

Cant see anything else though so not sure what the issue could be?

Did you point the config in hass for roon to the api proxy you installed ?

Yeah here is the configuration.yaml entry -

  - platform: roon
    host: 192.168.1.26
    port: 3006

Just to note, the api proxy is setup on the same computer as the Roon Core

@Marcel_van_der_Veldt this is really great! and very well done. Got it up and running in 5 minutes!

1 Like

@Marcel_van_der_Veldt Got this up and running last week. So far everything has been working great, thanks for your work on this!

I’ve got Roon running on an i5 Intel Nuc with all other software in docker containers (including home assistant). I setup ha-dockermon which lets me control my docker containers in home assistant with switches. I created an automation so that when Roon starts playing, all my docker containers (excluding HASS) shut down so I have adequate system resources for DSP. It’s a pretty slick feature, for those with home assistant in docker I would highly recommend implementing it.

1 Like

Great, thanks for the feedback!

I have exactly the same setup with an i5 NUC running docker for some stuff like Plex and Roon.
So far I did not yet needed to shutdown docker images to properly run Roon with DSP but thanks for the tip.

sorry for the late reply. Did you manage to get it running or not yet ?

Not yet - have been having tackling some radiator devices so haven’t had time to really look into this, that being said I am not really sure where I would even start with this as there doesn’t seem to be any errors or anything like that. Any ideas?

Just wanted to say I managed to get mine working now, moved the Core to another PC and that seemed to work out the issue…not sure what the cause was though.

Going to have a look at getting it nicely integrated but I can see all the endpoints at least so thats a good start. Was wondering whether there was any development on the tts/announcement stuff you were working on? That would be amazing to get going…was really disappointed it wasn’t something that could be done through the iTunes extension

Hi Marcel,

great extension you built here.

it appears to work on my HASS, but scripts do not work at all.

After following your instructions, I can see the mediaplayer for Roon within HASS and everything I am playing on Roon is correctly shown in HASS and I can also fully control the roon media player component.

However, I would also like to use HASS for playing a radio station from within Roon, but it only runs into an error:

Log Details (ERROR)
Mon Aug 27 2018 13:03:22 GMT+0100 (Western European Summer Time)

Error executing service <ServiceCall media_player.play_media (c:b15d158f232243a19ac5295f5517aeae): media_content_id=1Live, media_content_type=radio, entity_id=[‘media_player.d220’]>
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/core.py”, line 1117, in _event_to_service_call
await service_handler.func(service_call)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/media_player/init.py”, line 442, in async_service_handler
await getattr(player, method[‘method’])(**params)
TypeError: object generator can’t be used in ‘await’ expression

thats the script I defined within HASS:

roon_music:  
  alias: Play Roon Radio
  sequence:
    -  service: media_player.play_media
       entity_id: media_player.d220
       data_template:
         media_content_id: 1Live
         media_content_type: radio

I tried, using quotes around id and type as well. And as content_id I am using the name of the station as mentioned within Roon -> Internet Radio -> 1Live (Name of the station):

I’ve built a new version of the hass module, now no longer dependent of the proxy as I managed to get it talking directly to Roon instead. I’ll update GH later today with the new code. I’m al;so planning to submit it to hass for official inclusion.

1 Like

Great work!

Thanks!

The new version is now on Github. It’s now talking directly to the TCP socket of the Roon server so no more need for the nodejs api proxy in between.

3 Likes

Oh and btw I’ve also managed to get TTS and some other nice stuff working for those of you running roon on a pi or using chromecast endpoints. I’m a bit busy atm but I’ll do my best to document it all asap.

Great news.

I just tried it using it by updating the roon.py file within my custom components folder, but roon now does not work with or without node.js running.

I suppose we now need to wait for roon to be officially published with the next hass release, right?

It should work already. Remember to approve the extension in Roon’s settings once.

Nope, nothing here.

I simply placed roon.py to the custom components subfolder as instructed, turned node.js off, restarted Hassio, and it runs into an error (I configured roon.py only in the config yaml by stating platform only (i have only one ). I don’t get a an approval request at all. the error message is as follows:

Error while setting up platform roon
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  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 88, in async_setup_platform
    LOGGER.warning("App not yet registered within Roon. You should allow it in Roon's settings.")
NameError: name 'LOGGER' is not defined

I ran into the same error, but luckily it is just a small typo at fault. At line 88 in roon.py, “LOGGER.warning” should be “_LOGGER.warning”.

Argh, I tried your solution but now my hassio is not booting anymore it is stuck somewhere and I do not know how fix it