Binding Request : Buderus web gateway

@Markinus @Oggerschummer

thank you very much for all the feedback, I finally got some time to look at all the things and tried them myself. After getting rid of all the installation, bindings, clearing cache and tmp, restarting all an re-installing I always end up at the same point in the logs again (and I have been drinking lots of tea and coffee to wait for it to connect :wink: ):

12:47:02.197 [INFO ] [smarthome.event.InboxRemovedEvent ] - Discovery Result with UID ‘km200:kmdevice:617200032’ has been removed.

12:47:02.202 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler KM200GatewayHandler tried updating the thing status although the handler was already disposed.

12:47:02.224 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘km200:kmdevice:617200032’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)

12:47:09.429 [INFO ] [org.quartz.core.QuartzScheduler ] - Scheduler openHAB-job-scheduler_$_NON_CLUSTERED started.

12:47:18.730 [INFO ] [smarthome.event.ThingUpdatedEvent ] - Thing ‘km200:kmdevice:617200032’ has been updated.

12:47:18.733 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘km200:kmdevice:617200032’ changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to INITIALIZING

12:47:19.935 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.km200.internal.handler.KM200GatewayHandler@67f0767c’: null

java.lang.NullPointerException: null

at org.openhab.binding.km200.internal.handler.KM200GatewayHandler.checkConfiguration(KM200GatewayHandler.java:240) ~[?:?]

at org.openhab.binding.km200.internal.handler.KM200GatewayHandler.initialize(KM200GatewayHandler.java:114) ~[?:?]

at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]

at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]

at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

12:47:19.945 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘km200:kmdevice:617200032’ changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR)

12:47:19.947 [ERROR] [.core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘km200:kmdevice:617200032’: null

java.lang.NullPointerException: null

at org.openhab.binding.km200.internal.handler.KM200GatewayHandler.checkConfiguration(KM200GatewayHandler.java:240) ~[?:?]

at org.openhab.binding.km200.internal.handler.KM200GatewayHandler.initialize(KM200GatewayHandler.java:114) ~[?:?]

at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]

at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]

at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

If I get this right one difference between your installation and mine ist the Java engine used.
I’m running Zulu, but from the log I guess you are using Oracle. Have you tried with Zulu (including the strong encryption) ?
Regards
Oggerschummer

Yes, that is right and might actually be the cause. Thank you. I have been looking at hot to add Zulu onto my Qnap system. Do you have any idea ? I am a bit cautious (event though I think that it should be ok) but if somebody has an idea on how I should do that, I would be happy to hear any recommendations.

@Oggerschummer Thank you. As often, the answer was really close and you pointed me into the right direction. I got it up and running again !

Hi,
I have done some work on this binding and found some problems releated to your last comments. There were some problems during the dispose process of this binding (same reason if you have change the configuration). In some cases you would get a “hexString needs to have an even length” error message.
It would be great if you could test the new version.
Greetings
Markinus

Hello Markus,

What I did: Stopped OH and put the binding in place plus cleared the cache.

I can confirm that, running the latest version, the binding crash when changing the refresh interval is fixed. I no longer see the “invalid key length”-error.
The binding gateway goes offline, takes the things offline and comes back. Things go online again and the values are read as before.

Well done !

Could you please merge the precision fix into this version as well ? Currently it is missing.

Kind Regards and stay safe
Oggerschummer

Hi,
thank you for the feedback.
I added a fix but a different one. I didn’t like the last one. If I’m looking to the Control-Page inside of Paper UI then all Values have the single fraction. For you too?
Greetings

Hi,
in PaperUI I see a single digit fraction, which is fine.
But within the log I see that the item values are “dancing” between single digit and multiple digits again,
which should not be the case as the heating hardware is not capable of measuring down to such a precision - It is max. a single digit fraction.

2020-04-15 10:25:34.338 [vent.ItemStateChangedEvent] - HeatSources_ActualSupplyTemperature changed from 58.099998474121094 to 59.0

2020-04-15 10:26:10.088 [vent.ItemStateChangedEvent] - HeatSources_ActualSupplyTemperature changed from 59.0 to 59.400001525878906

2020-04-15 10:26:45.868 [vent.ItemStateChangedEvent] - HeatSources_ActualSupplyTemperature changed from 59.400001525878906 to 59.0

2020-04-15 10:27:21.628 [vent.ItemStateChangedEvent] - HeatSources_ActualSupplyTemperature changed from 59.0 to 58.599998474121094

2020-04-15 10:27:57.408 [vent.ItemStateChangedEvent] - HeatSources_ActualSupplyTemperature changed from 58.599998474121094 to 58.400001525878906

2020-04-15 10:29:08.917 [vent.ItemStateChangedEvent] - HeatSources_ActualSupplyTemperature changed from 58.400001525878906 to 58.5

I compared to e.g. the Hue Binding, here I do not see the measure precision jumping in the item values:

2020-04-15 10:07:28.432 [vent.ItemStateChangedEvent] - Terrasse_Sensor_Temperatur changed from 22.33 °C to 22.75 °C

2020-04-15 10:12:28.088 [vent.ItemStateChangedEvent] - Terrasse_Sensor_Temperatur changed from 22.75 °C to 23.03 °C

2020-04-15 10:02:28.824 [vent.ItemStateChangedEvent] - Terrasse_Sensor_Temperatur changed from 22.05 °C to 22.33 °C

2020-04-15 10:07:28.432 [vent.ItemStateChangedEvent] - Terrasse_Sensor_Temperatur changed from 22.33 °C to 22.75 °C

2020-04-15 10:12:28.088 [vent.ItemStateChangedEvent] - Terrasse_Sensor_Temperatur changed from 22.75 °C to 23.03 °C

2020-04-15 10:17:27.676 [vent.ItemStateChangedEvent] - Terrasse_Sensor_Temperatur changed from 23.03 °C to 23.46 °C

So the previous fix was better from a result perspective.

Greetz,
Oggerschummer

Hi,
ok, I found now the real fraction problem and fixed it. It would be great if you could test the new version.
BTW: I had to do some optimization on the code, it would be great if you could test it as good as possible.
Greetings
Markinus

Hi,
new bugfix version, sending data was broken. version.

Greetings
Markinus

Great. Unfortunately I’m able to test it on Saturday earliest.

It would be great, I started the pull reqest…

I have put the file in the addon folder - but I cannot find a log entry that it is activated. I am still on the rest release feed with 2.5.3-1. It probably just works on 2.5.4 snapshot?

You will not see much entries there without debug. Take a look to the paperui, you will see there that the device is going offline and will be initialized from stratch.
Edit: It works with 2.5.3…
Edit2: You have to uninstall (if installed) the km200 binding from addons (inside paperui) before you can test this jar file.

You are right. I forgot that you have to uninstall before. Works great - nevertheless I did not have any issues before.

Hi Markus.
Arrives the new version in 2.5.4?
Greetings,
Markus

Hi,
it depends on how fast it can be reviewed and merged. But maybe…
Greetings

Hi,
I had the chance to take a look into the new version.
Your fix on the fraction digits is working perfectly !

2020-04-17 11:45:10.508 [vent.ItemStateChangedEvent] - Heizung_Temperatures_HotWater_t2 changed from 40.8 to 40.7

2020-04-17 11:47:34.797 [vent.ItemStateChangedEvent] - Heizung_Temperatures_HotWater_t2 changed from 40.7 to 40.8

2020-04-17 11:49:23.297 [vent.ItemStateChangedEvent] - Heizung_Temperatures_HotWater_t2 changed from 40.8 to 40.9

2020-04-17 11:53:36.725 [vent.ItemStateChangedEvent] - Heizung_Temperatures_HotWater_t2 changed from 40.9 to 40.8

Nice side effect is, that I have the impression to get less status updates in the log (not missing anyting).
Tried setting e.g. operation mode, started HW charge cycle etc.
Result: Worked smoothly.
Updating the thing settings for the gateway works fine as well.

So, from my perspective I´d give it a “go”.
Thanks for maintaining your “baby”, very much appreciated !!

One thing that is a bit messy still is the behaviour on startup, here is see warnings that the binding is trying to update things even though the handler is disposed ( same on shutdown). But this has had no serious impact up to now, so it is very low prio.

Hi,
the pull reqest ist merged now and it should be included in 2.5.4.
@Oggerschummer, thx. for the feedback and get well soon!

Greetings Markus

Just upgraded to 2.5.4 and it´s runing fine.

For those using a snapshot before:

  • Stop openhab
  • Delete the snapshot from the addons-folder
  • Upgrade to 2.5.4 (e.g. with openhabian-config)
  • Clear the cache
  • Restart openhab
  • Install the km200 Binding 2.5.4 in Paper UI