openhab / openhab-addons

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

[ecovacs] T20 Omni values not recognized #16187

Open soenkekueper opened 10 months ago

soenkekueper commented 10 months ago

Expected Behavior

The values of group “Last Clean Run" are displayed and there are no errors in the logs.

Current Behavior

2024-01-01 19:26:43.247 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 34 path $.error
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:1227) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:1137) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:1047) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:982) ~[?:?]
    at org.openhab.binding.ecovacs.internal.api.impl.EcovacsApiImpl.handleResponse(EcovacsApiImpl.java:349) ~[?:?]
    at org.openhab.binding.ecovacs.internal.api.impl.EcovacsApiImpl.sendIotCommand(EcovacsApiImpl.java:297) ~[?:?]
    at org.openhab.binding.ecovacs.internal.api.impl.EcovacsIotMqDevice.sendCommand(EcovacsIotMqDevice.java:97) ~[?:?]
    at org.openhab.binding.ecovacs.internal.handler.EcovacsVacuumHandler.lambda$15(EcovacsVacuumHandler.java:575) ~[?:?]
    at org.openhab.binding.ecovacs.internal.handler.EcovacsVacuumHandler.doWithDevice(EcovacsVacuumHandler.java:798) ~[?:?]
    at org.openhab.binding.ecovacs.internal.handler.EcovacsVacuumHandler.pollData(EcovacsVacuumHandler.java:574) ~[?:?]
    at org.openhab.binding.ecovacs.internal.api.util.SchedulerTask.run(SchedulerTask.java:95) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
    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:833) [?:?]
Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 34 path $.error
    at com.google.gson.stream.JsonReader.nextString(JsonReader.java:836) ~[?:?]
    at com.google.gson.internal.bind.TypeAdapters$15.read(TypeAdapters.java:421) ~[?:?]
    at com.google.gson.internal.bind.TypeAdapters$15.read(TypeAdapters.java:409) ~[?:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212) ~[?:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433) ~[?:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393) ~[?:?]
    ... 17 more

Steps to Reproduce (for Bugs)

  1. Install binding / create thing
  2. Wait for error message in log files.

Context

Added new (supported) thing after openhab update to 4.1.0 and values are not updated.

Your Environment

runtimeInfo:
  version: 4.1.0
  buildString: Release Build
locale: de-DE
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 17.0.5
  javaVendor: Eclipse Adoptium
  javaVendorVersion: Temurin-17.0.5+8
  osName: Linux
  osVersion: 6.1.39-v8+
  osArchitecture: arm
  availableProcessors: 4
  freeMemory: 299587208
  totalMemory: 612368384
  uptime: 696571
  startLevel: 70
addons:
  - automation-jsscripting
  - binding-astro
  - binding-avmfritz
  - binding-denonmarantz
  - binding-deutschebahn
  - binding-ecovacs
  - binding-exec
  - binding-heos
  - binding-homematic
  - binding-icalendar
  - binding-modbus
  - binding-mqtt
  - binding-netatmo
  - binding-network
  - binding-ntp
  - binding-tankerkoenig
  - binding-tradfri
  - persistence-influxdb
  - persistence-rrd4j
  - transformation-jsonpath
  - transformation-map
  - transformation-regex
  - transformation-scale
  - ui-basic
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1.5
    prefersColorScheme: light
  isSecureContext: true
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: 8
    hardwareConcurrency: 8
    language: de-DE
    languages:
      - de-DE
      - de
      - en-US
      - en
    onLine: true
    platform: Win32
  screen:
    width: 2206
    height: 1266
    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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/120.0.0.0 Safari/537.36
timestamp: 2024-01-02T19:49:42.017Z
openhab-bot commented 10 months ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/ecovacs-vacuum-cleaners-binding-3-2-0-4-0-0/132989/174

maniac103 commented 8 months ago

Can you please

? Thanks.

[1] To make sure all dependencies are installed, my approach to installing would be

Alternatively,

Result after running bundle:list again should be the binding reported with version number 4.1.2.202403060828 instead of 4.1 and as Active.

[2] The vacuum thing should now be toggling between ONLINE and OFFLINE. Wait for one or two of such cycles, then grab log.

soenkekueper commented 8 months ago

Hey,

sorry for the late reply, i've little spare time at the moment.

I've updated the bundle as mentioned above, but the version seems to be a bit newer now:

openhab> bundle:list | grep Ecovacs
343 x Active x  80 x 4.1.2.202403150847     x openHAB Add-ons :: Bundles :: Ecovacs Binding

