zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Negative value of energy meter

Open Destroyer061090 opened this issue 1 year ago • 6 comments

What happened?

updating Z2Mqtt to version 2.6.2-1 for Modello ZigBee TS0601 _TZE204_81yrt3lo (Bidirectional energy meter with 80A current clamp) i got negative value...

Just before update i got 169.99 kWh. After the update it befocome -170 kWh.

this is the link of the installed product: https://it.aliexpress.com/item/1005006245657117.html?spm=a2g0o.order_list.order_list_main.240.6c433696859Vuo&gatewayAdapt=glo2ita

Consider I have 2 devices and both has the same problem.

What did you expect to happen?

I was expecting to have positive values

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

2.6.2-1

Adapter firmware version

20250903.5

Adapter

ttyACM0 /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20230220210310-if00 ember

Setup

Versione Zigbee2MQTT [2.6.2] Versione frontend [2.2.1] Versione zigbee-herdsman-converters [25.35.1] Versione zigbee-herdsman [6.1.5]

Device database.db entry

No response

Debug log

No response

Destroyer061090 avatar Oct 02 '25 14:10 Destroyer061090

I have the same problem Negative values of produced energy after update to version 2.6.2 I use the same device from ali

geohunter53 avatar Oct 02 '25 19:10 geohunter53

use a template that does (sensor ) * - 1 ,it will fix it,or just flip the clamp

badr-ctrl avatar Oct 03 '25 08:10 badr-ctrl

use a template that does (sensor ) * - 1 ,it will fix it,or just flip the clamp

this is only a workaround... up to now I moved back to previous version of Z2M.

Destroyer061090 avatar Oct 03 '25 08:10 Destroyer061090

Hello, I had the same problem. I found the origin. It's in the specific parameters of the sensors on Zigbee2MQTT. You have to set the energy flow (a and b) to true invert. However, the energy part has completely lost count and no longer displays values for these two sensors. I think it's because over 24 hours it recorded negative values. I find them in the sensor history. And I'm not yet good enough in database to correct it.

DizHell avatar Oct 05 '25 08:10 DizHell

This has been fixed in the latest dev.

Changes will be available in the dev branch in a few hours from now and in the next release which is every 1st of the month.

Koenkk avatar Oct 05 '25 13:10 Koenkk

I switched to koenkk/zigbee2mqtt:latest-dev, recreated my docker container.. But for me it was not fixed.

If signed_power_b=true, then invert_energy_flow_b: true did not show any effect: negative values e.g. -87W the whole time.

But I'm quite new to Zigbee2MQTT.. Not super sure.

danielsippel avatar Oct 07 '25 20:10 danielsippel