KOSTAL Binding - New Plenticore G3

I’m using the KOSTAL binding for PIKO since 1 year and just got installed the new KOSTAL Plenticore G3.
Unfortunately the binding seems not to work anymore for this inverter.

Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Error during the initialisation of the authentication

I enabled a TRACE but cannot see any detailed information.

Connecting to http://<IP>/api/v1/ with the browser does work.
It response with

PIKO IQ / PLENTICORE plus API
REST-based API for PIKO IQ and PLENTICORE plus inverters

Seems the API hasn’t changed, but maybe the authentication?

Any help is welcome.

The binding works fine but Piko and Plenticore are different.
Ensure you created a new Thing of proper type.

I added a new Thing of course with the correct settings, for Plenticore with Battery.


UID: kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3
label: KOSTAL PLENTICORE M G3
thingTypeUID: kostalinverter:PLENTICOREPLUS100WITHBATTERY
configuration:
  refreshInternalInSeconds: 30
  userPassword: <Pwd>
  url: <IP>

The inverter is a new version, just released a few days ago!
Maybe Kostal changed something in the authentication setup?

Hi,
I’m the author for the Kostal Second Generation part of this binding.
I don’t know if the author of the 3’rd Generation is active, but if not I will do my best to help.
But I will be on vacation for some weeks from now on and have very limited time for this.
In the meantime if it’s possible for you, Please, use for example Wireshark and do some capturing when you connect to the inverter with the new ( I assume ) Kostal UI and when you try to do the very same with the Kostal binding and maybe you can see some differences which can help to solve this issue.
Br Basse

Hi,

many thanks - I will try to capture the required details.
Just for your info - the binding for the 3rd Generation is for the previous Plenticore model (with the green strips). The naming is confusing.
Kostal just released a few days ago the next Generation, which is called G3 (just a black box without the green strips)- I guess this was never tested before.

Is it possible to get some more detailed TRACE logs without doing wireshark?
I’m struggling to capture the communication between OH running on my NAS in a docker container and the inverter.

btw: I entered a wrong password on purpose and got the expected “wrong password” error.
Seems this is working.
Not sure what is triggering the error during the initialisation of the authentication.

Hi,
you can Please try with karaf:
$ ssh openhab@localhost -p 8101
habopen
openhab>log:tail

For help of more available commands:
openhab>help

Br Basse

Hi,

I did this already - I also use frontail to see the live logs of openhab.log and event.log.
The issue is with the TRACE or DEBUG command. For Kostal binding I do not see any error, except the INFO, also the Binding is in TRACE mode.

openhab> log:get | grep kostal
org.openhab.binding.kostalinverter                    | TRACE
openhab>
2024-06-30 18:21:20.718 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2024-06-30 18:21:20.719 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from INITIALIZING to UNKNOWN
2024-06-30 18:21:22.132 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Error during the initialisation of the authentication
2024-06-30 18:21:30.953 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from OFFLINE (COMMUNICATION_ERROR): Error during the initialisation of the authentication to OFFLINE (COMMUNICATION_ERROR): HTTP communication error: No response from device

When I enter a wrong password for testing, the following log appears:

2024-06-30 18:26:08.505 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2024-06-30 18:26:08.506 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from INITIALIZING to UNKNOWN
2024-06-30 18:26:09.626 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Wrong password
2024-06-30 18:26:15.810 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from OFFLINE (COMMUNICATION_ERROR): Wrong password to UNINITIALIZED
2024-06-30 18:26:15.812 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'kostalinverter:PLENTICOREPLUS100WITHBATTERY:KOSTAL_G3' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

I entered the IP address with different formats (just IP, including http:// or https://)
With http/https in the IP definition, an error is logged, as the format is obvious wrong.

However I never see any TRACE details for this binding, which is strange.

==> /log/openhab.log <==
2024-06-30 18:32:35.979 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.IllegalArgumentException: Expected closing bracket for IPv6 address at index 13: http://[http://192.168.5.80//api/v1/processdata]
	at java.net.URI.create(URI.java:906) ~[?:?]
	at org.eclipse.jetty.client.HttpClient.newRequest(HttpClient.java:473) ~[?:?]
	at org.eclipse.jetty.client.HttpClient.newRequest(HttpClient.java:462) ~[?:?]
	at org.openhab.binding.kostalinverter.internal.thirdgeneration.ThirdGenerationHttpHelper.executeHttpPost(ThirdGenerationHttpHelper.java:84) ~[?:?]
	at org.openhab.binding.kostalinverter.internal.thirdgeneration.ThirdGenerationHandler.updateChannelValues(ThirdGenerationHandler.java:155) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.net.URISyntaxException: Expected closing bracket for IPv6 address at index 13: http://[http://192.168.5.80//api/v1/processdata]
	at java.net.URI$Parser.fail(URI.java:2976) ~[?:?]
	at java.net.URI$Parser.failExpecting(URI.java:2982) ~[?:?]
	at java.net.URI$Parser.parseServer(URI.java:3369) ~[?:?]
	at java.net.URI$Parser.parseAuthority(URI.java:3284) ~[?:?]
	at java.net.URI$Parser.parseHierarchical(URI.java:3221) ~[?:?]
	at java.net.URI$Parser.parse(URI.java:3177) ~[?:?]
	at java.net.URI.<init>(URI.java:623) ~[?:?]
	at java.net.URI.create(URI.java:904) ~[?:?]
	... 10 more

Hi,
just found another thread with as it seems same problem( I was involved then also, but have totally forgot.

Hi,

I’m aware of this thread - it’s about the UNKOWN status when using http or https in the IP address field.
However, I don’t use this! It was just used for testing!

I did enter the IP address without http or https, and the status is OFFLINE with error:

Status: 
OFFLINE
COMMUNICATION_ERROR
Error during the initialisation of the authentication

I would like to provide more debug or trace results, but the binding seems not to log any detailed information, neither in DEBUG nor TRACE mode.

Hi,
I can see similarities between these two issues, due to that they are throwing similar exceptions at the very same line of code, but at different parts of binding-startup.

It would be very interesting to see the actual sent/received packages.
Please, try with sudo tcpdump host ‘IP’

I managed to mirror the switch port the G3 is connected with and captured the packets with Wireshark.
So far everything looks normal - I will send you the picture of the capture analyze in a PM.

Hi,
Thank’s, I will have a look. I’ll be back asap.
Br Basse