Roon module for Home Assistant


(Marcel van der Veldt) #1

Hi all,

So I’m slowly making the transition from LMS to Roon.
This is painful process to be honest because I had LMS heavily integrated into all parts of my house and daily routines, including Spotify. Well, long story short I’ve decided to try to get it all converted to “Roon style”.

One of the major bumps was the lack of a proper integration with Home Assistant, my home automation software.

As I’m pretty familiar with python I decided to create my own hass module which is now working pretty well. Are there any other users out here in the same boat as me using Home assistant ?

In that case, are you interested in giving this module a test drive ?

A few details:

  • Full control of all outputs and zones
  • Newly added zones are automatically added to hass
  • Removed/disabled zones are automatically removed from hass
  • Full playback control, including power and volume controls
  • Control of zone grouping / syncing
  • Full info about track currently playing in a zone, including cover
  • Start playback of playlist by name
  • Start playback of radio by name
  • Auto add available playlists and radios into a input select for easy automations
  • Fully async compatible for fast responses
  • Uses a combination of active polling in combination with web sockets events on the Roon api to determine if zones have changed info

On my TODO list:

  • support playback of url / file locations, so far this is not available in the Roon api
  • TTS and notifications support (have a Roon zone read you the daily news for example)

Offcourse when setup correctly this is all compatible with Amazon Alexa etc.
I’m now using it myself since a few days and must say that it’s working perfectly fine so far.

For now, it needs a intermediate proxy as nodejs module installed because I have not yet figured out the direct web sockets call to the roon api. So for now I just forward the api calls with the Javascript api which was provided by Roon. I have this proxy setup in docker myself but it’s just a simple start and forget app. Hopefully one day I can just call the roon web sockets api directly which removes one link.

Please give it a test drive and share your feedback here. Pretty sure there will be some bugs I overlooked so let’s find them, and once stable, maybe (with Roon’s permission) I can submit it to the Home Assistant guys for inclusion.

Get the component here:


(Wouter du Toit) #2

Hi @Marcel_van_der_Veldt,

I have the http-api extension for Roon installed, and I am also using Home assistant and would love to have integration between the two.

I assume you implemented it as a mediaplayer in HA?

Thanks so much for creating the module, and hopefully it will be included in HA in the near future!

Regards,


(Marcel van der Veldt) #3

Yes, the goal is to have it included in hass in the end. First let’s do some testing :wink:

I have indeed implemented it as a media player module.
You will get a media player object for each zone output. The source control of each media player hass object will let you attach a player to another zone (grouping).

Also created a nice widget which will let you quickly start a playlist on a selected player.
As it is fully implemented as media player object you can control your Roon zones with Siri and Alexa too. Nice bonus.

I’ll do a quick write up how to install it tomorrow and get back to you. Nice to see fellow hass users here !


(Wouter du Toit) #4

WOW! That sounds fantastic Marcel…I am looking forward to giving it a spin!


(Dirk Leas) #5

+1, awesome!


(Ethan Garner) #6

I would be super psyched if this was developed!
So, please make it!


(Marcel van der Veldt) #7

Already done that. working in my home for a few days now. I’ll prepare some documentation now to share so you can give it a test spin yourself.


(Marcel van der Veldt) #8

OK guys, it’s available for testing now:

I will also update the first post.


(Wouter du Toit) #9

I now have this deployed and it is “mostly” working. I am having some issue with the input_select lists for room and playlists populating.

The volume control is working, and I can see the mediaplayer created for my zone(and I can control it).

O and btw, you made my day with this mate!


(Marcel van der Veldt) #10

OK, I’ll take a look at that. Everything else working? You can control your Roon players like any other media player in Home Assistant?


(Wouter du Toit) #11

O wait it just populated the lists…it just took its sweet time…let me test further.


(Marcel van der Veldt) #12

Could be… If the list fails to initialise at startup (there’s a lot being setup at that time), it will try it again after 5 minutes. I’ll check to optimise that.


(Wouter du Toit) #13

Yeah I can control everything now, when I select a playlist the input_select goes back to “Select playlist” ie. it is not displaying the currently playing playlist, but otherwise everything is working.


(Marcel van der Veldt) #14

Correct, the Roon API doesn’t return what playlist it’s playing. I can do some guessing but that will most probably not be really good. It’s only returning details of the current track being played so I decided to use return that playlist indicator to the initial state.


(Wouter du Toit) #15

aaah right…what is the best way to do the automations? Is it easiest to just change the input_select values, or control the specific media_player?


(Marcel van der Veldt) #16

Best to do the automations the usual way, by controlling the specific media_player. See the input_select stuff as a bonus. I just use them to quickly start a playlist or radio on one of my players.


(Wouter du Toit) #17

Man this is so cool…


(Marcel van der Veldt) #18

Cool, glad you like it. Good that it’s useful for others too.


(Christopher Kliewer) #19

Adding the below into /config/configuration.yaml results in the error listed at the bottom…

media_player:
(hyphen) platform: roon:
host: ipaddressofnodeproxy
port: 3006

core-ssh:~# hassio homeassistant check
Error on homeassistant/check: Testing configuration at /config
2018-01-06 22:21:23 ERROR (MainThread) [homeassistant.bootstrap] Unable to setup error log /config/home-assistant.log (access denied)
2018-01-06 22:21:23 ERROR (SyncWorker_0) [homeassistant.util.yaml] mapping values are not allowed here
  in "/config/configuration.yaml", line 74, column 19
2018-01-06 22:21:23 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: mapping values are not allowed here
  in "/config/configuration.yaml", line 74, column 19

(Wouter du Toit) #20

Mapping error is because there shouldn’t be a : after roon…I think that it is incorrect in the instructions.

Might also be an indentation problem( I can’t see the indentation in your post)…there must be two spaces before the hyphen, and 4 spaces before host: and port:.