Power plug NAS-WR01ZE reports wrong KWh values

Hello.
I have Z-Wave power plug device NAS-WR01ZE, dbReference 1014.

Almost everything works perfect, except the KWh consumption values report.

For example, after this value is reset, device reports 0 KWh, as expected.


But when the value should be changed (for example, some energy was consumed and value is changed) - it reports strange numbers.

Then, when measurement should be changed, it can be valid or again broken, without any dependency or stable order.
Is this an issue with device itself or somehow connected with binding?
Does anybody also have such problem?

Used version: OH 2.5.0 release.
Reproduced on z-wave binding versions 2.5.0 and 2.5.1.201912260340

Thanks in advance!

Ok, i found the order how values are sent from plug.
In influx it looks like this:

1577438886732000000 0
1577438973547000000 -21474836.45
1577439047569000000 0.05
1577439126685000000 -21474836.41
1577439182757000000 0.09
1577439204863000000 -21474836.37
1577439342974000000 0.13
1577439350993000000 -21474836.33
1577441848670000000 0.17
1577441864642000000 -21474836.29
1577441902708000000 0.21
1577442123006000000 -21474836.25
1577442289228000000 0.25
1577442461488000000 -21474836.21
1577442609671000000 0.29
1577442656732000000 -21474836.17
1577442702794000000 0.33
1577442742855000000 -21474836.13
1577442869049000000 0.37
1577444100948000000 0.41

So, each second report has right value, but with wrongly set MSB in first byte in report value (f.e., 80 00 00 03).
I think, it’s an issue of device itself.

Does anybody also has such problem?

Yep, same issue on my power plugs - currently I have 4pcs and they all sometimes report wrong value

I have the same issues for sure and many people report it.
How can I just filter anything out that has this sort of reading? We can all assume that if it is below 0 then it is wrong. Does anyone have a way to read the incoming updated information and then if below 0, set the reading to the last reading value? I am sure it is possible but, what would that look like?

Hello. Yes, it’s possible.
The item, where i receive data and store data from plug, is named ZWaveNode006NASWR01ZEWallPlugSwitch_ElectricMeterKWh

First, i created a new item where i will store valid values. I named it PowerPlug_ElectricMeterKWh

Then i wrote such rule:

rule "correct received kwh values"
when
    Item ZWaveNode006NASWR01ZEWallPlugSwitch_ElectricMeterKWh received update
then
    if ((ZWaveNode006NASWR01ZEWallPlugSwitch_ElectricMeterKWh.state as Number) >= 0) {
        PowerPlug_ElectricMeterKWh.postUpdate(ZWaveNode006NASWR01ZEWallPlugSwitch_ElectricMeterKWh.state)
    }
end

And, of course, i show on sitemaps and store in influxdb the item with valid (positive) values

1 Like

Yuck! You use Simple Mode. Good luck with that long term… :frowning:

Nope, i don’t use simple mode :slight_smile: This is default name, when you create an item and link it to the channel manually. And i don’t have so much devices now to think about individual names :slight_smile: Let’s say, what i have now - is just a long-term first try or experiment :slight_smile:
New system will be built from scratch, the question is only - when :slight_smile:

1 Like

thanks, I ended up writing something similar just before you replied. However, I did not store the state in another item and updated the original item with the last reading that was above 0. I am now going to change that because your rule is cleaner.

I use Aeon HEMs for monitoring power and energy. This is what I use to correct for random odd values, which has a little more in it than checking for >0.

from personal.utils import notification

from core.rules import rule
from core.triggers import when

POWER_ANOMALY = False


@rule("Power: Mains power monitor and cleanup")
@when("Item HEM1_Total_Power changed")
def mains_power_monitor_and_cleanup(event):
    #mains_power_monitor_and_cleanup.log.debug("Power (mains): {}: start".format(event.itemState))
    message = ""
    global POWER_ANOMALY
    if not POWER_ANOMALY and event.itemState > QuantityType("38400 W") and event.oldItemState > QuantityType("38400 W") and event.itemState < QuantityType("60000 W") and event.oldItemState < QuantityType("60000 W"):
        POWER_ANOMALY = True
        message = "Power (mains) is high: {} Watts.".format(event.itemState)
    elif not POWER_ANOMALY and event.itemState >= QuantityType("0 W") and event.oldItemState >= QuantityType("0 W") and event.itemState < QuantityType("100 W") and event.oldItemState < QuantityType("100 W"):
        POWER_ANOMALY = True
        message = "Power (mains) is low: {} Watts.".format(event.itemState)
    elif POWER_ANOMALY:
        POWER_ANOMALY = False
        message = "Power (mains) has returned to normal"
    if not POWER_ANOMALY and event.itemState >= QuantityType("0 W") and event.itemState < QuantityType("60000 W"):
        events.sendCommand("HEM1_Total_Power_Cleaned", str(event.itemState))
    if message:
        notification("Power (mains)", message)


@rule("Power: Mains energy monitor and cleanup")
@when("Item HEM1_Total_Energy changed")
def mains_energy_monitor_and_cleanup(event):
    #mains_energy_monitor_and_cleanup.log.debug("Energy (mains): {}: start".format(event.itemState))
    if event.itemState >= QuantityType("0 kWh") and (event.itemState >= event.oldItemState or event.itemState < QuantityType("60 kWh")) and event.itemState <= event.oldItemState.add(QuantityType("60 kWh")):
        events.sendCommand("HEM1_Total_Energy_Cleaned", event.itemState.toString())
        delta = event.itemState.subtract(event.oldItemState)
        events.sendCommand("HEM1_Total_Energy_Delta", (delta if delta >= QuantityType("0 kWh") else event.itemState).toString())

Hi, in my system (OH 4.1.1) I solved this issue with a profile for this item in the channel-item-link:
grafik
Maybe it helps someone …