Heos (Denon) support

The updated file can be downloaded here:

Please test this release an give me a feedback if everything works as expected.

Wire82

@Wire82
Hi! I just installed the updated jar and according to my quick test it seems to be working perfectly.
Thanks a lot for your work! :smile:

Are you going to create a PR for this fix in the openhab-addons repo?

Yes. I already prepared it but had no time to test the changes more than a few minutes.
But as soon as I’m sure that all things are working I will issue a PR.

Thanks for your feedback. Glad that this works now. :slight_smile:

Hi

I have dropped your new JAR file in and Karaf reports :

error executing command: Error executing command on bundles:    
Error starting bundle 268: Could not resolve module: 
org.openhab.binding.heos 
 

Error executing command: Error executing command on bundles:    Error starting bundle 268:
Could not resolve module: org.openhab.binding.heos


Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

So I tried this, but it wasn’t happy either

bundle:install org.eclipse.smarthome.io.transport.upnp

Or

feature:install esh-io-transport-upnp

I got this error

Error executing command: Error installing bundles:
     Unable to install bundle org.eclipse.smarthome.io.transport.upnp: org.osgi.framework.BundleException: Error reading bundle content.

As a work around, I have added the Hue binding, as it was suggested that it installs the required upnp bundle

Okay thanks!
I also started to debug my biggest problem right now with the binding, that after some time the states are not updated… Hope I will find something.
Do you think that Debug level is enough for this? Are events logged on debug when the connection is lost ?
Basically now I can see every few seconds that a heartbeat is sent. If I can remember correctly, previously when the binding stops refreshing these events are gone. Now I want to debug further and see when the last heartbeat is sent, are there any other events right before it, which might help understand why it stops…

