Roon module for Home Assistant

I’ve just bought a second Sky Connect for home…

I’m actually still using Deconz for similar reasons to you — it was the easier route when I set it all up a few years back. I also have a USB dongle I use via Zigbee2MQTT for a few things.

But if I was staring afresh today I’d probably just get a Skyconnect USB dongle and use ZHA. In fact I should problay start afresh at some point with a brand new HA install and just setup the stuff I really need using ZHA. It’s just finding the time to do it :slight_smile:

Second your point about reducing the number of hubs, you can pretty much connect everything to the one Zigbee dongle like the SkyConnect nowadays and dump all your propriety hubs, as you say less complicated, less power and less wall-warts / cables.

(I’m actually using a couple of the older rotary-style IKEA remotes to control Roon via HA)

1 Like

I also have one of the old rotary controllers.

It looks cool in black - but I have to confess that I find the 7 button ones easier to use!

Do you use zwave as well?

1 Like

I’ve been using a couple of these with HomeAssistant for a few months. I’m using Zigbee2MQTT instead of ZHA. Z2MQTT knows the devices and has been able to apply firmware updates (though I recall having to fiddle with it a bit to get the firmware updates to work). In case this isn’t obvious, my HA instance is a RaspberryPi with a USB Zigbee adapter.

@GregD - I’m interested in seeing how you’ve configured your buttons. You might remember when I reported the HA / Roon volume bug a while back - the issue that you ended up tracking down to a integer/float conversion. That came up for me when I was initially setting these up.

For reference, here’s an example of how I’ve configured the volume up button on one of my remotes. If you’re doing something different or simpler, I’d love to see it! :slight_smile:

alias: symf1_volume_up
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 8d02b82e8eeeb9acad522c023e9082ad
    type: action
    subtype: volume_up_hold
    discovery_id: 0x9035eafffeec6c15 action_volume_up_hold
  - platform: device
    domain: mqtt
    device_id: 8d02b82e8eeeb9acad522c023e9082ad
    type: action
    subtype: volume_up
    discovery_id: 0x9035eafffeec6c15 action_volume_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

I remember the issue - and the bug!

I’ve gone the simple route and used blueprints from here:-

There wasn’t a controller for the 7 button remote - so I hacked one together based on one of the others (happy to share). I took out anything complex just leaving actions that the IKEA controller produced natively (so no loops looking for double clicks).

I’d not looked at blueprints until it was suggested here. One of the nice things is that it brings all the actions together in two automations (the controller and the hook).

I see. Even with blueprints, you have to specify the action, don’t you? I can’t recall the details but in order to get the volume up button to increase the volume, I had to use set the volume level rather than just increase it. That’s why I’m setting volume_level based on the current value + 1. Are you able to do something simpler with a blueprint?

With the blueprints I’m using the ‘Hook’ section controls the media player - and I just specify how many volume steps I want.

The only automations I’ve specified myself are the custom ones - eg to play my favorite radio station. All the default actions (play, next track etc) are taken care of.

So the hook looks like:-

- id: '1692652010050'
  alias: Hook - Media Player - Gen2 3 - Shower
  description: ''
  use_blueprint:
    path: EPMatt/media_player.yaml
    input:
      controller_device: f8d3d147c888f7de52030563d7390dee
      controller_model: IKEA E2123 SYMFONISK Button Remote
      media_player: media_player.shower
      volume_steps_short: 40
      volume_steps_long: 40

And the controller (which has my custom grouping logic)

- id: '1692651914681'
  alias: Controller - SYMFONISK Shower
  description: ''
  use_blueprint:
    path: EPMatt/ikea_e2123.yaml
    input:
      integration: deCONZ
      controller_device: f8d3d147c888f7de52030563d7390dee
      helper_last_controller_event: input_text.symfonisk_gen2_3_helper
      action_play_short:
      - choose:
        - conditions: '{{ not is_state_attr("media_player.shower", "group_members",
            []) }}'
          sequence:
          - service: media_player.unjoin
            data:
              entity_id: media_player.shower
      action_dot_short_release:
      - choose:
        - conditions:
          - condition: state
            entity_id: media_player.tuner
            attribute: media_title
            state: BBC Radio 4
          - condition: state
            entity_id: media_player.tuner
            state: playing
          sequence:
          - service: media_player.join
            data:
              entity_id: media_player.tuner
              group_members: media_player.shower
        default:
        - service: media_player.play_media
          data:
            media_content_id: My Live Radio/BBC Radio 4
            media_content_type: music
            entity_id: media_player.shower
      action_dot_dot_short:
      - choose:
        - conditions: '{{ not is_state_attr("media_player.shower", "group_members",
            []) }}'
          sequence:
          - service: media_player.unjoin
            data:
              entity_id: media_player.shower
        default:
        - service: media_player.media_stop
          data: {}
          target:
            entity_id: media_player.shower
      action_dot_dot_short_release: []
      action_dot_dot_long:
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.systemline
1 Like

Thanks! Going to explore this!

Have just checked - and looks like the author is no longer maintaining the code.

Although it’s pretty good as is.

1 Like

Possible new feature

I’ve been experimenting with something - and just wanted to check if it’s useful to others.

The roon API has the ability to add an ‘api volume control’. If you change your endpoint to use this - then roon will tell you when the user tries to change the volume - and then you can implement it yourself .

This is useful where your device doesn’t have a proper roon controlled volume control - but you do have a way to change the volume via home assistant.

In my case I have a few roon endpoints that play through devices I can control via an IR blaster.

So with this change roon will let home assistant know when I change volume in the roon apps, and I can run a device automation in HA to send the volume + and - commands via my IR blaster.

Does anyone else have a situation which would benefit from this?

Some screen shots of the prototype attached

voice control

1 Like

@Andrew_Gracie I’ve been looking at selecting profiles (it’s still on my list of things to do properly), but in doing so I’ve found a hack / workaround that may help you.

The api for selecting a profile uses the same browse api that I use for playing media.

So if you use the right browse path with the play_media you can change profile!

Pyroon (and so HA) is unsophisticated in how it handles connections - so there is just one connection that is used globally - so changing the profile changes it for everything.

The following is an example that works (at least for me)

1 Like

Just a note that there is a HA Blueprint for the IKEA Symfonisk Gen2 that supports MQTT integration. This is the blueprint that will work for those of us integrating via Mosquito Broker.

The blueprint owner has been addressing Roon integration issues over the past couple of days and it is now working well (though volume stepping currently can not be more granular than 50 total steps).

The blueprint is here: Z2M - IKEA Symfonisk Gen2 [E2123] Media Control v1.52 - Blueprints Exchange - Home Assistant Community

[Edit] Version 1.52 of this blueprint now supports 100 volume steps addressing the issue I described above.

Hello,

I don’t know if this is the right place to ask this but… I’m trying to use roon with Home Assistant, but it run 2-3 minutes and crash.

The things that i’ve tryied:
Roon Core is installed in a Windows 11 physical computer

-Latest version of roon alone -->Working

  • Latest version of roon + Completely new install of HA into a virtual machine → Roon crash after 1-2min

  • Early access version of Roon in a new W11 virtual machine + HA → server state of roon core is “not responding” each 30 sec

With or without HA extension activated it crash… if I start HA, roon crash after 1-2min…

I don’t know what HA is doing in the network but Roon don’t like it.

Is someone encoured the same problem ?

Thanks

Haven’ heard this before.

I suspect most people are running HA on a dedicated Raspberry Pi.

You could try that if you can.

Otherwise you’ll need to turn on debug logging on the HA roon components - and dig into both the HA and Roon Core logs for clues.

This is also firmly in Tinkering territory - Roon Labs don’t officially support running Roon in VM environments

Hello, thanks for your response.
Yes of course, it was only a test.

So now I just found the solution… it’s more complicated that roon and home assistant…

It’s musiccast related :slight_smile:

Because I have tested with another home assistant (jeedom) and when 2 assistants are connecting to the same musiccast player roon shut off itself.

So my solution is: bring my home assistant in another vlan than roon and the problem is gone…

Thanks for your support

Have a nice day

Just to say that that latest release of Home Assistant (2023.12.1) contains a couple of roon improvements.

Firstly Home Assistant media players are now a little smarter in looking at what facilities Roon players have.

So a player with normal volume control will look like this:-

One that has no volume adjustment will look like this:

And ones that only have + and - volume adjustment will look like this:

The second enhancement is perhaps more exciting, but useful to fewer people. I have added a facility where home assistant can be used to provide a simple volume control inside roon.

So you can pick Home Assistant as a volume control in roon.

This then replaces the standard roon volume control - with volume up and down buttons:

Pressing these sends an event to Home Assistant that can be used to call automations. I am using it to send IR Blaster messages to my multi zone amplifier

alias: Roon - Volume Kitchen
description: ""
trigger:
  - platform: state
    entity_id:
      - event.kitchen_roon_volume
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: event.kitchen_roon_volume
            attribute: event_type
            state: volume_up
        sequence:
          - service: remote.send_command
            data:
              num_repeats: 1
              delay_secs: 0.4
              hold_secs: 0
              device: systemline
              command: volume_up
            target:
              entity_id: remote.broadlink_kitchen_remote
      - conditions:
          - condition: state
            entity_id: event.kitchen_roon_volume
            attribute: event_type
            state: volume_down
        sequence:
          - service: remote.send_command
            data:
              num_repeats: 1
              delay_secs: 0.4
              hold_secs: 0
              device: systemline
              command: volume_down
            target:
              entity_id: remote.broadlink_kitchen_remote
mode: queued

So this means you can control non-roon integrated amplifiers in Roon via Home Assistant.

This is also useful if you use a room remote via home assistant (like an Ikea Symfonisk remote) because device will call the roon volume change - which in turns calls the volume code via HA.

More details in the home assistant documentation here:-

Any questions, please ask.

4 Likes

These are great updates! Thanks!

1 Like

Thanks. Hope you enjoy!

1 Like