Kostal not working via config file

Hi,

I run into the same problem. My Kostal (2x) with V5.44 (bewährte Generation) are not getting online with 2.1 or 2.2 on a Windows VM. I can connect to the via there webUI, but the item line that was working fine with 2.0 is now producing a thing that has a communication error. Is there something changed on the Kostal Binding because of the new Kostal inverter generation and do I have to connect via http or an older binding?

Thanks.

Hi,
just to be shure, I have not done any changes with this bundle.
The bundle I am relating to earlier in this topic is still just running locally in my very own system. If I manage to make it work as wanted it might some day be finished for public use, but I am really not there yet.

I had to redesign because my Kostal inverter is an PIKO Inverters - the new generation, PIKO Wechselrichter - die neue generation and they have then, for a year ago, a totally different communication due to PIKO Inverters - the proven generation, PIKO Wechselrichter - die bewährte generation.

I am right now in a little hurry, but I will do my best asap to see if I somehow can try to figure out som way for you to check if there is the very same communication for your inverter as to mine in these days. I will remember that you can see differences in the source code.
Try to right-click when you are connected to the webUI and then CTRL+U. I do think that we then can compare our code and maybe then find some useful info, or at least some differences or not.

Regards Örjan

Hi,

yes I´m in contact with Kostal because of my Apple network and at the beginning this wasn’t´t working because of a not implemented bonjour.
Till this I´m a tester for there software.

The “bewährte Generation” will stay/frozen at 5.44. There will be no updates anymore and Version 6 is not supported anymore on this generation. They had problems with the software on this and had to replace the motherboard at all users who are fast enough to install it before they could revoke it from there website.

So there must be in the future a old and a new binding. The old one can´t be removed because of all old inverters won´t get the new 6 UI structure.

Regards

Jens

To the topic that the binding wasn’t working in the Windows VM: Thats right. Had to install a Unix VM (CentOS) and install openhab2 new and the binding works like it should.

Or make it backwards compatible with a special configuration option like:

kostal.things

support_old_devices = true

I just think we dont want two binding kostal_old and kostal_new.
Since these devices will be running for many years and properbly not see any update after a few years there will be many more devices in the future that cannot be updated to the latest version.

Maybe the binding will need special support for every major version.

kostal.things

software_version = 5.44
# or
software_version = 6.0
# or
software_version = 7.x

just my 2 cents. :wink:

Hi!
I have now managed to redesign the bundle for kostal.
The new one is working with the inverters regarding to New Generation, as is the type I have. I have not done any changes to the existing code for the older inverters.