Hi thanks for your message
This is also something I would recommend to do. Installing the hue binding solves the issue.
I don`t know why but if you installing this binding with an external .jar file I also get an issue but installing the hue binding helps.
But I got a different error message with another Package missing:

Unresolved requirement: Import-Package: org.apache.commons.net.telnet; version="[3.3.0,4.0.0)"

If installing the binding right out of OpenHAB this doesn’t seems to be a problem.
So for me it doesn’t seems to be very predictable what causes the error

Hi. Yes normally DEBUG should be enough.
If the connection is lost you should see something like:

2020-01-05 19:09:57.194 [DEBUG] [binding.heos.internal.api.HeosSystem] - Connection to HEOS Network lost!

2020-01-05 19:09:57.206 [DEBUG] [binding.heos.internal.api.HeosSystem] - Shutting down HEOS Heart Beat

2020-01-05 19:09:57.220 [DEBUG] [binding.heos.internal.api.HeosSystem] - Stopping HEOS event line listener

2020-01-05 19:09:57.233 [DEBUG] [binding.heos.internal.api.HeosSystem] - HEOS event line is still open closing it....

2020-01-05 19:09:58.286 [DEBUG] [binding.heos.internal.api.HeosSystem] - Sending Command: heos://system/register_for_change_events?enable=off

2020-01-05 19:10:01.294 [DEBUG] [binding.heos.internal.api.HeosSystem] - HEOS System read failure during response. message: Can not read from client

2020-01-05 19:10:01.300 [DEBUG] [binding.heos.internal.api.HeosSystem] - HEOS failed command: heos://system/register_for_change_events?enable=off

2020-01-05 19:10:01.307 [DEBUG] [binding.heos.internal.api.HeosSystem] - HEOS System trys to send command again....

2020-01-05 19:10:01.313 [DEBUG] [binding.heos.internal.api.HeosSystem] - Sending Command: heos://system/register_for_change_events?enable=off

2020-01-05 19:10:01.322 [DEBUG] [binding.heos.internal.api.HeosSystem] - IO Exception during send HEOS command with message: Datenübergabe unterbrochen (broken pipe) (Write failed)

2020-01-05 19:10:01.629 [DEBUG] [binding.heos.internal.api.HeosSystem] - Disconnecting HEOS event line
2020-01-05 19:10:01.663 [DEBUG] [binding.heos.internal.api.HeosSystem] - Reconnecting to Bridge with IP 192.168.0.4 @ port 1255

The issue I have is that I don’t know the problem. On my side binding is running over weeks without an issues regarding updating the states.

Ok, I will try to debug this.
Very randomly it just loses state updates. So I can’t see the currently played song name, artist, Control just stays at pause. However control is working (so I can for example start a favorite radio channel) and it will start it (it will even build a group of players and start on that one), but will not give any feedback on the current state. Sometimes it works for days, sometimes only a few hours.
Executing a bundle:refresh on the binding through the console solves this problem (so I think that this is clearly a problem somewhere in the binding, plus HEOS app works always).
Also my Bridge (which is an AVR) is connected through a wired connection, so there shouldn’t be any kind of wireless problem or something like that.

Hi

This isn’t anything too serious.

Apparently, when a binding is added to the main system, the maintainer can state dependencies.

Whereas when we drop Jar files into the Add-on folder, it is up to ‘us’ to ensure the dependencies are met.

I’ve learnt that on this occasion, the upnp bundle is required.

Which is also a dependency of the Hue Binding, so installing that will resolve this issue.

Reference -----

@MDAR
Another way to resolve the dependency problem is to just leave the original PaperUI-HEOS binding installed and then disable it in the Karaf console. Then all dependencies are installed and you just have to drop the new .jar in the addons folder.

Now that’s a good trick :slight_smile:

thanks for the update, works great (after uninstalling from paper ui and installing upnp, all via addons.cfg)

although the creation/linking of items still doesn’t work in paper ui, but config files are fine for me

@jakaZ
I’m running OH2.5 and can link items easily in PaperUI


But saying that, I have just added my HEOS login and PaperUi now reveals my Favorites, which PaperUI doesn’t seem to want to link.

However, I have noticed that the “Profile” list box is empty, so I can’t select a profile, which may be why PaperUI can’t link the items.

@Wire82
Now this is strange . Since I enabled debug logging (more than 2 days now). It works as it should. I can’t remember in the near future that it worked for more than 1 day.
I will leave it as it is now and maybe after a few days again I will turn off logging and see what happens.

@Wire82
“Finally” it stopped updating. The last message from HEOS was this:

2020-01-08 12:56:11.448 [DEBUG] [binding.heos.internal.api.HeosSystem] - Sending Heos Heart Beat
2020-01-08 12:56:16.034 [DEBUG] [binding.heos.internal.api.HeosSystem] - Failure during HEOS Heart Beat command with message: Can not read from client
2020-01-08 12:56:16.366 [DEBUG] [binding.heos.internal.api.HeosSystem] - Shutting down HEOS Heart Beat
2020-01-08 12:56:16.369 [DEBUG] [binding.heos.internal.api.HeosSystem] - Stopping HEOS event line listener
2020-01-08 12:56:16.374 [DEBUG] [binding.heos.internal.api.HeosSystem] - HEOS event line is still open closing it....
2020-01-08 12:56:16.380 [DEBUG] [binding.heos.internal.api.HeosSystem] - Sending Command: heos://system/register_for_change_events?enable=off
2020-01-08 12:56:16.390 [DEBUG] [eos.internal.api.HeosEventController] - HEOS send response: {"heos": {"command": "system/register_for_change_events", "result": "success", "message": "enable=off"}}
2020-01-08 12:56:16.693 [DEBUG] [binding.heos.internal.api.HeosSystem] - Disconnecting HEOS event line

Since then there is no heart_beats or anything, but if you issue a command it will send it to the device.
It looks like the connection is lost, and it won’t restore it…
And it stops here. Looking at the code, it should also close the command line and then retry connecting. However it stops here…

This helps you somehow to debug this?

Yes this helps. I think I know where it stops… And I understand why you are still able to send commands but you are not able to receive updated.
There are to connections to the HEOS system. One connection (the event line) receives the updates from the HEOS system and updates the states, and on line (the command line) which send the commands.
If the binding shall close the connection it starts with closing the event line first and second the command line. But in your case is seems that the system is not able to close the event line, and stuck there without restarting the connection.
I will have a closer look into it and give you some feedback.

Yes I already saw that there is two (Telnet object) connection.
Which I couldn’t understand, that where it stops, hope you can find something…

What I would like to do is sending you a version of the binding with some additional DEBUG messages. Do you think you can try this one and send me the log? This should give me some more information where it stops?
Thanks. :slight_smile: