lights:
{
"capabilities": {
"alerts": [
"none",
"select",
"lselect"
]
},
"config": {
"groups": []
},
"etag": "XXXXXXXXXXXXXXXXXX",
"hascolor": false,
"lastannounced": "2024-08-23T12:36:23Z",
"lastseen": "2024-08-23T14:10Z",
"manufacturername": "_TZ3000_j1v25l17",
"modelid": "TS011F",
"name": "XXXXXXXXXXX",
"state": {
"alert": "none",
"on": true,
"reachable": true
},
"swversion": "1.0.4",
"type": "Smart plug",
"uniqueid": "XXXXXXXXXXXXXXXXX-01"
}
sensors (power):
{
"config": {
"on": true,
"reachable": true
},
"ep": 1,
"etag": "XXXXXXXXXXXXXXXXX",
"lastannounced": "2024-08-23T12:36:23Z",
"lastseen": "2024-08-23T14:33Z",
"manufacturername": "_TZ3000_j1v25l17",
"modelid": "TS011F",
"name": "Power 115",
"state": {
"current": 598,
"lastupdated": "2024-08-23T14:33:52.733",
"power": 98,
"voltage": 241
},
"swversion": "1.0.4",
"type": "ZHAPower",
"uniqueid": "XXXXXXXXXXXXXXXX"
}
Anything suspicious here @Mimiix ?
Ah, here we go:
sensors/consumption:
{
"config": {
"on": true,
"reachable": true
},
"ep": 1,
"etag": "XXXXXXXXXXX",
"lastannounced": "2024-08-23T12:36:23Z",
"lastseen": "2024-08-23T14:38Z",
"manufacturername": "_TZ3000_j1v25l17",
"modelid": "TS011F",
"name": "Consumption 116",
"state": {
"consumption": 0,
"lastupdated": "none"
},
"swversion": "1.0.4",
"type": "ZHAConsumption",
"uniqueid": "XXXXXXXXXXXXXX-0702"
}
So why does the API report "consumption": 0,
when the attribute has (currently) 29
stored?
What transforms the raw data to the API - the DDF?
Here’s the full DDF currently used (stock / default as of deCONZ v2.25.3):
{
"schema": "devcap1.schema.json",
"manufacturername": ["_TZ3000_nkcobies","_TZ3000_j1v25l17","_TZ3000_ynmowqk2"],
"modelid": ["TS011F","TS011F","TS011F"],
"product": "HG08673 LIDL SilverCrest smart plug with monitoring (DK, EU, FR)",
"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",
"parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "../tuya/tuya_swversion.js"},
"read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/alert",
"default": "none"
},
{
"name": "state/on"
},
{
"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",
"parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "../tuya/tuya_swversion.js"}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/current"
},
{
"name": "state/lastupdated"
},
{
"name": "state/power"
},
{
"name": "state/voltage"
}
]
},
{
"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",
"parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "../tuya/tuya_swversion.js"}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/consumption",
"refresh.interval": 420,
"parse": {
"at": "0x0000",
"cl": "0x0702",
"ep": 1,
"eval": "item.val = 10 * Attr.val"
}
},
{
"name": "state/lastupdated"
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0006",
"report": [
{
"at": "0x0000",
"dt": "0x10",
"min": 1,
"max": 360
}
]
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0702",
"report": [
{
"at": "0x0000",
"dt": "0x25",
"min": 1,
"max": 360,
"change": "0x0000000A"
}
]
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0B04",
"report": [
{
"at": "0x0505",
"dt": "0x21",
"min": 1,
"max": 360,
"change": "0x00000001"
},
{
"at": "0x0508",
"dt": "0x21",
"min": 1,
"max": 360,
"change": "0x00000064"
},
{
"at": "0x050B",
"dt": "0x29",
"min": 1,
"max": 360,
"change": "0x00000001"
}
]
}
]
}
The only difference compared to the current deconz-rest-plugin/devices/lidl/hg08673.json at master · dresden-elektronik/deconz-rest-plugin · GitHub I could spot is:
2.25.3:
"eval": "item.val = 10 * Attr.val"
latest on GitHub:
"eval": "Item.val = Attr.val * 10"
That’s not relevant at all and a wrong trail, isn’t it? Or is it the small “i” of “item.val”?
I’m starting to get a bit lost here after fiddling around with one device for 3 hours.