Heos Group support

@tormagj I took a look at your code and to me it looks good. I have also sent some PRs to HASS and there is nothing to be afraid of :slight_smile: The core devs might ask you for some changes during review but this is nothing bad. Are you sure you do not want to try to go the PR way?

If someone takes over that will also mean that due to your git repository layout your changes cannot just be cherry-picked to Home Assistant. That means that your actual history will be lost.

@tormagj OK, Iā€™ll give it a try. I have picked up your approach and Iā€™ll try to come up with an official PR for this.

Update: Here is the PR: https://github.com/home-assistant/core/pull/32568

1 Like

@direx; thatā€™s great! Iā€™ll follow it and do some testing too!

I did not get feedback on the PR yet but after comparing @tormagjā€™s approach with my current working state I figured out that @tormagjā€™s suggested API is probably better than mine. So Iā€™ll make some changes to make sure that the service calls and player attributes match other integrations (such as Bluesound and Sonos).

This way weā€™ll also stay compatible with mini-media-player :slight_smile:

2 Likes

@direx was your PR put on hold somehow? Anything I can do to help?

I donā€™t know what is going on. As you can see I am still waiting for feedback from the integration maintainer. I just pinged him yesterday because I am stuck right now. He suggested to turn this into an ā€œarch issueā€, but I donā€™t know how to do that so I am hoping to get some assistance there from him.

He is not happy with the overall state of multiroom audio systems in Home Assistant. This is a general thing and does not really have anything to do with the HEOS integration.

I noticed and perhaps that would be a better way. However, why stop an improvement that is working if nobody is working on this better solution? I think it is sad that Heos is not fully supported in HA, thatā€™s why I tried to make an effort to improve it although my hope was that somebody more capable took it further.

U think itā€™s worth it to make a shot at trying to make a group entity and represent it is as a media_player (as far as I understood, that was the main thing?). I guess we could do it if putting in enough hours, and if necessary we could make work-around functions to support the cards we use?

Hi, I am trying to get in touch with the core HASS devs on the discord channel. Maybe they have some hints on how to solve this pickle we are in right now.

In the discord dev channel I was told how to raise an arch issue. Here is the issue: https://github.com/home-assistant/architecture/issues/364

Letā€™s see what the core devs think about this.

2 Likes

Great work @direx, I left a comment as well, hope it is ok. Iā€™m willing to do both development and testing if needed! Looking forward to getting official group support to our beloved HEOS!

1 Like

Is there a way to use this custom component with mini-media-player custom card?

For reference, I get an error like this when I try to group HEOS speakers together:

Failed to call service media_player/heos_JOIN. Unable to find service media_player/heos_join

Please ignore. I had an old version of mini-media-player. All good now, thaks!

@moralsnipe; glad you got it working. Please remember to give a vote on this feature request (on the top here) to increase the probability for getting official support for this.

1 Like

iā€™m having the same issue here, using mini media player v1.7.0 - any hints on how you fixed it?

LE: seems that i was including mini-media-player.js instead of mini-media-player-bundle.js - not sure if it was a browser cache issue or not, but including the bundle seems to work now

LE2: would be awesome for this mod to be HACS compatible :grin:

I just joined the home assistant community and am very happy to see that there is this hack to have grouping working for HEOS. This is neccesary for me when I want to use my HEOS 1 in the bathroom to listen to the DAB tuner integrated in my Denon AVR.
Thank you for the efforts for making this a standard solution. I see that it is a long and tedious effort. I hope you will succeed.

FYI I noticed that the logs show some errors, I think itā€™s mostly related to me not understanding how this worked and clicking too frequently before I understood that I needed to be a bit patient to see the result of my clicks resulting in a change:

  • Unable to join: Command not executed
  • Unable to join: Processing previous command
  • Unable to unjoin: Command not executed

Hi! I just saw this error myself yesterday, think something must have changed because it didnā€™t use to behave like this. Iā€™ll have a look into it. Just did a quick test now, and it seems to be joining fine and the problem is only related to unjoining? Is this the case on your system too?

1 Like

Hello,
So far Iā€™ve been able to produce the errors in the following circumstances using the custom mini player:

Both my heos devices are allready grouped and then I click group all:
ERROR (MainThread) [custom_components.heos.services] Unable to join: Command not executed
This is not a true error in my view. There is nothing left to group (ideally the group all button should be greyed out).

I click the group all button twice:
ERROR (MainThread) [custom_components.heos.services] Unable to join: Processing previous command

I click the leave button (what is this button supposed to do??):
ERROR (MainThread) [custom_components.heos.services] Unable to unjoin: Command not executed
As I donā€™t know what this button is supposed to do, I cannot judge the error.

I click the ungroup all button twice:
ERROR (MainThread) [custom_components.heos.services] Unable to unjoin: Missing Command arguments (3)
I assume the second ungroup action doesnā€™t know what do do as there is no group anymore.

None of these errors seem very problematic.

FYI for those who only have two HEOS devices, it could be interesting to have a swich to group or ungroup.
This is the code to accomplish that:

switch:
  - platform: template
    switches:
      groep_heos:
        friendly_name: Group HEOS
        value_template: "{{ state_attr('media_player.livingkeukenheos', 'heos_group') | length > 1 }}"
        turn_on:
          service: heos.join
          data:
            master: media_player.livingkeukenheos
            entity_id: media_player.bathroom
        turn_off:
          service: heos.unjoin
          data:
            entity_id: media_player.bathroom

@KoltesPunti, can you share your card code with me?