TP-Link HS110 Energy Usage dropped to 0

Hey,

I am running two TP-Link HS110 smart plugs and have them integrated into my OpenHAB 2.4 setup.
I am mainly using the data gathered by the binding for rules and persistence.
Today, the energy usage which reflects the overall energy used by the plug since it was activated, dropped to 0 for no reason. I have not touched the plug, nor any OH configuration. All other values look fine, the Kasa app also shows real energy usage values and not 0.

Any idea what could have caused this or how I could debug this to get to the bottom?

Thanks in advance!
Stefan

The 1st of January. Hmmmm… Coincidence?
The binding get the value from the device.
Have you asked TP link?

Thanks for your quick reply. The data from the other plug are totally fine. As the Kasa app shows the correct values, I figured it might rather be something related to the binding and have not asked TP Link about this yet.

I do know it is over a year old. 2.5 stable is now the current OH version.

As I am running OH on my Synology NAS and upgrading from 2.4 to 2.5 is not that easy, I didn’t plan on doing so just yet.

Maybe anybody else has some other idea or has had a similar problem?

If you enable trace logging it will show the json returned by the device. This might give an indication if it’s the device that returns this data or if it’s something else in karaf console: log:set TRACE org.openhab.binding.tplinksmarthome

Thanks for the tip. This is the JSON returned (I removed some of the IDs as they are probably not necessary):

{
  "system": {
    "get_sysinfo": {
      "sw_ver": "1.5.4 Build 180815 Rel.121440",
      "hw_ver": "2.0",
      "type": "IOT.SMARTPLUGSWITCH",
      "model": "HS110(EU)",
      "mac": "YYY",
      "dev_name": "Smart Wi-Fi Plug With Energy Monitoring",
      "alias": "Waschmaschine",
      "relay_state": 1,
      "on_time": 69283,
      "active_mode": "none",
      "feature": "TIM:ENE",
      "updating": 0,
      "icon_hash": "",
      "rssi": -64,
      "led_off": 0,
      "longitude_i": YYY,
      "latitude_i": YYY,
      "hwId": "YYY",
      "fwId": "YYY",
      "deviceId": "YYY",
      "oemId": "YYY",
      "next_action": {
        "type": -1
      },
      "err_code": 0
    }
  },
  "emeter": {
    "get_realtime": {
      "voltage_mv": 233325,
      "current_ma": 50,
      "power_mw": 0,
      "total_wh": 1,
      "err_code": 0
    }
  }
}

Looks like 1 WH is returned - super weird as the Kasa app shows something different. Is the data pulled somewhere else?

/edit

Seems the overall energy usage is increasing again as I have used the machine today.
So it apparently reset itself and started counting from 0 again…

@hilbrand

I have been watching the trace logs again today. Is the “emeter” object containing the data expected in every response back from the device?

At least for my plugs it seems to always be missing at least in my snapshot of the logs today.

The device dropping the universal usage back to 0 is then also probably a device problem and not a problem of the binding, right?

Thanks in advance!