openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.87k stars 3.58k forks source link

[goecharger] API V2 Communication error related to wh parameter #12719

Closed tarag closed 2 years ago

tarag commented 2 years ago

Expected Behavior

No error when connection through API V2 to a go-e V3 charger

Current Behavior

The following errors appear in openhab.log, go-e charger thing remains in UNKNOWN state:

2022-05-11 12:15:50.072 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected a long but was 240.3444 at line 1 column 89 path $.wh
        at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:307) ~[?:?]
        at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:297) ~[?:?]
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) ~[?:?]
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) ~[?:?]
        at com.google.gson.Gson.fromJson(Gson.java:963) ~[?:?]
        at com.google.gson.Gson.fromJson(Gson.java:928) ~[?:?]
        at com.google.gson.Gson.fromJson(Gson.java:877) ~[?:?]
        at com.google.gson.Gson.fromJson(Gson.java:848) ~[?:?]
        at org.openhab.binding.goecharger.internal.handler.GoEChargerV2Handler.getGoEData(GoEChargerV2Handler.java:347) ~[?:?]
        at org.openhab.binding.goecharger.internal.handler.GoEChargerBaseHandler.refresh(GoEChargerBaseHandler.java:140) ~[?:?]
        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) [?:?]
Caused by: java.lang.NumberFormatException: Expected a long but was 240.3444 at line 1 column 89 path $.wh
        at com.google.gson.stream.JsonReader.nextLong(JsonReader.java:966) ~[?:?]
        at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:305) ~[?:?]
        ... 15 more

Context

Set-up of a new go-e charger. This is my first attempt to set-up a go-e charger so have no idea of any specific change that could explain the error. Using the same charger with API V1 version works (I do have some transient connection errors - timeouts - due to unreliable Wifi connection but I believe this is not related).

Your Environment

go-e charger HW rev 3 running firmware 053.1

openHAB:

runtimeInfo:
  version: 3.3.0.M5
  buildString: Milestone Build
locale: fr-FR
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.13
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.52+13-CA
  osName: Linux
  osVersion: 5.4.0-109-generic
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 128243896
  totalMemory: 426770432
  startLevel: 70
bindings:
  - exec
  - freebox
  - fronius
  - goecharger
  - http
  - ipcamera
  - knx
  - modbus
  - mybmw
  - remoteopenhab
  - shelly
  - systeminfo
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: true
    windows: false
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: macos
    pixelRatio: 2
    prefersColorScheme: light
  isSecureContext: true
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 8
    language: en-GB
    languages:
      - en-GB
    onLine: true
    platform: MacIntel
  screen:
    width: 3008
    height: 1692
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: filled
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15
    (KHTML, like Gecko) Version/15.4 Safari/605.1.15
timestamp: 2022-05-11T10:21:52.617Z
lolodomo commented 2 years ago

Note for the binding maintainer: JsonSyntaxException should be caught in method refresh