The devices (i've two evocacs bots) did not toggle the state on their own. So i've did manually. As there are some log messages and errors in the log, i've attached this and hope it helps. Otherwise, let me know what i can do to support you.

Thanks for your work!

Sönke openhab.log

maniac103 commented 8 months ago

I've updated the bundle as mentioned above, but the version seems to be a bit newer now:

Oh, right, oops ... I reused the same link to do debugging for #16117 ... good news is that this shouldn't matter ;-) Since it includes #16524 I assume the last cleaning information channels (duration, area, map etc.) work now ... please confirm. If that's the case is there anything that actually is still broken with this jar? If that's not the case, I'd need a description of what exactly is broken + information about your vacuum (stupid me, the title says it's a T20) + a log with level set to TRACE instead of DEBUG. The error in the original issue report should cause a message at DEBUG level with that jar, but I don't see it in the log, so I assume that one is no longer happening?

soenkekueper commented 8 months ago

Hey,

on the first look it seems good - status values are available now. I'll watch this a while and give you an answer.

The JsonSyntaxException is furthermore present in the log, see at 2024-03-16 19:25:07.247

2024-03-16 19:25:07.247 [DEBUG] [internal.api.impl.EcovacsIotMqDevice] - E06930903E1FPBVY0032: Got invalid JSON message payload, ignoring: {"header":{"pri":1,"tzm":60,"ts":"1710613506039","ver":"0.0.1","fwVer":"1.22.0","hwVer":"0.1.1","wkVer":"0.1.54"},"body":[{"signal":-62,"uptime":" 18:11:05 up 28 days, 11:00, POWER_RESET, 100/1, 423","meminfo":"241476,258672","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506010"},{"signal":-62,"uptime":" 18:12:05 up 28 days, 11:01, POWER_RESET, 100/1, 423","meminfo":"242044,258104","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506010"},{"signal":-62,"uptime":" 18:13:05 up 28 days, 11:02, POWER_RESET, 100/1, 423","meminfo":"241800,258348","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506011"},{"signal":-62,"uptime":" 18:14:05 up 28 days, 11:03, POWER_RESET, 100/1, 423","meminfo":"242040,258108","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506011"},{"signal":-62,"uptime":" 18:15:05 up 28 days, 11:04, POWER_RESET, 100/1, 423","meminfo":"241852,258296","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506011"},{"signal":-62,"uptime":" 18:16:05 up 28 days, 11:05, POWER_RESET, 100/1, 423","meminfo":"241452,258696","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506011"},{"signal":-62,"uptime":" 18:17:05 up 28 days, 11:06, POWER_RESET, 100/1, 423","meminfo":"241504,258644","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506011"},{"signal":-62,"uptime":" 18:18:05 up 28 days, 11:07, POWER_RESET, 100/1, 423","meminfo":"242000,258148","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506011"},{"signal":-62,"uptime":" 18:19:05 up 28 days, 11:08, POWER_RESET, 100/1, 423","meminfo":"242176,257972","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506011"},{"signal":-62,"uptime":" 18:20:05 up 28 days, 11:09, POWER_RESET, 100/1, 423","meminfo":"242348,257800","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506012"},{"signal":-62,"uptime":" 18:21:05 up 28 days, 11:10, POWER_RESET, 100/1, 423","meminfo":"241932,258216","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506012"},{"signal":-62,"uptime":" 18:22:05 up 28 days, 11:11, POWER_RESET, 100/1, 423","meminfo":"241964,258184","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506012"},{"signal":-62,"uptime":" 18:23:05 up 28 days, 11:12, POWER_RESET, 100/1, 423","meminfo":"241664,258484","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506012"},{"signal":-62,"uptime":" 18:24:05 up 28 days, 11:13, POWER_RESET, 100/1, 423","meminfo":"242224,257924","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506012"},{"signal":-62,"uptime":" 18:25:05 up 28 days, 11:14, POWER_RESET, 100/1, 423","meminfo":"241736,258412","pos":"-33,-554","isvalid":1,"mapid":"1761984352","ts":"1710613506012"}]}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 123 path $.body
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397) ~[?:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212) ~[?:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433) ~[?:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:1227) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:1137) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:1047) ~[?:?]
    at com.google.gson.Gson.fromJson(Gson.java:982) ~[?:?]
    at org.openhab.binding.ecovacs.internal.api.impl.JsonReportParser.handleMessage(JsonReportParser.java:58) ~[?:?]
    at org.openhab.binding.ecovacs.internal.api.impl.EcovacsIotMqDevice.lambda$3(EcovacsIotMqDevice.java:181) ~[?:?]
    at com.hivemq.client.internal.mqtt.mqtt3.Mqtt3AsyncClientView.lambda$callbackView$1(Mqtt3AsyncClientView.java:76) ~[bundleFile:?]
    at com.hivemq.client.internal.mqtt.MqttAsyncClient$CallbackSubscriber.onNext(MqttAsyncClient.java:303) [bundleFile:?]
    at com.hivemq.client.internal.mqtt.MqttAsyncClient$CallbackSubscriber.onNext(MqttAsyncClient.java:288) [bundleFile:?]
    at com.hivemq.client.rx.FlowableWithSingle$SingleFutureSubscriber.onNext(FlowableWithSingle.java:406) [bundleFile:?]
    at com.hivemq.client.internal.rx.operators.FlowableWithSingleCombine$SplitSubscriber$Default.tryOnNextActual(FlowableWithSingleCombine.java:235) [bundleFile:?]
    at com.hivemq.client.internal.rx.operators.FlowableWithSingleCombine$SplitSubscriber.tryOnNext(FlowableWithSingleCombine.java:200) [bundleFile:?]
    at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnConditionalSubscriber.runAsync(FlowableObserveOn.java:649) [bundleFile:?]
    at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176) [bundleFile:?]
    at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) [bundleFile:?]
    at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) [bundleFile:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
    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:833) [?:?]
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 123 path $.body
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:393) ~[?:?]
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:386) ~[?:?]
    ... 24 more
maniac103 commented 8 months ago

The JsonSyntaxException is furthermore present in the log, see at 2024-03-16 19:25:07.247

That's a different (and harmless) one though: it's emitted from EcovacsIotMqDevice, not EcovacsApiImpl.

lsiepel commented 2 months ago

Minor, but the stacktrace is not needed for that debug line. Anyway interested in @soenkekueper's results.

soenkekueper commented 2 months ago

Values seem to work fine. I've switched the log level to debug and will check the log in a few days again.