Integrating Kostal Inverter using httpbinding and json

Kostal Inverters with older firmware can be integrated into OpenHab with the Kostal Inverter Binding:

At some point, Kostal have changed the firmware and the “old” binding does not work with the latest firmwares/models.
There is a new binding in development:

But you can also integrate your Kostal inverter without the special kostal binding. You just need the “HTTP Binding” and “JSONPath Transformation”.

Let’s have a look on how this can be done:
With the new firmware, you can get the values from your Kostal inverter via json.
You just have to call like this:


The last part called “dxsEntries” is the interesting part. This specifies which value we want to get from the Kostal inverter.

If you want to get more than one value, you can combine “dxsEntries” like this:


So how do we find out which dxEntries values are available?
I opened the webinterface of my Kostal Inverter using Mozilla Firefox and then used the “network analysis view” to see which “dxsEntries” are used in the json calls.
So I figured out all values used for my Kostal PIKO 6.0 BA with 2 strings:

|-Power Values
  -Total DC input [W][double] -->
  -Output power [W][double] -->
  -Self-consumption [W][double] -->
  -Charging status [%][double] -->
  -Operating status [integer] -->

Current values
|-PV Generator
  |-DC input 1
    -Voltage [V][double] -->
    -Current [A][double] -->
    -Power [W][double] -->
  |-DC input 2
    -Voltage [V][double] -->
    -Current [A][double] -->
    -Power [W][double] -->
  -Voltage [V][double] -->
  -Charging status [%][double] -->
  -Charging [A][double] -->
  Note: Charge/discharge status is 0=charge,1=discharge [integer] -->
  -Charge cycles [integer] -->
  -Temperature [degree celcius][double] -->
  |-Home consumption covered by
    -Solar generator [W][double] -->
    -Battery [W][double] -->
    -Grid [W][double] -->
  |-Phase selective home consumption
    -Phase 1 [W][double] -->
    -Phase 2 [W][double] -->
    -Phase 3 [W][double] -->
  |-Grid parameters
    -Output power [W][double] -->
    -Grid frequency [Hz][double] -->
    -Cos φ [double] -->
    -Limitation on [%][double] -->
  |-Phase 1
    -Voltage [V][double] -->
    -Current [A][double] -->
    -Power [W][double] -->
  |-Phase 2
    -Voltage [V][double] -->
    -Current [A][double] -->
    -Power [W][double] -->
  |-Phase 3
    -Voltage [V][double] -->
    -Current [A][double] -->
    -Power [W][double] -->
|-Analog inputs
  -Analoginput 1 [V][double] -->
  -Analoginput 2 [V][double] -->
  -Analoginput 3 [V][double] -->
  -Analoginput 4 [V][double] -->
|-S0 input
  -Number of energy pulses (S0-in) [no unit/s][integer/integer] -->

  -Yield [Wh][double] -->
  -Home-consumption [Wh][double] -->
  -Self-consumption [Wh][double] -->
  -Self-consumption rate [%][double] -->
  -Degree of self-sufficiency [%][double] -->
  -Yield [kWh][double] -->
  -Home-consumption [kWh][double] -->
  -Self-consumption [kWh][double] -->
  -Self-consumption rate [%][double] -->
  -Degree of self-sufficiency [%][double] -->
  -Operation time [h][integer] -->

Now that we know all the values we want to get, how do we integrate that into Openhab?
This can be done using the “http binding” and “JSONPath Transformation”.
So you go to PaperUI of your Openhab installation, go to “Add-Ons”, click on “bindings”, search for “HTTP Binding” and install it.
Then you click on “transformations”, search for “json” and install the “JSONPath Transformation”.

Now we can create a http.cfg file. You can find an empty http.cfg file on your Openhab installtion. E.g. on my Raspberry Pi, it is in the folder:

For every cache item, we can specify an URL and an update interval:

# configuration of the first cache item  

So for our Kostal inverter, we add values like this:


Unfortunately, there seems to be a limitation on how many values you can get with one cache item. It worked only with 25 items for me, so I had to make several cache items in the http.cfg to get all the values from my kostal:

# configuration of the first cache item

# configuration of the second cache item 

# configuration of the third cache item  (These are the statistics. We set a longer updateInterval for this.)

Now we can create an items file, using the items from the http cache, e.g.:

Number Kostal_TotalDcInput "DC-Eingang Gesamt [%.1f W]" { http="<[kostalCache:60000:JSONPATH($.dxsEntries[0].value)]"}
Number Kostal_OutputPower "Ausgangsleistung [%.1f W]" { http="<[kostalCache:60000:JSONPATH($.dxsEntries[1].value)]" }
Number Kostal_SelfConsumption "Eigenverbrauch [%.1f W]" { http="<[kostalCache:60000:JSONPATH($.dxsEntries[2].value)]" }
Number Kostal_BatteryStatus "Ladezustand [%.1f %%]" { http="<[kostalCache:60000:JSONPATH($.dxsEntries[3].value)]" }
Number Kostal_OperatingStatus "Betriebsstatus [%d]" { http="<[kostalCache:60000:JSONPATH($.dxsEntries[4].value)]" }

Please find my http.cfg, items file and sitemap file attached.
I had to rename the files to .txt, to be able to upload them.
So you have to rename them back to “http.cfg”, “kostal.items” and “kostal.sitemap”.

Place the “http.cfg” in the folder “\openhabianpi\openhab-conf\services”.
Place the “kostal.items” in the folder “\openhabianpi\openhab-conf\items”.
Place the “kostal.sitemap” in the folder “\openhabianpi\openhab-conf\sitemaps”.

Now you can see all the values available via the webinterface of your Kostal inverter in openHab in the basic UI :slight_smile:

Best Regards
http_cfg.txt (1.7 KB) kostal_items.txt (5.3 KB) kostal_sitemap.txt (2.7 KB)

1 Like

I think, the api has changed again. I have a plenticore 8.5 from kostal and the url with the api call to dxs.json not longer works.
I can see the new api if I called http:///api/v1/

So is it just the url that is different? All the other stuff is still valid?


No, I think the whole api has changed. I get no response (404) with the old URL.
But I’m not shure, if the new api is public, because I could not find any documentation about it.
If you call the new url you get a swagger description about the possible calls
Especially the authenticalion is not self explained.

1 Like

Thanks for your hints concerning the option to bind the Kostal Inverter using http binding and json.
It tool me some time to transfer the information to OH3 therefore I will take the liberty to add it here:

  • In the Thing configuration the “Base url” field gets “” with all the chosen ids as described in the original post.
  • In the Channel configuration the “State Transformation” gets “JSONPATH:$.dxsEntries[0].value” expression.
  • Finally you link your items, where you might use e.g. the map transformation to map the operation mode (“Betriebsstatus” in German) 0 --> off, …

Another option, if you prefer, is to perform the transformation at the Channel itself - you can chain transformations in the new OH3 HTTP Binding! Here’s what one of my transformations looks like - from an unrelated project - which first extracts the value from JSON, and then sends it through to the MAP transform.

1 Like