EDL21 showing wrong values (partially)

I installed a IR reader (Weidmann Elektronik) via USB to my Home Assistant and configured it in the configuration.yaml

  - platform: edl21
    serial_port: /dev/ttyUSB0

After a restart I got three new sensors:

  • Metering point ID 1
  • positive_active_energy_total
  • sum_active_instantaneous_power

The ID and the total energy are working fine.
The active instantaneous power is showing the right value, until it increases above a certain level (about 400 W), for example when a pump is running. Then the value of the sensor becomes negative. It seems like the additional power is getting subtracted.

These pictures should show what I mean:

I checked the IR Reader by connecting it to a Windows laptop and read the electricity meter with the Emlog test software. I got the right values, even if the power was far above 1000 W.

Any Ideas where I could find the problem?

Raspberry Pi 4
Home Assistant OS 6.2

Hi Phillip,
same Probleme here. My first approach (bevor i found this Threat) was to try with abs() but the values in the sum_active_instantaneous_power are fare away from the value on the DWS74 Display. Maybe there is a Problem with instantaneous power and the values showing on the DWS, if I switched an Enegry Saving Lamp the values in home assistant change from -200 to +200, switch a TV on the change is -20.
Have You found any Solution?

Raspi 4
core -2021.9.7

Hi, no Solution found yet.

When the power goes beyond a certain point, maybe about 400W, the additional power will be subtracted.

For example:
Power consumption is 200W and start a consumer with 400W the shown value will be -200W.

The counting sensor (Positive active energy total) then stops being refreshed. Which means this results in a step in the graph when the power consumption is low enough again to show the right value.

Maybe if found a clue under

they describe a Error in the DZG 00 xxxxxx Smart Meters. I have such one.

Since Iam just started with Home Assistant Iam not shure how to make a Request to implement this Workaround.

ok i Try a Feature Request Work Around for DZG Smart Meter Firmware Error

As a workarroud it should also be possible to calculate…
With the Firmware Error the consumtion Value should be negativ if > 0x9999 eg 393.21 W.
So if Value is negative we have to calculate abs(value) + 393.21

It’s worth a try… tomorrow.

1 Like

Didn’t try it yet:

{% if states('sensor.sum_active_instantaneous_power') | float < 0 %}
  {{ states('sensor.sum_active_instantaneous_power') | float * -1 + 393.21 }}
{%- else -%}
  {{ states('sensor.sum_active_instantaneous_power') | float }}
{%- endif %}

the result can’t be right.

abs(value) + 393.21

This results in much to high values.

I play around with some Devices and compare the Values from the Meter Display and the reportetd Sensor Values.
Meter Sensor Difference absolute
420 -233 653
514 -147 661
317 317 0
344 -312 656
319 319 0

The power consumtion was not stable over the Sensor measurement Interval, so the absolute Difference ist not accurate.
It seems that the Point where the Meter generate negative Values ist over 319W.
With help from Google Search I found this Threat in #14 the Border for negative Values is reported as 0x8000 == 327.68W.
So if the Sensor Value jump from 327.68 to -327.69 we have a absolute Diff from 655.37

{% if states('sensor.sum_active_instantaneous_power') | float < 0 %}
  {{ states('sensor.sum_active_instantaneous_power') | float  + 655.37 }}
{%- else -%}
  {{ states('sensor.sum_active_instantaneous_power') | float }}
{%- endif %}

If this thought is correct, the electricity Meter should return to positive Numbers for Values above 655W.

The results seem much better now. I will compare these to the values shown on the smart meter this evening.

If this doesn’t work, I will try to convert the value of the sensor into hex, cut off the first digits and convert it into decimal again.

What is the Type of yout Smart Meter also a DVS74 / DWS74 with ID “DZG 00 xxxxxx” ?

It is a „DWS 7420.1“.
The ID starts with „1DZG00…“
(I’m not sure about the leading 1, I copied the number from a contract)

Your code seems to fix it for a certain range. At higher values there is still a problem. The original sensor.sum_active_instantaneous_power doesn’t get updated at all when the power is for example higher than 2000 W.

I think this has to be fixed in the EDL21 implementation.

I have the same Problem with my DVS74 and the EDL21-Sensor.
Is there any solution until now?

Best regards

No, it still doesn’t work at higher values.
There is a feature request for a workaround:

Hello together!
I’ve raised an issue for the “edl21”-Integration to get this “firmware-workaround” (mentioned above) implemented by the code-owner of the “pysml”-library which works in the background of “edl21”.

After this was fixed it was completely working for me, now with the new HomeAssistant-Release 2023.5.0 :slight_smile:

Have fun!

1 Like

I tested with version 2023.5.3. Now the values are incorrect but were correct with my previous version 2023.3.6. We have a meter which was installed this year. Could it be that the bug was fixed for newer meters?

So trying to explain again. It seems that the bug was also fixed on the meter side now so that the fix on the HA side creates problems.

I use HA 2023.10.5 with EDL21 and I have a smart meter from DZG 00 40xxxxxx. The sum_active_instantaneous_power is wrong if the value should be negative. Instead of a negative value a large positive value is displayed. I tried to installed HA 2023.3.6 but this version is too old for my configuration. What can I do?