Binding Request : Buderus web gateway

I took a look to these values, “value”:-3276.8,“unitOfMeasure”:"C"
They are comming directly from device.
I think this are default values if there is not a sensor mounted and connected.
I will take a look to the conversion.

on my system the http 500 error is reproducible on every restart of openhab. Please also note the delay between the log entry where the init of /system/minOutdoorTemp happens and the http 500 error

2017-01-17 19:46:46.984 [DEBUG] [nding.km200.internal.KM200Comm] - Init: /system/minOutdoorTemp
2017-01-17 19:46:55.443 [ERROR] [nding.km200.internal.KM200Comm] - HTTP GET failed: HTTP/1.0 500 Internal Server Error
2017-01-17 19:46:55.444 [ERROR] [.b.km200.internal.KM200Binding] - Couldn't init service: SYSTEM

it’s also reproducible for /heatingCircuits

2017-01-17 19:46:29.014 [DEBUG] [nding.km200.internal.KM200Comm] - Init: /heatingCircuits/hc1/operationMode
2017-01-17 19:46:37.433 [ERROR] [nding.km200.internal.KM200Comm] - HTTP GET failed: HTTP/1.0 500 Internal Server Error
2017-01-17 19:46:37.434 [ERROR] [.b.km200.internal.KM200Binding] - Couldn't init service: HEATINGCIRCUITS

and dhwCircuits

2017-01-17 19:46:17.715 [DEBUG] [nding.km200.internal.KM200Comm] - Init: /dhwCircuits/dhw1/operationMode
2017-01-17 19:46:26.433 [ERROR] [nding.km200.internal.KM200Comm] - HTTP GET failed: HTTP/1.0 500 Internal Server Error
2017-01-17 19:46:26.434 [ERROR] [.b.km200.internal.KM200Binding] - Couldn't init service: DHWCIRCUITS

Please let me know if you need further input to trace down the root cause

Try the last one, I changed something on the data conversion. But I’m not sure whether the binding it realy the problem.

I think the problem is the performance on the KM Gataway, It seems depending on the systems it cannot be fast enough.
I added now a small workaround. If the KMDevice is throwing a error then the binding is waiting 2s and try it again.
Try it please, you should see now a WARN if this happen.
–link removed–

thank you - now I’m getting the number of services I expected, the retry leads now to a consistent initialization of all available services on my system, even though it takes sometimes 2-3 attempts to gather one of them.
With the latest version i get 223 services, before that there where only 98 - hence I think you found a reasonable approach :slight_smile:

an additional proposal - as the KM200 API also returns the unit of the actual value (see unitOfMeasure) if applicable it would be nice to add this to the list of available services output after the startup

Hi,

still getting 0.000001 off values:

2017-01-18 09:49:32.509 [ItemStateChangedEvent     ] - HeatingOutsideTemp changed from NULL to -3.7999999523162841796875
2017-01-18 09:49:32.646 [ItemStateChangedEvent     ] - HeatingSupplyTemp changed from NULL to 11.19999980926513671875

maybe limiting it to 4 decimal points would solve this not at all important issue

Ok, now every get value from device is rounded to 4. Try it.
–link removed–

There was a error, download it again.
–link removed–

Still getting this values

2017-01-18 11:50:01.818 [INFO ] [b.binding.km200.internal.KM200Device] - ##################################################################
2017-01-18 11:50:01.823 [INFO ] [.binding.km200.internal.KM200Binding] - ... Update of the KM200 Binding configuration completed
2017-01-18 11:50:01.828 [INFO ] [b.core.service.AbstractActiveService] - KM200 Binding has been started

==> /var/log/openhab2/events.log <==
2017-01-18 11:50:02.366 [ItemStateChangedEvent     ] - HeatingSupplyTemp changed from 11.19999980926513671875 to 11.3999996185302734375
2017-01-18 11:51:02.369 [ItemStateChangedEvent     ] - HeatingSupplyTemp changed from 11.3999996185302734375 to 11.19999980926513671875
2017-01-18 11:52:02.387 [ItemStateChangedEvent     ] - HeatingSupplyTemp changed from 11.19999980926513671875 to 11.3999996185302734375

with the newest version too? hmm strange…

looks like.

deleted from addons
copied over the new one
waited till completed

! I NEED HELP FROM USERS!

I made a function for automatic device detection.(OH2 preparations). In this testversion this function will be called.
You can see something like:
Device is a KMXXX geteway: 192.168.90.60
It would be great if everyone could test it whether the right IP address is discovered.

–link removed–

I did today a clean fresh installation of a oh2 on a pi3.
I copied over from another pi3 the binding and the config.

I am getting following errors:

2017-01-18 16:17:05.037 [INFO ] [.binding.km200.internal.KM200Binding] - Update KM200 Binding configuration, it takes a minute....
2017-01-18 16:17:05.042 [INFO ] [.binding.km200.internal.KM200Binding] - Starting communication test..
2017-01-18 16:17:05.095 [INFO ] [.binding.km200.internal.KM200Binding] - Deactivated
2017-01-18 16:17:05.240 [INFO ] [.binding.km200.internal.KM200Binding] - Received data..
2017-01-18 16:17:05.241 [INFO ] [.binding.km200.internal.KM200Binding] - Activated
2017-01-18 16:17:05.254 [ERROR] [hab.binding.km200.internal.KM200Comm] - Exception on encoding: {}
java.security.InvalidKeyException: Illegal key size or default parameters
	at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)[:1.8.0_60]
	at javax.crypto.Cipher.implInit(Cipher.java:801)[:1.8.0_60]
	at javax.crypto.Cipher.chooseProvider(Cipher.java:864)[:1.8.0_60]
	at javax.crypto.Cipher.init(Cipher.java:1249)[:1.8.0_60]
	at javax.crypto.Cipher.init(Cipher.java:1186)[:1.8.0_60]
	at org.openhab.binding.km200.internal.KM200Comm.decodeMessage(KM200Comm.java:260)[229:org.openhab.binding.km200:1.9.0.201701180918]
	at org.openhab.binding.km200.internal.KM200Binding.updated(KM200Binding.java:161)[229:org.openhab.binding.km200:1.9.0.201701180918]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
2017-01-18 16:17:05.257 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=389, unregistered]: Unexpected problem updating configuration org.openhab.km200
java.lang.RuntimeException: Decoding of the KM200 message is not possible!
	at org.openhab.binding.km200.internal.KM200Binding.updated(KM200Binding.java:163)[229:org.openhab.binding.km200:1.9.0.201701180918]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
2017-01-18 16:17:05.261 [INFO ] [.binding.km200.internal.KM200Binding] - Update KM200 Binding configuration, it takes a minute....
2017-01-18 16:17:05.265 [INFO ] [.binding.km200.internal.KM200Binding] - Starting communication test..
2017-01-18 16:17:05.460 [INFO ] [.binding.km200.internal.KM200Binding] - Received data..
2017-01-18 16:17:05.464 [ERROR] [hab.binding.km200.internal.KM200Comm] - Exception on encoding: {}
java.security.InvalidKeyException: Illegal key size or default parameters
	at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)[:1.8.0_60]
	at javax.crypto.Cipher.implInit(Cipher.java:801)[:1.8.0_60]
	at javax.crypto.Cipher.chooseProvider(Cipher.java:864)[:1.8.0_60]
	at javax.crypto.Cipher.init(Cipher.java:1249)[:1.8.0_60]

What did I wrong? Missed something to install?

wiki:
Important: If the communication is not working and you see in the logfile errors like “illegal key size” then you have to change the Java Cryptography Extension to the Unlimited Strength Jurisdiction.

1 Like

! I NEED HELP FROM USERS!

I made a function for automatic device detection.(OH2 preparations). In this testversion this function will be called.
You can see something like:
Device is a KMXXX geteway: 192.168.90.60
It would be great if everyone could test it whether the right IP address is discovered.

–link removed–

Can you be a more specific with the test case

You have to set the IP address. In OH2 the binding should find the device itself.
in this version I included a method to find the IP automaticly.
It works like usuall. The only change is a output in the logfile like this:
Device is a KMXXX geteway: 192.168.90.60

I want to know whether it works on users network configurations…

(Btw. don’t remove the ip4 entry from the cfg file. It’s still used for the real communication)

I can confirm that my gateway is discovered in a /24 netmask.
The discovery methodology of iterating through all ip addresses and testing them for availability of a kmxxx restful service might not scale very good and be identified as somehow offensive - think about someone having a /16 netmask where you have 65534 potential hosts in contrast to a /24 netmask (this is most probably the most common one in home environments) where you have only 254 hosts. This even gets worse in a v6 environment (which the gateways currently do not support). Especially when the IP address is already configured this test delays the startup and you might want to consider to let it only run, when nothing is configured.

Yes, it is a problem, but java doesn’t support something like icmp methods. It works only on one host. I wanted to do it with a kind of broadcast ping but it is not supportet by java :frowning: (I have all broadcast addresses of relevant private interfaces but cannot realy use it :frowning: ). UPNP is not supported by KMXXX.
I limited it to 254 addresses, /16 networks are not supported. If someone has a better idea …