I have done an switch in the code so it’s possible to make a change in x.things as below to use the very same bundle for both type’s.
kostalinverter:kostalinverter:inverter [ url=“http://192.168.1.x”,type=“new_generation”]

or
kostalinverter:kostalinverter:inverter [ url=“http://192.168.1.x”,type=“proven_generation”]

To test if an inverter will remain to the new_generation it’s possible to in an web-browser send the following link to the actual inverter,
http://192.168.1.x/api/dxs.json?dxsEntries=67109120&dxsEntries=251658753&dxsEntries=251658754&dxsEntries=16780032

and the inverter should then answer as,
{“dxsEntries”:[{“dxsId”:67109120,“value”:7811.751465},{“dxsId”:251658753,“value”:5933.915527},{“dxsId”:251658754,“value”:16414.169922},{“dxsId”:16780032,“value”:3}],“session”:{“sessionId”:0,“roleId”:0},“status”:{“code”:0}}

which is as I understand an JSON-object.

Then finally an question, I am now trying to make this code to an official bundle as described in “Include the Binding in the Build and the Distro” but I have then turned in to some trouble.
When I do the command mvn clean install I got an answer like:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.24.0:compile (default-compile) on project org.openhab.binding.kostalinverter: Compilation failure: Compilation failure:
[ERROR] /home/basse/openhab2-master/git/openhab2-addons/addons/binding/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/kostal/inverter/WebscrapeHandler.java:[19]
[ERROR] import java.util.Base64;
[ERROR] ^^^^^^^^^^^^^^^^
[ERROR] The import java.util.Base64 cannot be resolved
[ERROR] /home/basse/openhab2-master/git/openhab2-addons/addons/binding/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/kostal/inverter/WebscrapeHandler.java:[183]
[ERROR] String base64login = new String(Base64.getEncoder().encode(login.getBytes()));
[ERROR] ^^^^^^
[ERROR] Base64 cannot be resolved
[ERROR] 2 problems (2 errors)
[ERROR] -> [Help 1]

I have no faultmessages or whatever in the IDE and the bundle works when I start it from there, and I have even moved it to another openHAB2 system running on an another laptop and everything works as expected.

So I do need som help with this issue!

Regards Basse

1 Like

Hi,

yesterday we have installed my new PIKO 2.5 MP.
I am running Openhabian with OH2.2
I copied https://github.com/basse04/openHAB-Kostal-Inverter-New-Generation/blob/master/org.openhab.binding.kostal.inverter/target/org.openhab.binding.kostalinverter-2.3.2-SNAPSHOT.jar to my adons folder,
and this Kostal.Things file:

Thing kostalinverter:kostalinverter:inverter [ url="http://192.168.178.53",type="new_generation"]

I also tried with User/PW

Thing kostalinverter:kostalinverter:inverter [ url="http://192.168.178.53",userName="pvserver", password="pvwr",type="new_generation"]

but I don’t get it online :frowning:
I always get Thin Kostal Inverter uninitialized

What is wrong? Does this new binding not work together with OH2.2?

Holger

Hi,

I copied the above linked …2.3.2 Snapshot into the addons folder and for me the overworked binding works perfect. Thanks a lot for it!

However, I have in addition an BYD energy storage connected to the Kostal inverter and from there some additional parameters for charging/discharging the battery, the voltage, the charging level, …

Is there any chance to read in those parameters also?

Greets,
Tobias

Hi,
Thanks, nice that you like it.
I will remember that I had some problems to add more then 23 different ID’s(dxsEntries)
But It should be possible to change some of them.

Today are the following entries:
dxsEntries[0] = “67109120”;
dxsEntries[1] = “251658753”;
dxsEntries[2] = “251658754”;
dxsEntries[3] = “33555202”;
dxsEntries[4] = “33555201”;
dxsEntries[5] = “33555203”;
dxsEntries[6] = “33555458”;
dxsEntries[7] = “33555457”;
dxsEntries[8] = “33555459”;
dxsEntries[9] = “33555714”;
dxsEntries[10] = “33555713”;
dxsEntries[11] = “33555715”;
dxsEntries[12] = “67109378”;
dxsEntries[13] = “67109377”;
dxsEntries[14] = “67109379”;
dxsEntries[15] = “67109634”;
dxsEntries[16] = “67109633”;
dxsEntries[17] = “67109635”;
dxsEntries[18] = “67109890”;
dxsEntries[19] = “67109889”;
dxsEntries[20] = “67109891”;
dxsEntries[21] = “16780032”;
dxsEntries[22] = “251658496”;

If you will try to catch the different values from your inverter, you can do as:
http://kostal.ip/api/dxs.json?dxsEntries=251658754&dxsEntries=251658753

and then just change the dxsEntries as you like from below.

I myself does not have any battery so if you test and let me know if it works as expected.
And if it does, maybe we can switch some entries to the ones that are more needed.

Below is a list with different dxsEntries that as I suppose, it will be possible to use.

Rad dxsId
16855 kbApp.navigation, kbApp.navigation.services, kbApp.navigation.controllers, kbApp.navigation.directives, kbApp.pages.current-values.analog-inputs. http://‘inverter-ip’/#/current-values/analog-inputs
16857 Analog1 167772417
16859 Analog2 167772673
16861 Analog3 167772929
16863 Analog4 167773185

kbApp.pages.current-values.battery, current-values-batteryCtrl
16874 Charge 33556229
16876 Current 33556238
16878 CurrentDir 33556230
16880 ChargeCycles 33556228
16882 Temperature 33556227

16889 kbApp.pages.current-values.grid,kbAppProperties. http://‘inverter-ip’/#/current-values/grid
16892 GridOutputPower 67109120 AC Power, TD = 4
16893 GridFreq 67110400
16895 GridCosPhi 67110656
16897 GridLimitation 67110144
16899 GridVoltageL1 67109378
16901 GridCurrentL1 67109377
16903 GridPowerL1 67109379
16905 GridVoltageL2 67109634
16907 GridCurrentL2 67109633
16909 GridPowerL2 67109635
16911 GridVoltageL3 67109890
16913 GridCurrentL3 67109889
16915 GridPowerL3 67109891

16922 kbApp.pages.current-values.home. http://‘inverter-ip’/#/current-values/home
16924 AktHomeConsumptionSolar 83886336
16926 AktHomeConsumptionBat 83886592
16928 AktHomeConsumptionGrid 83886848
16930 PhaseSelHomeConsumpL1 83887106
16932 PhaseSelHomeConsumpL2 83887362
16934 PhaseSelHomeConsumpL3 83887618

16941 kbApp.pages.current-values.pv-generator, kbAppProperties http://‘inverter-ip’/#/current-values/pv-generator
16943 dc1Voltage 33555202
16945 dc1Current 33555201
16947 dc1Power 33555203
16949 dc2Voltage 33555458
16951 dc2Current 33555457
16953 dc2Power 33555459
16955 dc3Voltage 33555714
16957 dc3Current 33555713
16959 dc3Power 33555715

16966 kbApp.pages.current-values.s0-in http://‘inverter-ip’/#/current-values/s0-in
16968 S0InPulseCnt 184549632
16970 Loginterval 150995968

16990 kbApp.pages.home, kbAppProperties http://‘inverter-ip’/#/home
16992 dcPowerPV 33556736
16994 acPower 67109120 AC Power, TD = 4
16998 ownConsumption 33556229
17000 batStateOfCharge 16780032 Solar Status, TD = 13

17067 kbApp.pages.info.versions http://‘inverter-ip’/#/info/versions
17069 VersionUI 16779267
17071 VersionFW 16779265
17073 VersionHW 16779266
17075 VersionPAR 16779268
17077 SerialNumber 16777728
17079 ArticelNumber 16777472
17081 CountrySettingsName 16779522
17083 CountrySettingsVersion 16779521

17159 kbApp.pages.settings.battery-configuration, kbAppPageService
17163 chargeTimeEnd 33556240
17165 maintenanceCharge 33556236
17167 feedInSetting 33556237

17192 kbApp.pages.settings.communication.inverter-address, kbAppPageService, kbAppProperties http://‘inverter-ip’/#/settings/communication/inverter-address
17194 inverterAddress 117441025

17211 kbApp.pages.settings.communication.modem, kbAppPageService, kbAppProperties
17213 publicLineNum 117441282
17215 gsmPin 117441283
17218 gsmSigQual 117441284

17261 kbApp.pages.settings.communication.network, kbAppPageService http://‘inverter-ip’/#/settings/communication/network
17263 settingIpAuto 117440769
17265 settingIp1 117440770
17267 settingIp2 117440771
17269 settingIp3 117440772
17271 settingIp4 117440773
17273 settingSubnetmask1 117440774
17275 settingSubnetmask2 117440775
17277 settingSubnetmask3 117440776
17279 settingSubnetmask4 117440777
17281 settingGateway1 117440779
17283 settingGateway2 117440780
17285 settingGateway3 117440781
17287 settingGateway4 117440782
17289 settingExtGateway 117440778
17291 dns2_1 117440787
17291 dns2_2 117440788
17291 dns2_3 117440789
17291 dns2_4 117440790
17299 netInfoIp1 117440791
17301 netInfoIp2 117440792
17303 netInfoIp3 117440793
17305 netInfoIp4 117440794
17307 netInfoSubnetmask1 117440795
17309 netInfoSubnetmask2 117440796
17311 netInfoSubnetmask3 117440797
17313 netInfoSubnetmask4 117440798
17315 netInfoGateway1 117440799
17317 netInfoGateway1 117440800
17319 netInfoGateway1 117440801
17321 netInfoGateway1 117440802
17323 netInfoDns1_1 117440803
17325 netInfoDns1_2 117440804
17327 netInfoDns1_3 117440805
17329 netInfoDns1_4 117440806
17331 netInfoDns2_1 117440807
17333 netInfoDns2_2 117440808
17335 netInfoDns2_3 117440809
17337 netInfoDns2_4 117440810

17358 kbApp.pages.settings.communication.rs485, kbAppPageService, kbAppProperties. http://‘inverter-ip’/#/settings/communication/rs485
17339 netInfoMacAddress 117440811
17360 inverterAddress 117441025
17362 rs485Termination 117441027
17364 rs485Preload 117441026
17368 rs485Baudrate 117441029
17411 selLoginterval 150995968

17428 kbApp.pages.settings.general.date-time, kbAppPageService. http://‘inverter-ip’/#/settings/general/date-time
17430 unixTimestamp 268436225

17457 kbApp.pages.settings.general.inverter-name, kbAppPageService, kbAppProperties. http://‘inverter-ip’/#/settings/general/inverter-name
17459 InverterName 16777984

17493 kbApp.pages.settings.portal-configuration, kbAppPageService. http://‘inverter-ip’/#/settings/portal-configuration
17495 portalCode 117441537
17498 portalExport 117441539
17500 portalName 117441538
17502 lastPortalCon 117441542

17521 kbApp.pages.settings.string-configuration, kbAppPageService.
17523 parallelConnection 33556481

17540 kbApp.pages.settings.switching-output, kbAppPageService, kbAppProperties
17542 S0Function 201326848
17544 OwnConsumpCtrlFunction 201327105
17546 DelayError 201327113
17548 DelayErrorEnable 201327106
17550 Fc1PowerThreshold 201327107
17552 Fc1ExceedTime 201327108
17554 Fc1Runtime 201327109
17556 Fc1MaxActivationsDay 201327110
17558 Fc2ThresholdOn 201327111
17560 Fc2ThresholdOff 201327112
17562 UseBattery 201327114

17591 kbApp.pages.statistics.day, kbAppProperties. http://‘inverter-ip’/#/statistics/day
17593 Yield 251658754 Solar Energy Day, TD = 10.
17595 HomeConsumption 251659010
17597 OwnConsumption 251659266
17599 OwnConsRate 251659278
17601 AutonomyDegree 251659279

17621 kbApp.pages.statistics.total, kbAppProperties. http://‘inverter-ip’/#/statistics/total
17623 Yield 251658753 Solar Total Energy, TD = 7.
17625 OperatingTime 251658496
17627 HomeConsumption 251659009
17629 OwnConsumption 251659265
17631 OwnConsRate 251659280
17633 AutonomyDegree 251659281

Best Regards Basse

Hi Basse,

Thanks for sharing this interesting overview. All queries I tested worked very well and were correct.

However, it seems that I´m interested in quite different values. I would like to read out the following parameters:

  • 16874 Charge 33556229
  • 16876 Current 33556238
  • 16878 CurrentDir 33556230
  • 16882 Temperature 33556227
  • 16892 GridOutputPower 67109120 AC Power, TD = 4
  • 16924 AktHomeConsumptionSolar 83886336
  • 16926 AktHomeConsumptionBat 83886592
  • 16928 AktHomeConsumptionGrid 83886848
  • 16992 dcPowerPV 33556736
  • 17000 batStateOfCharge 16780032 Solar Status, TD = 13
  • 17593 Yield 251658754 Solar Energy Day, TD = 10.
  • 17595 HomeConsumption 251659010
  • 17597 OwnConsumption 251659266
  • 17599 OwnConsRate 251659278
  • 17601 AutonomyDegree 251659279
  • 17623 Yield 251658753 Solar Total Energy, TD = 7.
  • 17625 OperatingTime 251658496
  • 17627 HomeConsumption 251659009
  • 17629 OwnConsumption 251659265
  • 17631 OwnConsRate 251659280
  • 17633 AutonomyDegree 251659281

Are the parameters hardcoded which can be read by the binding or is it possible to change a reference table by myself to get it out?

With best regards,
Tobias

Hi!
They are today hardcoded, but to have them configureable from an config-file is in my todolist, and I have right know started to implement this option in the binding.
So I will be back asap, this is not my profession but of course will I do my very best to have it ready soon.
Best Regards Basse

1 Like

Thank you for the revision of the binding. Now I can also query my Kostal inverters.
Good job! :grin:

Hi!
Yet another redesigned binding, this one with possibilities to choose your own channels .
I have just tested it in the IDE so far and it seems to work, so it will be very nice to see if it works as expected even outside mine IDE.

See:

I see that this is also revision …2.3.2 SNAPSHOT, I do need some help to figure out how to change the revision. I have edit in pom.xml and MANIFEST.MF to …2.3.3 but that will not have any impact on the .jar

Best Regards Basse

Hi Basse,
I´m very looking forward to try it out. However, could you please provide a small instruction about how to install it for unexperienced users like myself. Last time with the .jar file I could handle it. But on GitHub I see only a batch of file with even different .jar files included but nothing called like “org.openhab.binding.kostalinverter-2.3.3-SNAPSHOT.jar” or somehow comparable.

Best regards, Tobias

Hi,
I still trying to understand Maven,
But so far have I made an binding that hopefully works as expected.
So if you Please, connect to basse04/ openhab-Kostal-Inverter-New-Generation-Optional-Channels,
will there be the code-files and also an org.openhab.kostalinverter.jar and this jar is the one you can try to use.
This one has a rev. like 2.4.0
So just click on this file and click the button Download, and it will be downloaded.
There are some examples in file README.md.
And as usual, just let me know if there is anything I can be helpful with.

Best Regards Basse

Hi Basse,
It looks like that I need your help.

After trying it out back and forth, I found out the following:

When deleting the former Kostal binding and adding the new one, the items created by Paper UI work, although a failure message appears. The other ones, defined by the configuration file I couldn´t get up and running yet.

The following warning gets listed in the log:

2018-10-14 22:44:27.321 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.kostalinverter.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.kostalinverter [233]

  Unresolved requirement: Import-Package: com.google.gson; version="2.8.2"

	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]

	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]

