Heos Group support

Official support for HEOS groups has just been merged to the Home Assistant main development branch. It’s probably going to be part of 2021.12. :tada:

It took longer than I initially thought and I must admit that it was not an easy job. But in the end it was totally worth it and I got some great guidance from the Home Assistant developers lately, which led to big improvements of both the codebase and my very own coding skills :slight_smile:

For now HEOS will be the first component which uses the new media_player.join() / media_player.unjoin() service calls. That means that custom:mini-media-player will need some updates to support this.

5 Likes

Nice! Great job and thanks for your time!

Thanks so much for your efforts.
I admit I don’t yet fully understand how the new functionality will work but am very glad there is now an official and future proof solution!
I assume the ‘hack’ will remain required for now until the custom mini media player supports the new functionality.

Awesome news @direx! Great job, and congratulations on your patience! Looking forward to test it. When it is merged, does it mean it is already part of the core if I update my dev-container?

I’d say this should be either in today’s or tomorrow’s dev docker image.

1 Like

Fantastic! Question though, will it also allow grouping/ungrouping of surround setups? Eg. The recently added functionality of the Denon Home 550?

Idea would be to select various grouping presets based on the app running on my NVIDIA shield or status of Logitech Harmony hub.

Use case:

  • when watching movies i would like my Denon 150’s to function as surround back speakers to my Denon 550 soundbar;
  • when listening to music i would like them to be setup as stereo pair.

Currently, the way Denon has setup it’s app/surround group I can either listen to pure stereo which disables /mutes the 150s and plays over the 550 or select "dynamic stereo which pushes the stereo signal over all speakers.

Same applies to the subwoofer, ideally I want to only use this for movies/series and not for music - The bass is quite omnipresent :slight_smile:

1 Like

Creating surround groups is not supported. Personally I have always considered this a set up once and forget thing. Furthermore the Home Assistant API for joining/unjoining does not support this HEOS-specific scenario.

To be honest I don’t think that this is ever going to make it into Home Assistant, as most people set up their surround speakers statically.

If I were you I’d just create a Python script which sets up either speaker “preset” directly through the HEOS API or through pyheos. I’d then call the Python script through a Home Assistant shell_command. That should do the trick and gives you maximum flexibility.

Edit: Surround groups are not even documented in the official HEOS API doc. Sorry about that. You might want to ask Denon support if they could update their API spec.

1 Like

Can or Do i need to delete the heos files now?
Got these errors: Entity media_player.denon_avr_x1600h (<class 'custom_components.heos.media_player.HeosMediaPlayer'>) implements device_state_attributes. Please report it to the custom component author.

Me too! Maybe someone can help?!

Hi,

  1. You are still using the custom integration, did you try the official one after grouping was implemented?

  2. If you have issues with the custom integration, please report it on the github site with a proper description of exactly what you are trying to do, what is not working, and more details on the error.

I’m still using the custom integration myself, and it is working fine here (I’m on HA 2021.12.7). I don’t see any errors, but then I only have HEOS-speakers and not Denon AVR. I didn’t have time to test the official integration after grouping was implemented, but if it is working fine, the plan is to deprecate the custom integration.

I’m still using the custom integration as well, because as far as I understand, the mini media player doesn’t support the new grouping feature at the moment. I asked a question about that here, but no luck.

Yeah, I saw direx mentioned something on that. When I get to testing it myself, I can propose a PR to the mini-media-player to fix it since I am using it myself for the same purpose.

PS! Perhaps you have better luck opening an issue on the github of mini-media-player. The developer is probably paying more attention there than on the community. Anyway he may need some help testing it for Heos.

1 Like

@quizzical & others: I did some testing with the mini-media-player and the official integration join/unjoin features. It seems to me that the card is working fine as it is. I only did some basic join/unjoin testing and didn’t test all the buttons, but at least the basic stuff is working already.

However, it is necessary to modify the card config parameter platform from heos to media_player. Then it seems to be working fine. I realized this when looking at the code of the card here.

Example:

type: custom:mini-media-player
entity: media_player.heos_office
speaker_group:
  platform: media_player         # Notice this!!
  show_group_count: true
  entities:
    - entity_id: media_player.heos_office
      name: HEOS Office
    - entity_id: media_player.heos_kitchen
      name: HEOS1 Kitchen
    - entity_id: media_player.heos_bathroom
      name: HEOS1 Bathroom
    - entity_id: media_player.heos_livingroom
      name: HEOS Livingroom
2 Likes

I did some testing based on your example.
The grouping doesn’t work for me. I have not uninstalled the hack, but assume that should not have an influence.
I must also say my case seems less straightforward than yours. You seem to only have Heos devices. While I have a normal Heos1 in the bathroom but then I have a Denon AVR in the entertainment room that is controlling the speakers over there as well as in the kitchen (trough it’s zone1 output).
THe AVR has HEOS integrated but the Home assistant HEOS integration can only control it to a very limited extent. For many features I have to use the Denon AVR integration.
In any case the HEOS hack works fine for me for grouping so I guess I’ll continue using that for now.

I think you need to remove the custom integration for it to work, because when a custom integration is installed with the same domain as an official, the official will be disregarded. So the services won’t be available unless you remove the custom integration (to my understanding at least).

Ah yes you seem to be correct. The steps seem to be:

  • Go to the integrations page and remove HEOS (which is a custom integration).
  • Go to the HACS page and remove Denon HEOS (Custom)
  • Reboot Home Assistant
  • Install the default HEOS integration
    Haven’t done this yet. A bit afraid that I’ll break what works :joy:

It works :wink:
The heos integration installs itself after you deleted everything! You need to remove heos from the configuration.yaml too

1 Like

I have a similar configuration. 3x HEOS1 speakers and 1x HEOS3 speaker.
I’ve noticed the following difference in grouping with the official integration vs the custom one.
Whereas selecting additional speakers in the custom integration would add them to the Group, the official integration does not. Eg: The TV replaces the Kitchen speaker below rather than being added along with it:

Also, GROUP ALL behaves as expected, but UNGROUP does not.
heos

Can anyone confirm this behavior, or am I doing something wrong?

You’re right, I get the same behavior on my system. I’m not sure if this is perhaps a problem in the card or if it is in the integration. Maybe this is what direx meant when he said the card neeeded some updates to support it. I will try to check this later.

Hi,

I did some more testing, and I was able to tweak the mini-media-card to achieve what we want. I opened an issue on github, let’s see what the card owner thinks. Used your animation as illustration, hope thats ok.

2 Likes