[HEOS] HEOS binding goes haywire

HI!

Currently, I have 7 HEOS devices, all connected through Wi-Fi, and the system works pretty steadily with the HEOS app. However, the binding is a different story, unfortunately. Especially when it comes to groups.

My inbox is full of random groups; some are just randomly grouped players, while others have all players but in a different order. I see the same weirdness with dynamic channels on the bridge (0 - 7 players after every binding restart).

From the HEOS app, I activated the “All Rooms” preset and added that group as a group thing in OH. This group thing has a couple of issues: one is that it does not respect the group leader (known issue apparently: [heos] creating groups via Heos Group Thing does not respect Group leader · Issue #13113 · openhab/openhab-addons · GitHub), and another is that it goes randomly online and offline for unknown reasons.

From time to time, I see exceptions:

[ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.heos.internal.handler.HeosPlayerHandler@67414cd0': java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397) ~[bundleFile:?]
        at com.google.gson.Gson.fromJson(Gson.java:1227) ~[bundleFile:?]
        at com.google.gson.Gson.fromJson(Gson.java:1329) ~[bundleFile:?]
        at com.google.gson.Gson.fromJson(Gson.java:1271) ~[bundleFile:?]
        at org.openhab.binding.heos.internal.json.HeosJsonParser.postProcess(HeosJsonParser.java:64) ~[?:?]
        at org.openhab.binding.heos.internal.json.HeosJsonParser.parseResponse(HeosJsonParser.java:60) ~[?:?]
        at org.openhab.binding.heos.internal.resources.HeosSendCommand.send(HeosSendCommand.java:51) ~[?:?] 
        at org.openhab.binding.heos.internal.api.HeosSystem.send(HeosSystem.java:159) ~[?:?]
        at org.openhab.binding.heos.internal.api.HeosSystem.send(HeosSystem.java:155) ~[?:?]
        at org.openhab.binding.heos.internal.api.HeosFacade.setVolume(HeosFacade.java:216) ~[?:?]
        at org.openhab.binding.heos.internal.handler.HeosChannelHandlerVolume.handlePlayerCommand(HeosChannelHandlerVolume.java:55) ~[?:?]
        at org.openhab.binding.heos.internal.handler.HeosPlayerHandler.handleCommand(HeosPlayerHandler.java:67) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor71.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
        at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at jdk.proxy1023.$Proxy1171.handleCommand(Unknown Source) [?:?]
        at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:95) [bundleFile:?]
        at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [bundleFile:?]
        at jdk.internal.reflect.GeneratedMethodAccessor70.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $
        at com.google.gson.internal.bind.JsonTreeReader.expect(JsonTreeReader.java:165) ~[bundleFile:?]
        at com.google.gson.internal.bind.JsonTreeReader.beginObject(JsonTreeReader.java:89) ~[bundleFile:?]
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:386) ~[bundleFile:?]
        ... 28 more

or warnings:

[core.thing.internal.ThingManagerImpl] - Failed to normalize configuration for new thing during update 'heos:bridge:e39e157f92': {thing/channel=Type description heos:chPlayer for heos:bridge:e39e157f92:P1612261504 not found, although we checked the presence before.}

Is this behavior unique to me, or does anyone else experience the same issues? Can anyone point me in the right direction to fix this?

Any help is greatly appreciated!

For completeness:
openHAB 4.3.3 (Release Build)
Running on a dedicated Ubuntu box (Dell optiplex 3040, Intel i3, 16GB ram)
“Official” HEOS binding from the addon store
7 HEOS devices, HS1 and HS2 (couldn’t find a pattern or relation to hs1/2), latest firmware available

[edit]

When I try to play a radio station from my favorites I see this error in my logs:

[ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.heos.internal.handler.HeosPlayerHandler@6991ccd7': Cannot invoke "java.util.List.stream()" because the return value of "java.util.Map.get(Object)" is null
java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of "java.util.Map.get(Object)" is null
        at org.openhab.binding.heos.internal.handler.HeosDynamicStateDescriptionProvider.getValueByLabel(HeosDynamicStateDescriptionProvider.java:42) ~[?:?]
        at org.openhab.binding.heos.internal.handler.HeosChannelHandlerFavorite.handleCommand(HeosChannelHandlerFavorite.java:71) ~[?:?]
        at org.openhab.binding.heos.internal.handler.HeosChannelHandlerFavorite.handlePlayerCommand(HeosChannelHandlerFavorite.java:47) ~[?:?]
        at org.openhab.binding.heos.internal.handler.HeosPlayerHandler.handleCommand(HeosPlayerHandler.java:67) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor66.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
        at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at jdk.proxy3084.$Proxy3235.handleCommand(Unknown Source) [?:?]
        at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:95) [bundleFile:?]
        at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [bundleFile:?]
        at jdk.internal.reflect.GeneratedMethodAccessor65.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]

Restarting the binding doesn’t help. I have to stop OH, clear the cache and restart OH.

Does anybody know what I can do to fix this?