When deleting the binding, restarting and then adding the new one, it doesn´t work at all.

When putting in the old one, it works again properly.

Besides that I have another question. Can I see somehow if the configuration file got properly loaded and is OK? E.g., should I see the own defined Channels in PaperUI or will there always be the standard ones?

Best regards, Tobias

Hi!
So far so good,
about the warnings, I hope that I have found an solution to not have them anymore. There was an import too much.

Regarding the Channels so will you always see them as dxsEntries_0 ++, Ex. from Paper UI, Configuration > Things > Kostal Inverter


dxsEntries_0

kostalinverter:kostalinverter:inverter:dxsEntries_0

Number

I have not yet made it possible to see if the config-file is loaded, I will do my best to find a way to handle it. I let you know. So far is the only way to see if the config is loaded correct, that it then will be values presented as expected for each configured Channel.

Please, try the new binding and let me know about the result.

Best Regards Basse

Hi Basse,

Sounds good. Can you please provide a direct link again to the .jar file or is there a general rule about how to find it?

Regards

Hi,
try with https://github.com/basse04/openhab-Kostal-New-Generation-Optional-Channels

//Basse

Hi Basse,

It looks to me that the new .jar file doesn´t get loaded. When deleting and adding it, I believe it continuous to run on the old one. When restarting it doesn´t get online. It is not listed in Puper UI.

Tobias