Go eCharger Binding Stops Working after a few days - perhaps issue with Firmware Version 0.55

Hello together,

i installed the openhab go eCharger Binding (Go-eCharger - Bindings | openHAB) a few weeks ago. Since them I had several times the issues that the bindings stops working which means the value of the linked items were not updated anymore. Deactivating and activating the thing always solved the issue.

After a while I increased the log level of the binding to trace and found the following results:

2023-03-08 13:44:18.115 [TRACE] [internal.handler.GoEChargerV2Handler] - GET URL = http://xxx.xxx.xxx.xxx/api/status?filter=mod,psm,trx,alw,tma,wh,dwo,frc,nrg,car,amp,err,cbl,eto,
fwv
2023-03-08 13:44:18.243 [TRACE] [internal.handler.GoEChargerV2Handler] - GET Response: {"alw":false,"dwo":20000,"eto":141722,"amp":10,"frc":0,"car":1,"err":0,"cbl":0,"wh":20001
.24,"trx":null,"fwv":"055.0","tma":[25.5,21],"nrg":[229.71,229.09,229.09,1.86,0,0,0,0,0,0,0,0,0,0,0,0],"psm":2}
2023-03-08 13:44:48.306 [TRACE] [internal.handler.GoEChargerV2Handler] - GET URL = http://xxx.xxx.xxx.xxx/api/status?filter=mod,psm,trx,alw,tma,wh,dwo,frc,nrg,car,amp,err,cbl,eto,fwv
2023-03-08 13:44:48.448 [TRACE] [internal.handler.GoEChargerV2Handler] - GET Response: {"alw":false,"dwo":20000,"eto":141722,"amp":10,"frc":0,"car":1,"err":0,"cbl":0,"wh":20001.24,"trx":null,"fwv":"055.0","tma":[25.5,21],"nrg":[229.71,229.09,229.4,1.86,0,0,0,0,0,0,0,0,0,0,0,0],"psm":2}
2023-03-08 13:45:18.531 [TRACE] [internal.handler.GoEChargerV2Handler] - GET URL = http://xxx.xxx.xxx.xxx/api/status?filter=mod,psm,trx,alw,tma,wh,dwo,frc,nrg,car,amp,err,cbl,eto,fwv
2023-03-08 13:45:18.660 [TRACE] [internal.handler.GoEChargerV2Handler] - GET Response: {"alw":false,"dwo":20000,"eto":141722,"amp":10,"frc":0,"car":1,"err":0,"cbl":0,"wh":20001.24,"trx":null,"fwv":"055.0","tma":[-16843.01],"nrg":[229.71,229.4,229.4,1.86,0,0,0,0,0,0,0,0,0,0,0,0],"psm":2}
2023-03-08 13:45:18.734 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
        at org.openhab.binding.goecharger.internal.handler.GoEChargerV2Handler.getValue(GoEChargerV2Handler.java:155) ~[?:?]
        at org.openhab.binding.goecharger.internal.handler.GoEChargerV2Handler.lambda$1(GoEChargerV2Handler.java:383) ~[?:?]
        at java.util.ArrayList.forEach(ArrayList.java:1541) ~[?:?]
        at org.openhab.binding.goecharger.internal.handler.GoEChargerV2Handler.updateChannelsAndStatus(GoEChargerV2Handler.java:383) ~[?:?]
        at org.openhab.binding.goecharger.internal.handler.GoEChargerBaseHandler.refresh(GoEChargerBaseHandler.java:126) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        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:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]

For me it looks like the wallbox is answering with the wrong temperature array for the value tma.
Does anybody else having this issue - in such a case I could open a Merge Request for the relative simple fix:

@@ -149,7 +149,7 @@ public class GoEChargerV2Handler extends GoEChargerBaseHandler {
                 }
                 return new QuantityType<>(goeResponse.temperatures[0], SIUnits.CELSIUS);
             case TEMPERATURE_CIRCUIT_BOARD:
-                if (goeResponse.temperatures == null) {
+                if (goeResponse.temperatures == null || goeResponse.temperatures.length < 2) {
                     return UnDefType.UNDEF;
                 }
                 return new QuantityType<>(goeResponse.temperatures[1], SIUnits.CELSIUS);

I am just evaluating this fix at the moment.

Best regards

Schogit

Thank you for debugging. I’m also seeing problems after days of use and worked around it (thought it to be bad wifi) with this disable/enable rule:

sendHttpPutRequest("http://user:pass@127.0.0.1:8080/rest/things/goecharger:goe:e1d7ceaa82/enable", "text/plain", 'false') 
  sendHttpPutRequest("http://user:pass@127.0.0.1:8080/rest/things/goecharger:goe:cbe83736b2/enable", "text/plain", 'true')

Would be great to get this fixed. One rule less to care for.

Thanks!

Hello,

i tried to create a pull request against the master branch: Added check for the correct length of the temperature array returnde … by schogit · Pull Request #14632 · openhab/openhab-addons · GitHub

But perhaps it makes sense to also add a pull request for the 3.4.x branch - I will try to do so…

Greetings

schogit

I reported this issue to the go-echarger API as well. https://github.com/goecharger/go-eCharger-API-v2/issues/132

Any news on it? I have the same problem, the binding is not working correctly. If I disable/enable the binding in openhab it works again.

Which version of OpenHAB are you running? I run 4.0.0M3 and this binding seems to work correctly in this version. However, I wrote a small script to enable the thing once every hour. But since this script is activated 10 min after the binding is queried, I expect this script to have no influence anymore.