-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DDF for IKEA INSPELNING smart plug #7959
base: master
Are you sure you want to change the base?
DDF for IKEA INSPELNING smart plug #7959
Conversation
Hey @bluemoehre, thanks for your pull request! Tip Modified bundles can be downloaded here. DDB changesModified
ValidationTip Everything is fine ! 🕠 Updated for commit 88e3eeb |
The API should report consumption in Wh, see https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/generic/items/state_consumption_item.json. If the device reports Current Summation Delivered in Wh, no conversion is needed. I don't use Phoscon, and have no clue how they report consumption. The devices that I have don't use divisors/multipliers on Simple Metering, but instead use Summation Formatting. I never really figured out how that works, so I tend to use a known load (e.g. an old 60W Tungsten bulb), and see what the device reports to figure out it's scaling. Also check the Unit of Measure attribute. If that's kW and kWh binary (what I see in my cases), and 0x0000 reports in Wh, the divisor should be 1000, to transform Wh to the advertised kWh. |
Actually, the logic here is quite simple: If, for the given device, attribute 0x0000 gives us the value of 4, the math is 4*1/1000 = 0,004. That means the device reports already in Wh and the DDF value calculation is incorrect. Ideally, the multipliers and divisors are correct. However, we also had enough devices out there where that is just rubbish. |
I was testing 1h having a 6.5W bulb connected and total consumption ( As far as I understand these data, there are only two approaches possible: AFormatting block just tells clients how to convert values to get to "kW & kWh binary" units, which is a default display to the user.
BFormatting block tells devs how to convert values to meet standards.
(C)Formatting block / measured value is just bananas, and you have to find out yourself, as @SwoopX pointed out ;) It's just a matter of what is the default/specs. Based on your feedback @ebaauw, as well as what I see in the Phoscon UI, I think the first variant is the one to go. |
Not sure where I should have said that, but I warned taking things for granted. That's also why it was suggested to verify with a known load. The zigbee spec is quite clear in my view how to use the formatting attributes (as described above) and also that the summation formatting doesn't play a considerable role 🤷♂️ |
I noticed this DDF is working fine up to
[
"119": {
"config": {
"on": true,
"reachable": true
},
"etag": "fc5336ccc8a702bc7088ee0b430738b1",
"lastannounced": null,
"lastseen": "2024-10-12T12:54Z",
"manufacturername": "IKEA of Sweden",
"modelid": "INSPELNING Smart plug",
"name": "Consumption 119",
"state": {
"consumption": 102,
"lastupdated": "2024-10-12T12:27:59.387"
},
"swversion": "2.4.34",
"type": "ZHAConsumption",
"uniqueid": "xx:xx:xx:xx:xx:xx:xx:xx-01-0702"
},
"120": {
"config": {
"on": true,
"reachable": true
},
"etag": "ac980bb68841173491ca2404464923b9",
"lastannounced": null,
"lastseen": "2024-10-12T12:54Z",
"manufacturername": "IKEA of Sweden",
"modelid": "INSPELNING Smart plug",
"name": "Power 120",
"state": {
"current": 3,
"lastupdated": "2024-10-12T12:54:56.327",
"power": 2,
"voltage": 237
},
"swversion": "2.4.34",
"type": "ZHAPower",
"uniqueid": "xx:xx:xx:xx:xx:xx:xx:xx-01-0b04"
}
] Consuming >= So my idea #7948 (comment) became a real requirement sooner as expected. I need to know how to access the other attributes (cluster Result should be similar to: Can anyone help? |
Now there's an interesting use case. I think the multiplier and divisor items should be (read-only) Does the device do something similar for So we would need to create two non-public items and change the Note to self: need to get one of these plugs. |
Feel free to add another commit vs my branch, if you know a solution, @ebaauw .
Didn't see that yet. Still haven't the update to the latest version, due it's still unavailable in DE, or still at beta stage. (People reported a completely different URL to get that from - I guess its a pre-prod host) I want to point out another thought: Since I already tested a lot what is a meaningful "report interval" + "minimal change to report", it makes sense to use the factor for the "minimal change to report" value. Connecting a Raspberry, you may be interested in reporting changes of 0,1 Watts, but having a toaster you are more interested in 10 Watt steps. When the factor changes the report config could be changed as well. What do you think? For anyone just stumbling into this topic, here are some docs: |
I don't think it does, actually. The reporting change is on the raw value, as reported by the attribute, not on the derived value after considering the multiplier/divisor. So if you set a change of 1, it will report changes from 1W between 0 and 1000W and changes from 10W above 1000W (not sure I got the scale right, but I hope you get the idea). This is probably exactly what you want. The idea is intriguing, though. I've never seen attribute reporting configuration being changed dynamically. Not sure if that's even doable from DDF. You could send the correct Zigbee message using |
You are right! Actually it will result exactly in that behavior I wish. What a great Idea by IKEA to use the attributes that way. So we only need to use the factors in the evaluation of the value to get this working. |
@ebaauw can you add a commit to my branch or briefly tell me how I can add that part? |
I don’t I see your branch, it’s probably only available on your fork? Basically, you need create two new item files in I did pick up an INSPELNING at IKEA, but have yet to put it to the test. I want to install it for my washing machine, but better double check the supported load first. |
Yes, it's on my fork. Most of the time you can't create branches on remote repos, so I'm used to that workflow. (Re-Checked: right now it's still disabled =) |
I drafted another PR #7978 for this. |
Solves #7948
Need verification / double check of Consumption calculation.
Phoscon shows value as
wH
, while comments and docs states value should be inkWh
.Anyway, I have already tested and confirmed that the raw value
0x0702 / 0x0000
in deCONZ GUI is inwH
. Based on the divisor value from0x0302
, I added a x1000 division.Maybe @ebaauw can help?