Skip to content

[bug] NAS-WR01ZE: kWh meter value displayed as negative number #2692

@andre-richter

Description

@andre-richter

Version

Checklist:

  • I am not using HomeAssistant. Or: a developer has told me to come here.
  • I have checked the troubleshooting section and my problem is not described there.
  • I have read the changelog problem was not mentioned there.

Build/Run method

  • 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.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    cannot fix ❌This is something out of our control - like invalid device behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions