Roon module for Home Assistant

BTW in case anyone is interested I have added support for looping playlists into the roon integration.

Will likely be in the next version once this code had been merged Add repeat to roon media player by pavoni · Pull Request #88851 · home-assistant/core · GitHub

This is a rotating knob control and I wanted the volume to go up by exactly 1. Feels right when it works that way.

That happens to be exactly what I did:

volume_level: “{{ state_attr(zone_name_full, ‘volume_level’)|round(2,floor) + 0.011 }}”

Took quite a while to figure out why the volume got stuck at 27, though. Might or might not need the “round” but this falls into the category of “once it works, don’t touch it”

I do wonder if the issue is in your layer and if it constitutes a bug or not…it seems like adding one to the volume should work. If you do want to try to repro it, you can use an expression like mine which just adds one and see if you hit a point at which the volume doesn’t advance.

Thanks for the tips!

1 Like

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.