Roon module for Home Assistant

There is a HA to roon conversion, depending on the roon endpoint. What’s the roon volume scale of your endpoint?

Also which version are you running? The roon to HA conversion code changed recently.

If your roon endpoint is in db then I can imagine there could be an issue with rounding.

thanks, I’d be interested to try that

Hi, Dan.

Here’s a fully functioning version of an action which increases volume by a single step by incrementing the current volume. It’s probably obvious that you can modify the increment (would be .01 in my case if not for the rounding issue) and, of course, subtract for volume decrementing.

alias: Smart Knob Brightness up
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 8451f94282dbec0c3eecd5b26e257a61
    type: action
    subtype: brightness_step_up
    discovery_id: 0x003c84fffea4d15e action_brightness_step_up
condition: []
action:
  - service: media_player.volume_set
    data_template:
      entity_id: media_player.guniti
      volume_level: "{{ state_attr('media_player.guniti', 'volume_level')|round(2,floor) + 0.011 }}"
mode: single
1 Like

Hi, @GregD. Thanks for following up on this.

I just verified the issue still occurs on HA version 2023.2.5 on a Pi.

Hi.

This is a Naim Uniti Atom HE on which the volume scale is 1-100. No volume limit. Image of volume settings at the end of this post.

Here’s the simplest repro I’ve found. It doesn’t repro 100% of the time but it’s pretty close.

Go to Developer Tools | Services. Do a simple volume_set. You don’t need to do the read, increment, write step…just set. In my case. I can set to any number up to 56 and that works. I try to set to .57 and Roon doesn’t respond to it. Set to .58, Roon sets the volume to .57 Setting to .59 and beyond work fine. It’s specifically .57 where it has the issue.

If the volume is above .57 and I set it to .57 using this method, Roon will often show it at .56 and then I can’t set it to 57 again.

I don’t see any equivalent issue when using increase volume - it’s just “set” where the problem occurs.

I’m interested to hear if you figure it out.

FWIW, this little knob is a pretty decent volume controller. I posted earlier about how generates events inconsistently. It has two modes that you toggle between by holding the button down for a few seconds. One mode sends rotation events and does so inconsistently. The other mode sends brightness events quite consistently. I switched to that mode and I’m using this controller regularly. Well worth the $12.

service: media_player.volume_set
data:
  volume_level: 0.57
target:
  device_id: 0620f6bec5c0cf6da6a4fb135b08b7fa

Very interesting - I can reproduce it so will investigate!

Thanks!

1 Like

Please take a look here:

What I can reproduce may be a roon bug…

That’s interesting. I can’t reproduce what you’re seeing. The volume increment/decrement buttons work fine for me.

Might be related or the same issue. I suppose what I’m seeing could actually be an issue with Naim’s Roon integration. I can’t tell if you’re also using a Naim device.

When you initially wrote that you reproduced my issue, was that with the developer UX that I described?

I’ve found it. There was an incorrect integer truncation in the set_volume_level methof in the HA roon wrapper.

Hopefully fixed in the next version of HA.

1 Like

Nice! Thanks for tracking it down! I’ll watch for, and confirm, the fix when it makes it to release.

Thanks again!

Siri voice-on-demand artist; Roon plays!

shortcut:
https://www.icloud.com/shortcuts/b619a1b643244cb4bcffc7ae00f1281a


Enjoy it!

Can you explain what this does? I took a look at it (without installing or using it) and it doesn’t seem related to Home Assistant or Roon.

Do you have Roon, and HomeAssistant?
here is a demo:
【Siri语音点播艺术家Roon播放】 Siri语音点播艺术家Roon播放_哔哩哔哩_bilibili

Hi. This appears still broken in the latest release. Should I be seeing a fix now? Thanks.

It should be in this month’s 2023.4 - which I didn’t think was out yet.

1 Like

Thanks. I’m on 2023.3.6 - I thought it would be picked up in the one of the point releases but I’ll check again when 2023.4 is out. Appreciate the response!

It’s now released -so please take a look.

The new version 2023.4.0 of home assistant now contains support for repeat (single track or playlist) for roon media players.

I can confirm it’s fixed. Thanks!

When I restart my HA instance, I always have to re-enable the “home_assistant” extension in Roon for the HA integration to start up. Is that normal. I’ve had the issue for a while. It’s possible it’s caused by my network configuration - Roon and HA are on different vlans, though they are allowed to speak with one another. Roon is actually on two vlans, in case that’s relevant. It’s not a big deal but I do have to pay attention to it.

1 Like

You need to uninstall and reinstall your roon integration.

The roon integration only stores the roon key when initially installed.

If the key isn’t found you can re-enable on a restart - but the key returned isn’t stored for next time.

1 Like

Thanks - a re-install did fix the issue. I moved my core onto a new device not too long ago. I assume that’s what got me into that state. Thanks for the tip.

1 Like