Samsung Smartthings plug 2019 inccorectly reporting consumption

Hi all,
I have replaced the buggy Heimann smart plugs with Samsung Smartthings smartplug 2019 and I just noticed that the power is incorrectly reported in Phoscon.

In Deconz I can see it is correct:


As per Deconz it should be 4.83 KWH (483 value and divisor is 100 and the measurements is in KWh)
In Phoscon it reports 483wH so either should be 48300 wH or 4.83 KwH

Other screenshots that would be useful I think

Is DDF to be corrected or what is the issue? I am using Home Assistant add on , Conbee III, Firmware 26530900 version 2.28.1

Many thanks!

What’s the api showing

I am unsure how to get the info via API

http://IP:PORT/api/KEY/lights/45

{“capabilities”:{“alerts”:[“none”,“select”,“lselect”]},“config”:{“groups”:[“0”]},“etag”:“0367ba37718d661fb975af22be472e86”,“hascolor”:false,“lastannounced”:“2024-10-12T17:00:05Z”,“lastseen”:“2024-10-14T20:16Z”,“manufacturername”:“LDS”,“modelid”:“ZB-ONOFFPlug-D0005”,“name”:“Smart and AV Hub”,“state”:{“alert”:“none”,“on”:true,“reachable”:true},“swversion”:“20190716-165”,“type”:“Smart plug”,“uniqueid”:“ec:1b:bd:ff:fe:43:79:94-01”}

in the debug is showing

21:29:00:590 DB sql exec REPLACE INTO sensors (sid, name, type, modelid, manufacturername, uniqueid, swversion, state, config, fingerprint, deletedState, mode, lastseen, lastannounced) VALUES (‘202’, ‘Consumption 202’, ‘ZHAConsumption’, ‘ZB-ONOFFPlug-D0005’, ‘LDS’, ‘ec:1b:bd:ff:fe:43:79:94-01-0702’, ‘2.3’, ‘{“consumption”:551,“lastupdated”:“2024-10-14T20:28:32.099”}’, ‘{“on”:true,“reachable”:true}’, ‘{“d”:81,“ep”:1,“in”:[0,1794],“p”:260}’, ‘normal’, ‘1’, ‘2024-10-14T20:28Z’, ‘2024-10-12T17:00:05Z’)

the correct value should be 5.51 KwH and it is reporting 0.551 KwH in Home assistant and 551 wH in Deconz…

So do we agree that it is a bug? Something that I can try to fix?

Hello, idk if it’s a bug, to be sure you can use a device with big consumption like a heater during at least 30mn and check values.
But this device don’t have DDF, it’s actually managed by legacy code, So no other method than creating a DDF.

You can mimic for exemple this one to start deconz-rest-plugin/devices/blitzwolf/bw_shp13_smart_plug.json at master · dresden-elektronik/deconz-rest-plugin · GitHub

With just replacing the modelId/ManufactureName

Please, don’t! There is already a suggested DDF for this device without any feedback: Aeotec Smart Plug (AU) · Issue #5700 · dresden-elektronik/deconz-rest-plugin · GitHub

And it’s not a bug, it’s just not the right divisor being used :slight_smile: @andys73 you are correct, the value exposed in deconz GUI must be multiplied by 10, as the REST API is reporting in Wh (5510 Wh).

But actual value is fully wtong. What shall I do in Home assistan, define a template sensor and set the calculated value value there? Will it ever be corrected in the rest api and then will get correcly in HA?

Try the DDF proposed on the previous link.
It’s possible to correct output if needed if the device use a DDF.

Hi @Smanar
Great suggestion, I have added * 10 in the Edit DDF and it shows now correctly in Home Assistant!
I guess that this will be gone at next update, can someone commit the DDF change?


This is what I have in my DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "LDS",
  "modelid": "ZB-ONOFFPlug-D0005",
  "product": "ZB-ONOFFPlug-D0005",
  "sleeper": false,
  "status": "Gold",
  "path": "/devices/zb-onoffplug-d0005.json",
  "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",
          "description": "The currently active alert effect.",
          "default": "none"
        },
        {
          "name": "state/on",
          "description": "True when device is on; false when off.",
          "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/mode",
          "description": "Operational mode.",
          "default": 1
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/power",
          "description": "The measured power (in W).",
          "refresh.interval": 300,
          "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/mode",
          "description": "Operational mode.",
          "default": 1
        },
        {
          "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,
          "parse": {
            "at": "0x0000",
            "cl": "0x0702",
            "ep": 0,
            "eval": "Item.val = Attr.val * 10"
          },
          "default": 0
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0006",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x10",
          "min": 5,
          "max": 180
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0000"
    }
  ]
}

I can make the PR if you are sure it’s the correct value.
But can you re-include the devive to be sure the DDF is working ? For me it miss a bind/report part, and it work for you because they was already set previously (by the legacy core).

Sorry I know this DDF is from me, but long time I have make it.

Hi @Smanar I did not use directly your ddf (as I am with the HA plug in) I just used the DDF editor and multiplied by 10 the simple metering cluster and then as I save it and change it as gold, all my samsung plugs used the updated ddf and reported the correct consumption. Does this answer your question? Thanks!

He, not realy ^^
This device don’t have DDF, so you can’t have edited an actual one with a *10, it mean you have created yourself a complete DDF