seMetering currentSummDelivered Reporting Configuration behaviour
What happened?
@Koenkk what is the correct format for configuration in the currentSummDelivered attribute on the seMetering cluster?
In https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/lib/modernExtend.ts I see this:
seMetering: {
// Report change with every 5W change
power: {attribute: 'instantaneousDemand', divisor: 'divisor', multiplier: 'multiplier', forced: args.power, change: 5},
// Report change with every 0.1kWh change
energy: {attribute: 'currentSummDelivered', divisor: 'divisor', multiplier: 'multiplier', forced: args.energy, change: 0.1},
// produced_energy: {attribute: 'currentSummReceived', divisor: 'divisor', multiplier: 'multiplier', forced: args.energy, change: 0.1},
},
Which suggests "0.1" format should be used and will equal 0.1kWh.
However some herdsman converters are using this format:
await reporting.currentSummDelivered(endpoint, {min: 1, max: 600, change: [0, 5]});
And some herdsman converters are using this format:
await reporting.currentSummDelivered(endpoint, {min: 10, max: 3600, change: 5});
In my testing, the divisor and multiplier are being read correctly from the device:
So this particular device counts 3,600,000 per kWh.
Something is amiss somewhere.
If I use this in an external converter:
await reporting.currentSummDelivered(endpoint11, {min: 10, change: 0.1, max: 600});
Then the result is this in the UI:
And 0 being sent to the device during pairing:
On the other hand, if I use this in an external converter:
await reporting.currentSummDelivered(endpoint11, {min: 10, change: [0, 1], max: 600});
Then the result is this in the UI:
And 1 being sent to the device during pairing:
Or if I use this in an external converter:
await reporting.currentSummDelivered(endpoint11, {min: 10, change: [0, 360000], max: 600});
This is the UI:
And this is sent to the device during pairing:
If I use this in the external converter:
await reporting.currentSummDelivered(endpoint11, {min: 10, change: 3600000, max: 600});
Then this is the result in the UI:
But again, 0 is being sent to the device during pairing:
If all of these formats should be acceptable:
0.1 [0,1] 360000
Then presumably they should all produce the correct end result being sent to the device?
Finally, if I make a manual entry in the UI with any value, always 0 is sent to the device.
1000:
0 is sent to the device:
0.5:
Again 0 to the device:
3600000:
Again 0 to the device:
Or even 1:
Again 0 to the device:
What did you expect to happen?
No response
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
1.39.1
Adapter firmware version
6.10.3.0 build 297
Adapter
EZSP v8
Setup
Home Assistant Supervised Z2M addon
Debug log
No response
In modernExtend, the change for currentSummDelivered is converted here (according to divisor/multiplier): https://github.com/Koenkk/zigbee-herdsman-converters/blob/8d7f1c4aa7c253646fef7603bb1e07a307d64349/src/lib/modernExtend.ts#L1680
- 0.1 -> should not be supported, only ints
- [0,1] -> ideally this should also not be supported (but a nodejs number cannot fit a uint48 afaik) 360000 -> only this should be supported
In modernExtend, the change for currentSummDelivered is converted here (according to divisor/multiplier):
OK, so presumably if only literal values (i.e. 360000) should be accepted in the converter then that code is incorrect, since it carries out a calculation on the change value using the multiplier / divisor?
If that's the case then the issue would also be present with power / current / voltage as well.
How about the issues with the UI?
If that should accept only literal values (i.e. 360000) then that's not working, since 0 is sent to the device no matter what is entered .....
It's indeed wrong, I will put it on my backlog
Fixed now! Removed the [number, number], it's always a number now.
Changes will be available in the dev branch in a few hours from now.