Kostal Inverter Binding only working at Night

Hallo,

I am using the kostal inverter binding with openhab3.3 and a Piko15 second generation.
The binding is configured like this

It is online, but I do not get data. The item states are “NULL”
In the openhab event.log I get these error messages ever 60 seconds

2022-07-23 10:54:10.067 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:piko1020:dd94631e17' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)
2022-07-23 10:54:10.067 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:piko1020:dd94631e17' changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE

The interesting thing is. The message stop after sunset and start again after sunrise.
At night I get data from the inverter. Everything is 0 because there is no sun. But “PV Output Power Total” is updated every night.

The API of the Piko is working. In the browser I get data whole day.
http://192.168.137.203/api/dxs.json?dxsEntries=67109120

{"dxsEntries":[{"dxsId":67109120,"value":10360.331055}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}

My inverters firmware Version:
Bildschirmfoto vom 2022-07-23 12-04-13

Hi!
This is a strange behavior, never heard of it before, hm.
I am on vacation and will be back home next week, but untill then, Please try to reboot the inverter (you can do it during no sun period if you like)as:
Turn of the power-button on inverter, make the inverter disconnected from grid, (turn off fuses or similar for inverter, to reboot the Webserver in inverter), turn on the fuses…, turn on the power button.

Br Basse

Hi,
enjoy your vacation. I will try to figure out as much information I can, at this time.
Is there anything I can deliver? Any more detailed logging?

I did restart it a few times. Also left it without power for a few minutes.

My first suspicion is that there is a value that has a different status at night than during the day and for some reason, causes an error. Possibly the operating status.

Hi!
Let’s see,
you can try to catch some more values from the inverter with dxsId as:
251658754, Yield day,
251658753, Yield total
16780032, Operating status
67109378, GridVoltage L1
67109377, GridCurrent L1
67109379, GridPower L1
67109634, GridVoltage L2
67109633, GridCurrent L2
67109635, GridPower L2
67109890, GridVoltage L3
67109889, GridCurrent L3
67109891, GridPower L3
33556736, DCPowerPV
33555202, DC1Voltage
33555201, DC1Current
33555203, DC1Power
33555458, DC2Voltage
33555457, DC2Current
33555459, DC2Power
33555714, DC3Voltage
33555713, DC3Current
33555715, DC3Power

You can send them one by one as before or all as:
http://‘inverter-Ip’/api/dxs.json?dxsEntries=251658754&dxsEntries=251658753 and so on

They should all look like:
{“dxsEntries”:[{“dxsId”:251658754,“value”:20432.900391}],“session”:{“sessionId”:0,“roleId”:0},“status”:{“code”:0}}

except Operating Status like:
{“dxsEntries”:[{“dxsId”:16780032,“value”:3}],“session”:{“sessionId”:0,“roleId”:0},“status”:{“code”:0}}

Please, start with these, there are more we maybe need to check later.

Br Basse

Hi,

I put everything in one line

http://192.168.137.203/api/dxs.json?dxsEntries=251658754&dxsEntries=251658753&dxsEntries=16780032&dxsEntries=67109378&dxsEntries=67109377&dxsEntries=67109379&dxsEntries=67109634&dxsEntries=67109633&dxsEntries=67109635&dxsEntries=67109890&dxsEntries=67109889&dxsEntries=67109891&dxsEntries=33556736&dxsEntries=33555202&dxsEntries=33555201&dxsEntries=33555203&dxsEntries=33555458&dxsEntries=33555457&dxsEntries=33555459&dxsEntries=33555714&dxsEntries=33555713&dxsEntries=33555715

And the answer is this:

{"dxsEntries":[{"dxsId":251658754,"value":33866.398438},{"dxsId":251658753,"value":929.333740},{"dxsId":16780032,"value":3},{"dxsId":67109378,"value":235.282043},{"dxsId":67109377,"value":3.436279},{"dxsId":67109379,"value":747.551697},{"dxsId":67109634,"value":235.197281},{"dxsId":67109633,"value":3.588867},{"dxsId":67109635,"value":773.454590},{"dxsId":67109890,"value":234.858200},{"dxsId":67109889,"value":3.683472},{"dxsId":67109891,"value":804.612000},{"dxsId":33556736,"value":2484.238770},{"dxsId":33555202,"value":388.248932},{"dxsId":33555201,"value":1.904529},{"dxsId":33555203,"value":739.331360},{"dxsId":33555458,"value":388.891327},{"dxsId":33555457,"value":1.909951},{"dxsId":33555459,"value":742.589539},{"dxsId":33555714,"value":520.126343},{"dxsId":33555713,"value":1.927257},{"dxsId":33555715,"value":1002.317566}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}

Hi!
So far so good, the answer seems to be OK.
Just to be sure, will we check all parameters. I have left out the name, If you need them just let me know.
This is the rest of the ordinary parameters the binding read from the inverter. It’s just for some how possible to just read 23 parameters in one request, so you have to build the message, only with this max-number parameters( this is actually not all true, I think it’s possible to read more with the web-browser but not when using the binding).
83886336
83886592
83886848
83887106
83887362
83887618
67110400
67110656
251659010
251659266
251659278
251659279
251659009
251659265
251658496
33556238
33556230
33556228
33556227
150995968
184549632
251659280
251659281

This is the rest of ordinary parameters.
33556226
33556229
83888128

This is the parameters reed when a battery is connected and chosen for the thing.
33556484
33556247
33556483
33556482

Please try!
Br Basse

This is the answer. I do not have a battery. So the last one does not give much information.

{"dxsEntries":[{"dxsId":83886336,"value":null},{"dxsId":83886592,"value":null},{"dxsId":83886848,"value":null},{"dxsId":83887106,"value":null},{"dxsId":83887362,"value":null},{"dxsId":83887618,"value":null},{"dxsId":67110400,"value":50.018311},{"dxsId":67110656,"value":1.000000},{"dxsId":251659010,"value":0.000000},{"dxsId":251659266,"value":0.000000},{"dxsId":251659278,"value":0.000000},{"dxsId":251659279,"value":0.000000},{"dxsId":251659009,"value":0.000000},{"dxsId":251659265,"value":0.000000},{"dxsId":251658496,"value":193},{"dxsId":33556238,"value":0.000000},{"dxsId":33556230,"value":0},{"dxsId":33556228,"value":0},{"dxsId":33556227,"value":0.000000},{"dxsId":150995968,"value":300},{"dxsId":184549632,"value":0},{"dxsId":251659280,"value":0.000000},{"dxsId":251659281,"value":0.000000}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}
{"dxsEntries":[{"dxsId":33556226,"value":0.000000},{"dxsId":33556229,"value":0.000000},{"dxsId":83888128,"value":null}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}
{"session":{"sessionId":0,"roleId":0},"status":{"code":4}}

I have found a NodeRED plugin with which I can read some parameters. I ran it for a few days and compared the values with the times of the error message.
I noticed that the error message no longer appears in the Openhab event log as soon as the inverter changes to the status Off. At that moment the Item “YieldTotalSecondGen” is also updated with the current value.
As soon as the inverter changes from Off to another status, the error message appears again in the event log.

So today (07/26 16:00) I tried to recreate the situation by switching off the inverter with the big red switch. But that did not work. The error message was still there and the item was not updated.

So it really seems to have something to do with whether the sun is shining or not.
I checked the parameters you gave me, in two different situations. And I will do a third check after sunset. Maybe we see difference in the answer, that can help.

State: Feed IN

{"dxsEntries":[{"dxsId":251658754,"value":33866.398438},{"dxsId":251658753,"value":929.333740},{"dxsId":16780032,"value":3},{"dxsId":67109378,"value":235.282043},{"dxsId":67109377,"value":3.436279},{"dxsId":67109379,"value":747.551697},{"dxsId":67109634,"value":235.197281},{"dxsId":67109633,"value":3.588867},{"dxsId":67109635,"value":773.454590},{"dxsId":67109890,"value":234.858200},{"dxsId":67109889,"value":3.683472},{"dxsId":67109891,"value":804.612000},{"dxsId":33556736,"value":2484.238770},{"dxsId":33555202,"value":388.248932},{"dxsId":33555201,"value":1.904529},{"dxsId":33555203,"value":739.331360},{"dxsId":33555458,"value":388.891327},{"dxsId":33555457,"value":1.909951},{"dxsId":33555459,"value":742.589539},{"dxsId":33555714,"value":520.126343},{"dxsId":33555713,"value":1.927257},{"dxsId":33555715,"value":1002.317566}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}

State: Off, but Sun is shining

{"dxsEntries":[{"dxsId":251658754,"value":34023.550781},{"dxsId":251658753,"value":929.490845},{"dxsId":16780032,"value":0},{"dxsId":67109378,"value":234.815811},{"dxsId":67109377,"value":0.000000},{"dxsId":67109379,"value":0.000000},{"dxsId":67109634,"value":234.815811},{"dxsId":67109633,"value":0.000000},{"dxsId":67109635,"value":0.000000},{"dxsId":67109890,"value":234.731033},{"dxsId":67109889,"value":0.000000},{"dxsId":67109891,"value":0.000000},{"dxsId":33556736,"value":8.799446},{"dxsId":33555202,"value":456.411804},{"dxsId":33555201,"value":0.000000},{"dxsId":33555203,"value":0.000000},{"dxsId":33555458,"value":456.256165},{"dxsId":33555457,"value":0.000000},{"dxsId":33555459,"value":0.000000},{"dxsId":33555714,"value":606.511230},{"dxsId":33555713,"value":0.015249},{"dxsId":33555715,"value":8.799446}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}

This is the promissed check.

Status: Off, after sunset

{"dxsEntries":[{"dxsId":251658754,"value":43135.218750},{"dxsId":251658753,"value":938.602539},{"dxsId":16780032,"value":0},{"dxsId":67109378,"value":0.000000},{"dxsId":67109377,"value":0.000000},{"dxsId":67109379,"value":0.000000},{"dxsId":67109634,"value":0.000000},{"dxsId":67109633,"value":0.000000},{"dxsId":67109635,"value":0.000000},{"dxsId":67109890,"value":0.000000},{"dxsId":67109889,"value":0.000000},{"dxsId":67109891,"value":0.000000},{"dxsId":33556736,"value":0.000000},{"dxsId":33555202,"value":0.000000},{"dxsId":33555201,"value":0.000000},{"dxsId":33555203,"value":0.000000},{"dxsId":33555458,"value":0.000000},{"dxsId":33555457,"value":0.000000},{"dxsId":33555459,"value":0.000000},{"dxsId":33555714,"value":0.000000},{"dxsId":33555713,"value":0.000000},{"dxsId":33555715,"value":0.000000}],"session":{"sessionId":0,"roleId":0},"status":{"code":0}}

Hi!
Thank’s for all your help. I think I have found some reason, at least have I found differences in the data your inverter sends back against mine( might be regarded to UI or FW versions, you have later versions then me).
It is the parameters for Home Consumption that is different,
83886336, AktHomeConsumptionSolar
83886592, AktHomeConsumptionBat
83886848, AktHomeConsumptionGrid
83887106, PhaseHomeConsumpL1
83887362, PhaseHomeConsumpL2
83887618, PhaseHomeConsumpl3
These are from my inverter sent as 0 and from yours as null.

If these channels are activated, Please unactivate them and try.
I will do some checks with your parameters and be back asap.

Br Basse

Maybe it is because I do not have a smartmeter installed yet. It will be delivered till the end of the year.

I unlinked the channels you mentioned, but the error still appears and I do not get data on the other channels.
Even with all channels unlinked, the error still appears.

Hi Mike,
sorry for the delay.
Today have I uploaded an version to GitHub you can Please try:
GitHub - basse04/Test_02 org.openhab.binding.kostalinverter-3.3.0-SNAPSHOT.jar
and as usual, Please let me now about the result.
Br Basse

Hi Basse,

thank you for the Update.
I installed the new Version, but the behavior seems to stay the same.

Hi,
hm, I will make another one with some printing included, to see if we can figure out what’s wrong.
I will let you know.
Br Basse

Hi,
a new one is on Github, Please try.
This one tries to find out what could be the reason for failure, so still no progress I assume, it’s just for to do some digging.
So, Please run the new binding and have a look in the logfiles for OH3 and see if you can find the text as jsonDxsEntriesResponse and jsonDxsEntriesResponseExt and jsonDxsEntriesResponseExtExt.
If so am I interested of the text behind each( should be the very similar text as we seen earlier in Web-browser).
Br Basse

Hi,
just another thing you can try if you like, use Wireshark for capturing of packets regarded to when you start/restart the binding. I just like to see the response, a JSON-string, of the request the binding do, without any browser involved.
Br Basse

Hi,

I installed the new version, but do not see any entries in any log file.

tail -fn1000 events.log openhab.log audit.log update.log | grep Dxs

So I did the packet capture and exported all packages related to the inverter IP Address: 192.168.137.203

I send you a PM with a Download Link.

Hi,
I have had a look at your capture’s.
I quit sure I that I see the reason for the binding not to go online. Without battery will the binding send 3 different Requests with different dxsEntries. In your case is it only the 2 first as is captured, and I think that the 3’rd is never sent. See above: “This is the rest of ordinary parameters.”

Then to the cause for that, which is just a guess, but we have to check it.
I see that something sent a lot of Request’s to your inverter as:

GET /api/dxs.json?dxsEntries=16777984&dxsEntries=16777728&dxsEntries=251658753&dxsEntries=16779776&dxsEntries=83886336&dxsEntries=83886592&dxsEntries=83886848&dxsEntries=251659009&dxsEntries=251659010&dxsEntries=251658496&dxsEntries=251659279&dxsEntries=251659280&dxsEntries=251659281&dxsEntries=83887872&dxsEntries=33556229&dxsEntries=33556238&dxsEntries=33556230&dxsEntries=251658754&dxsEntries=251658753&dxsEntries=67109120&dxsEntries=67110656&dxsEntries=251659265&dxsEntries=251659266&dxsEntries=251659278&dxsEntries=134217989&dxsEntries=83888128&dxsEntries=67110400&dxsEntries=33554688&dxsEntries=33554944 HTTP/1.1

Response
{“dxsEntries”:[{“dxsId”:16777984,“value”:“Piko15”},{“dxsId”:67110400,“value”:50.054932},{“dxsId”:33554688,“value”:null},{“dxsId”:33554944,“value”:795.086792},{“dxsId”:83886336,“value”:null},{“dxsId”:83886592,“value”:null},{“dxsId”:83886848,“value”:null},{“dxsId”:251659009,“value”:0.000000},{“dxsId”:251659010,“value”:0.000000},{“dxsId”:251658496,“value”:643},{“dxsId”:251659279,“value”:0.000000},{“dxsId”:251659280,“value”:0.000000},{“dxsId”:251659281,“value”:0.000000},{“dxsId”:83887872,“value”:null},{“dxsId”:33556229,“value”:0.000000},{“dxsId”:33556238,“value”:0.000000},{“dxsId”:33556230,“value”:0},{“dxsId”:251658754,“value”:34050.144531},{“dxsId”:251658753,“value”:2959.560303},{“dxsId”:67109120,“value”:722.919739},{“dxsId”:67110656,“value”:1.000000},{“dxsId”:251659265,“value”:0.000000},{“dxsId”:251659266,“value”:0.000000},{“dxsId”:251659278,“value”:0.000000},{“dxsId”:134217989,“value”:“Einspeisen (MPP)”}],“session”:{“sessionId”:0,“roleId”:0},“status”:{“code”:0}}

Hypertext Transfer Protocol
GET /api/dxs.json?dxsEntries=16777984&dxsEntries=16777728&dxsEntries=251658753&dxsEntries=16779776&dxsEntries=83886336&dxsEntries=83886592&dxsEntries=83886848&dxsEntries=251659009&dxsEntries=251659010&dxsEntries=251658496&dxsEntries=251659279&dxsEntries=251659280&dxsEntries=251659281&dxsEntries=83887872&dxsEntries=33556229&dxsEntries=33556238&dxsEntries=33556230&dxsEntries=251658754&dxsEntries=251658753&dxsEntries=67109120&dxsEntries=67110656&dxsEntries=251659265&dxsEntries=251659266&dxsEntries=251659278&dxsEntries=134217989&dxsEntries=83888128&dxsEntries=67110400&dxsEntries=33554688&dxsEntries=33554944 HTTP/1.1
Accept: /
User-Agent: node-fetch/1.0 (+https://github.com/bitinn/node-fetch)
Accept-Encoding: gzip,deflate
Connection: close
Host: 192.168.137.203

This happens almost every second with start at 19:02:32, then 19:02:33 and so on.
Please check what this could be, try to turn it of and run the origin binding and do another capture, and send it to me.

I can see 2 captures from the binding, 1 at 19:02:37 and next one at 19:03:37 as it should be with 60s between, but they are booth without the 3’rd dxsEntries as described abow.

Br Basse

Hi Basse,

that is the NodeRed Plugin. I disabled it and created a new Caputure. I send you a PM.

Hi,
good so far. Bad is that I can’t still see the 3’rd group of dxsEntries. It seems like the binding forget to do the 3’rd request, hm? I can’t have the very same code behave as that, even if I try to.
I have uploaded an changed binding, this time with scraping of the 3’rd group first.
Please try, and send me a new Capture