Roon module for Home Assistant

It’s done automatically as part of the Home Assistant update.

It’s not very easy to check the integration version (except via the home assistant version), but for this release if you weren’t asked to type the IP addesss of your roon core when you set up the integration, then you have the latest version with discovery.

thx so much guys!

so i tried to set this up with much progress yet not quite there yet :slight_smile:

i get the roon devices to work well in home assistant:

image

also configured homekit integration in both HA and the iOS homekit app.
the iOS app shows and works well with all the light i have but for the roon media player switches all are grayed out

for example:

also this is the setting part

any clue what i may be doing wrong?

for completeness here is my config.yaml section

homekit:
  filter:
    include_entities:
      - media_player.office_ls50_ccast
      - light.color_light_1
  entity_config:
    media_player.office_ls50_ccast:
      feature_list:
        - feature: play_pause
        - feature: toggle_mute

thx guys!

Z

Afraid I don’t use HomeKit, but looks like there may be some useful advice here:-

Should perhaps add that once inside Home Assistant, roon media players should be the same as other media players. So you can just look for help getting media players working in home kit.

But happy to help where I can.

thx @GregD, appreciate the help, will investigate further!

Z

So I’m sure this isn’t anyone’s priority with the new Roon release - but it looks like 1.8 broke a minor aspect of the Home Assistant Roon Integration that updated the now playing updated correctly.

I’ve fixed this - so it will be in the next HA patch release (2021.2.3)

The most important parts of the integration (browsing, player control etc) seem to work fine.

2 Likes

Hi,

can anyone help with this issue? I am using a Raspberry Pi 4 with HifiBerry Amp2 and Ropieee. I use Home Assistant to control the device. The issue refers to the volume control. In Roon I have configured volume as “device volume”. When I try to change the volume from Home Assistant it does not work and I see this error in Home Assistant logs:

2021-02-23 14:12:10 INFO (SyncWorker_1) [roonapi] This endpoint has fixed volume.

Once I have change the volume in Roon directly I can change it from Home Assistant as well.

Anbot an idea?

Thanks

Michael

Looking at the code it gives that error if it doesn’t see any volume reported back from that zone, and then doesn’t try and change the volume.

I could change it to try anyway - although a little worried about what value it’s going to use!

For that zone in Home assistant when it won’t allow you to change the volume - can you take a look at developers tools and see what volume_level is reported.

This is from my Ropiee / HiFiBerry Dac2 / Aamp60

Screenshot 2021-02-23 at 14.56.53

If my Raspberry Pi is fresh booted and started playing it looks like this in HA:

I cannot change the volume even if the control panel looks like that:

It happens nothing when I click Vol+/Vol-

image

Once I have changed the volume in Roon, I can change it with HA control pane as well.

image

I discovered a workaround for the issue. I already had an automation which triggers to play a Roon playlist as soon as the player gets available. I noticed that volume control from HA is working after I muted and unmuted. So I have enhanced the automation:

- id: '1614063071587'
  alias: SolarZone Play when available
  description: SolarZone starts playing Roon Playlist "Relax" as soon as it gets powered
    on.
  trigger:
  - platform: state
    entity_id: media_player.solarzone
    from: unavailable
  condition: []
  action:
  - service: media_player.volume_mute
    data:
      is_volume_muted: 'true'
    entity_id: media_player.solarzone
  - service: media_player.volume_mute
    data:
      is_volume_muted: 'false'
    entity_id: media_player.solarzone
  - service: media_player.volume_set
    data:
      volume_level: '0.13'
    entity_id: media_player.solarzone
  - service: media_player.play_media
    data:
      media_content_id: Playlists/Relax
      media_content_type: music
    entity_id: media_player.solarzone
  mode: single

Thanks for the detail. It’s very odd to me that HA can get the volume info fine - but then when it is looking at the zone to set it - it can’t find it!

I just rebooted my AAMP60 zone to see if I can reproduce it - but it worked fine!

The volume adjustment does need to look up some volume info about the zone - so it does need the info that it can’t find in your example.

All I can think to do is add a bit more debugging information to the error message.

If you are a developer I could talk you through running the pyroon library locally to get some more info. Otherwise I’ll just add the debugging info to the next release of HA - and we can take another look then.

Thank you for your help!

Would be great if you could add the debugging to the next release.

There is a new release of Home Assistant in beta that makes a couple of changes to the Roon Integration. It’s officially a breaking change although it will only affect the small number of people grouping players using Home Assistant automation.

Home Assistant have now added a standard way of grouping and un grouping media_players - so the new version replaces the roon custom service with the standard one.

So if you were using roon.join or roon.unjoin you should replace these with media_player.join and media_player.unjoin. The parameters are slightly different, although it should be easy to switch. The documentation is here: Media Player - Home Assistant

The good news is this also adds an ability for an automation to check how players are grouped (you can see group_members in the screen shot below). The first listed player is the roon lead player, kitchen in this example.

This should make it easier know when to group and ungroup in antomations (which is why I made this change).

2 Likes

BTW @Michael_Kletzin the improved debugging we needed is also in the next HA release should we still need it.

I’d like to query the playlists available in Roon from within HA but I can’t figure out how to do it. I did notice that when I attempt to play a Roon playlist in HA and it doesn’t exist, I do get a helpful list of playlists that are available, so it seems that this information is available - I just want to expose it directly rather than via in error.

@GregD do you think this is possible? If not, could you let me know what would be required as I will entertain writing the code :+1:

Try clicking the media browser icon in the home assistant media player.

You can browse and play most content from roon, including playlists.

It also includes album covers etc!

1 Like

Totally, but I am trying to gather up all the playlists so that I can save them to a file so that I can use that file for my Rhasspy setup to listen for those items so I can play them via voice.

@GregD do you know if the data is exposed programmatically so that I can save them to a file?

Take a look at @Ronald_Record’s command line interface.

I’m not sure RoonCommandLine will do what @Eric_Gross wants. At least not yet. If I read this thread correctly, he wants to export Roon playlists to some file format that can be used to later import playlists to another system. The RoonCommandLine utilites can list the Roon playlists but that list does not contain the contents of the playlist. You can, in Roon, export a playlist to Soundiiz (very convenient) or Excel. That is a manual process and requires each playlist be exported one by one.

@GregD I’m not sure if the API even exposes playlist contents but if it does then perhaps I can create an automated way to export all playlists. That would be handy.

1 Like

I read that he just wanted all the names.

But if he needs the tracks - they are available via the browse api (I use this for the home assistant browser) but would clearly need some work in the command line wrapper…