opened 08:57PM - 24 May 21 UTC
closed 03:50PM - 26 May 21 UTC
cannot fix ❌
<!--
🚨🚨🚨 STOP! STOP! STOP! 🚨🚨🚨
Before opening an issue, please read and fo…llow these steps:
1. Are you using HomeAssistant?
If yes, please open your issue at https://github.com/home-assistant/core/issues
UNLESS a developer told you to come here.
2. Check the troubleshooting section if your problem is described there:
https://zwave-js.github.io/zwavejs2mqtt/#/troubleshooting/bug_report
3. Check the changelog if your problem was already fixed recently.
https://github.com/zwave-js/zwavejs2mqtt/blob/master/CHANGELOG.md
We cannot provide support if you are not using the latest version.
4. Make sure to provide the necessary information, as described here:
https://zwave-js.github.io/zwavejs2mqtt/#/troubleshooting/bug_report
If you are using HomeAssistant, this is how you do it:
Home Assistant -> settings -> Integrations -> Z-Wave JS -> Configure -> Create dump -> zip the json file and post it here.
🙏🏻🙏🏻🙏🏻 Thanks, now onto your issue:
-->
### Version
**Checklist:**
- [x] I am **not** using HomeAssistant. **Or:** a developer has told me to come here.
- [x] I have checked the troubleshooting section and my problem is **not** described there.
- [x] I have read the changelog problem was **not** mentioned there.
Build/Run method
- [x] Docker
- [ ] PKG
- [ ] Snap package
- [ ] Manually built (git clone - yarn install - yarn run build )
zwavejs2mqtt version: 4.3.1
zwave-js version: 7.5.1
### Describe the bug
The `kWh` meter of the `NAS-WR01ZE` (https://devices.zwave-js.io/?jumpTo=0x0258:0x0200:0x1027:2.32) smart plug is reported/displayed as a negative number.
After resetting the accumulated meter values, sane positive values are reported for sometime, but at some point it flips to negative.
zwavejs2mqtt.log:
```
2021-05-24 20:46:26.806 DEBUG SOCKET: Event ZWAVE_API emitted to FHb1fJMDSyU3lbGJAAAB
2021-05-24 20:46:26.808 INFO ZWAVE: Calling api refreshCCValues with args: [ 42, 50, [length]: 2 ]
2021-05-24 20:46:26.971 INFO ZWAVE: Node 42: value updated: 50-0-value-65537 -21474836.13 => -21474836.13
2021-05-24 20:46:27.120 INFO ZWAVE: Node 42: value updated: 50-0-value-66049 27.85 => 27.49
2021-05-24 20:46:27.266 INFO ZWAVE: Node 42: value updated: 50-0-value-66561 234.62 => 234.93
2021-05-24 20:46:27.410 INFO ZWAVE: Node 42: value updated: 50-0-value-66817 0.25 => 0.25
```
zwavejs.log:
```
2021-05-24T20:46:26.811Z CNTRLR » [Node 042] querying meter value (type = Electric, scale = kWh, rate type = Con
sumed)...
2021-05-24T20:46:26.975Z CNTRLR » [Node 042] querying meter value (type = Electric, scale = W, rate type = Consu
med)...
2021-05-24T20:46:27.123Z CNTRLR » [Node 042] querying meter value (type = Electric, scale = V, rate type = Consu
med)...
2021-05-24T20:46:27.268Z CNTRLR » [Node 042] querying meter value (type = Electric, scale = A, rate type = Consu
med)...
```
The negative value also gets picked up by Home Assistant.
### To Reproduce
Let the device report for some time.
### Expected behavior
A sane number being reported.
### Additional context
*I am unsure if this is a SW issue or a quirk with the device itself, since it looks like bit 31 is being flipped.*
The screenshot below was made not too long after a reset of the accumulated values. If I take the negative number and flip bit 31 from 1 to 0, we get `35`, which would be `0.35` kWh I presume, and that would make sense given that a reset was done earlier.
This is happening on multiple of the same devices I own, not only a single one.
