deCONZ sends rubbish "current summation delivered" for TS0121 + TS011F during deCONZ restart

When deCONZ restarts, deCONZ sometimes sends rubbish values

Example visualization for one device during one incident:

This has a massive impact on applications and data relying on those information. Details with more screenshots can be found at

DDFs (there is a custom one for only TS0121 because of Update frequency Blitzwolf BW-SHP13 (TZ3000_g5xawfcq)):

DDF for TS0121
{
  "schema": "devcap1.schema.json",
  "manufacturername": [
    "_TZ3000_g5xawfcq"
  ],
  "modelid": [
    "TS0121"
  ],
  "vendor": "Blitzwolf",
  "product": "BW-SHP13",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SMART_PLUG",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "default": "none"
        },
        {
          "name": "state/on",
          "refresh.interval": 5
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_POWER_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0b04"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0051",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0B04"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/current",
          "refresh.interval": 10,
          "default": 0
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/power",
          "refresh.interval": 10,
          "default": 0
        },
        {
          "name": "state/voltage",
          "refresh.interval": 10,
          "default": 0
        }
      ]
    },
    {
      "type": "$TYPE_CONSUMPTION_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0702"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0051",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0702"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/consumption",
          "refresh.interval": 300,
          "read": {
            "at": "0x0000",
            "cl": "0x0702",
            "ep": 0,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0702",
            "ep": 0,
            "eval": "Item.val = Attr.val * 10"
          },
          "default": 0
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0006",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x10",
          "min": 1,
          "max": 300
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0702",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x25",
          "min": 1,
          "max": 300,
          "change": "0x0000000A"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0B04",
      "report": [
        {
          "at": "0x0505",
          "dt": "0x21",
          "min": 1,
          "max": 20,
          "change": "0x00000001"
        },
        {
          "at": "0x0508",
          "dt": "0x21",
          "min": 1,
          "max": 20,
          "change": "0x00000064"
        },
        {
          "at": "0x050B",
          "dt": "0x29",
          "min": 1,
          "max": 10,
          "change": "0x00000001"
        }
      ]
    }
  ]
}
DDF for TS011F

Stock = same as deconz-rest-plugin/devices/lidl/hg08673.json at master · dresden-elektronik/deconz-rest-plugin · GitHub

Additionally:

Comparison of current custom DDF for TS0121 (left) and GitHub https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/blitzwolf/bw_shp13_smart_plug.json (right):




First questions:

1. How to proceed here? Raise an incident on the deCONZ GitHub repo?
2. Which information might be necessary (DDF or similar)? Edit: DDFs attached above

Please assist as this is massively bothering data integrity related to energy consumption calculation and statistics.

But I don’t see problems, the API just reflect the value send by the device no ?

I can understand if deconz send a 0 value at start, but a “random” value …

You have an idea what is this value ? It’s always the same

You have others plugs without this issue ?

I don’t see similar issue on google for this kind of device, and hard to catch logs if this happen only during the deconz start …

As work around, it’s possible to update the value only if this one is superior the previous one, but will be a problem if you try to reset the device.

Hi Smanar, great to see you around again.

No it’s not always the same value. You can see one example in the screenshot above (OP). The differences are completely different from case to case, sometimes „only“ 3 kWh, sometimes 121 kWh etc.

All plugs of those two device types are affected. All other power plugs integrated with deCONZ work fine, even I think they don‘t do power measurements but switching only.

That „only increase, never decrease the value“ workaround sounds interesting enough, worth to test. The values of those devices usually never reset (unlike Shelly on power outage) so it should be fine. How would I implement this? The DDF needs to be rock solid, I can test it productively on the upcoming restarts (manually).

That way also we can isolate the issue:
hardware > deCONZ addon → deCONZ API → deCONZ integration in Home Assistant

Something like

        {
          "name": "state/consumption",
          "refresh.interval": 300,
          "read": {
            "at": "0x0000",
            "cl": "0x0702",
            "ep": 0,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0000",
            "cl": "0x0702",
            "ep": 0,
            "eval": "var v = Attr.val * 10; if (R.item('state/consumption').val < v) {Item.val = v;}"
          },
          "default": 0
        },

But it’s strange I don’t see more this issue. On your picture we can see 2 good values and 2 bads, when the deconz restart was happen ?