Denos HEOS support

The API documentation is public and easy to understand in my opinion. We just need someone with a HEOS and python programming skills.

I have to disagree: First of all, the API’s documentation is not public. It was either reverse-engineered or leaked at best. And it’s a CLI client, which is how this sort of thing was done in the 90’s.

If you look at sonos, it’s a modern an tidy API:

That’s also why every home-automation suite offers Sonos integration. Because of the easy to use API.

For HEOS, you’re limited to products “authorized” by Denon, like control4. And if you read trough the implementation and limitations documentation, it looks like even they had a hard time implementing it.

The fact is, there’s no modern developer friendly available API available, and unless one is implemented, this will continue to be a PITA. Contact D&M / HEOS and tell them the API is decisive for you to continue with HEOS, only then they will do something about it.

I don’t want to sound like a Sonos fanboy, I have a HEOS set-up at home, but I’m pretty mad by being unable to integrate it properly with anything.

It is public… it’s right on their own website: http://rn.dmglobal.com/euheos/HEOS_CLI_ProtocolSpecification.pdf

I have to agree with you it’s not a modern API, but it’s enough to remote control it as showed by easink

2 Likes

The aioheos player from easink works. My Problem: I want to automate my speaker in the bathroom. But with the media_player the speaker in the living room goes on and off. How can i configure the heos.py script to address a specific Speaker?

Can’t seem to get the custom component from above working on hassio. It says I miss some requirements

I never get a practical solution with the heos.py script. Now i change to hassio and didn’t try again. My solution ist the harmony hub. Since the last version the harmony can control the HEOS Speaker.

I got it to work on hassio! Created a pull request for the developer

1 Like

can the heos.py script now address specific speakers, the last time i try it it can only handle one heos speaker.

I’m not sure, I only have one heos speaker myself so I can’t test. But perhaps you can add more media_players of type heos with a different name

i think the script takes the first speaker. in my case the script sometimes change the speaker. the music begin to play in the living room when ist should start in the bathroom :frowning:

It only seems to take the first speaker.
Also without the possibility to group speakers it is kind of useless.
Much easier then to use spotify as mediaplayer and connect to speakers or by using harmony activities.

Very sad that it didnt work, but having multiple speakers it just doesnt work good enough

Hi,

did anyone manage to get this installed and running (on docker)?

I did the following:

  • install with pip3
  • copy heos.py to my personal home-assistant folder ~/.homeassistant/custom_components/media_player/
    (the s had to be appended to “custom_component” to make it work)
  • upgrade with pip to install missing dependencies

Now HA realizes the new HEOS library, but it takes minutes to load again after restart. Then i see error messages in the log (socket timeout. only timeout 0 is allowed on async call - or something like that)

2 Likes

Hi,

sort of a noob with HA. there must be something i’m missing trying my heos amp working.
I copied the heos.py file over, added the aioheos library through pip, and added the info into the config file.

and i still get the error: Platform not found: media_player.heos.

Any help is greatly appreciated!

Hi everyone,

Just got my hands on a HEOS speaker, for testing… but I would like to integrate it with HA to see how well that works — while am still considering SONOS.

So my question is — does anyone know the latest status of the HEOS integration with HA?

This one works: https://github.com/easink/hass.aioheos.media_player

But overall, it’s not yet at the level it should be (like Sonos integration etc.). Only the basics are available.

Yes this works great actually. Play/pause, next/previous, volume, pictures of what’s playing etc.
You cannot, however, start playing something new from Hass, however, I found a way to do that anyway using DLNA.
You can set up a media_player device like this:

media_player:
  - platform: dlna_dmr
    url: http://<ip of the heos>:60006/upnp/desc/aios_device/aios_device.xml
    name: Heos DLNA

Next, you can play direct mp3’s or streams via an url. For instance, you can call media_player.play_media with

{ "entity_id": "media_player.heos_dlna",
  "media_content_id":"http://playerservices.live.streamtheworld.com/api/livestream-redirect/RADIO538_SC",
  "media_content_type":"music" }

And it will stream that radio station (the dutch station npo 3fm in this case). It works about the same as it would with a chromecast device. The only downsides is that you now have two media_player devices for a single device. Maybe someone could combine the two?

2 Likes

Hello Jolanrensen, did you manage to send an alternative title? My heos shows whith your script only “Home Asssitant” as media title. I have no clue where HEOS know Home Assistant btw :wink:

Apparently, someone (Jarle Hjortland) refactored it to include more features. Is there anyone who can make the changes work in HA?

This would be amazing, would love to get all the features. Thanks for pointing it out :slight_smile:

Hi,

I noticed somes troubles with my HEOS1 speakers :

  • resubcribe event always returns 412
  • volume level always display 0
  • sometimes media_player not created or unavailable
    It’s possible to fix theses problems by changing python scripts in dep directory.

1/ async_upnp_client/profile.py
Seems the subscribe maximum timeout is 9 minutes for HEOS1

SUBSCRIBE_TIMEOUT = timedelta(minutes=9)

2/ async_upnp_client/dlna.py - DlnaDmrEventContentHandler class
There are multiple mute/volume zone, have to return states variables only for master channel

if attrs.get(‘channel’) in (None, ‘Master’):
self.changes[current_instance][name] = attrs.get(‘val’)

3/ didl_lite/didl_lite.py - function from_xml_el
Sometimes HEOS speaker returns empty or unknown upnp class, function should returns none

didl_object_type = type_by_upnp_class(upnp_class.text)
if didl_object_type is None:
return None

And now the dlna_dmr is stable to handle 2 HEOS speakers…
Hope that’s help.