BUG - Sporadic Register Shift with Modbus TCP

I have integrated my WEM3080T into my HomeAssistant using the Modbus TCP interface.

It worked like expected a long time.

After updating the firmware of the WEM3080T to i.75.99.bin i have noticed strange measurement values in my energy dashboard in HomeAssistant.

I have analysed the issue and found sporadic strange measurement values coming from my WEM3080T. See the following chart.

The ImportEnergy_SUM drops from ~5kWh to ~2kWH, strange, the import energy should not drop (without a reset) at all.

The Voltage drop from ~230V to ~0V and at the same time the Current raises from ~0A to ~230V. 

This looks like the values of current and voltage are exchanged.

So i analysed further and recorded the raw word values of all Modbus TCP registers 0-55 and found that when this sporadic bug happens, all register values are shifted one register up. So the value of register 0 is now in the register 1 and so on. See the following table.

Registernormal valuestrange value
023324-
12823314
2028
3280
41128
578511
60785
700
84380
92441
10233262
1116423316
120164
133520
1418354
151357918
16913579
17381659
1892038165
190920
20233930
212123384
22021
23420
24942
25334419
26033441
2700
288660
290862
3050010
3105001
3200
334230
3436424
355201436
36752017
37441387
38044138
3900
4000
4100
4200
4300
4400
4500
4600
4700
4800
4900
5000
5100
5200
5300
5400
5500

The sporadic bug is very short and after that the values are in the correct registers again.

I updated my WEM3080T to the current firmware i.76.058.8.bin to see if the bug is already fixed. But i noticed that the bug is still present.

I found a workaround for myself. I used the HTTP Request API in combination with the HACS component https://github.com/lewei50/ha_iammeter.

I would like to share my findings with you and hope you can find the root cause for the issue.



Thread Status
21
116
3
0
0

Sort replies by:

Thanks for your sharing,

Please let me know ,when do you first find this issue.

We happen to upgrade the modbus hacs several days before, I think this issue may be caused by the latest upgrading.
we will check it soon.

 please try to request the modbus/tcp from the YAML ,like this 

https://imeter.club/topic/713#content3836


and check whether this issue would occur again.


Of course ,we would also check the issue of modbus HACS from ourside.

Hello,
1. Did you use the manual register setting method in configuration.yaml (instead of the hacs->IamMeter-modbus mode)
2. Is the data in your list exported from homeassistant?

I have integrated my WEM3080T into my HomeAssistant using the Modbus TCP interface.It worked like expected a long time.After updating the firmware of the WEM3080T to i.75.99.bin i have noticed strange measurement values in my energy dashboard in HomeAssistant.I have analysed the issue and found sporadic strange measurement values coming from my WEM3080T. See the following chart.The ImportEnergy_SUM drops from ~5kWh to ~2kWH, strange, the import energy should not drop (without a reset) at all.Th

Hello, i first found the issue ~2 weeks ago.

I am using the HomeAssistant Modbus Integration, i am not using the ha_iammeter_modbus HACS.

Thanks for your sharing,Please let me know ,when do you first find this issue.We happen to upgrade the modbus hacs several days before, I think this issue may be caused by the latest upgrading.we will check it soon.

You can add another ha_iammeter_modbus for comparison, or install a new homeassistant and use HomeAssistant Modbus Integration for comparison. I encountered similar problems when using HomeAssistant Modbus Integration a long time ago, especially when adding multiple modbus hubs.

Hello, i first found the issue ~2 weeks ago.I am using the HomeAssistant Modbus Integration, i am not using the ha_iammeter_modbus HACS.

I have changed my YAML Modbus Configuration to the Configuration from https://imeter.club/topic/713#content3836.
This configuration only contains the Power measurements from the three phases.

I will observe if the issue is present with this configuration as well.

 please try to request the modbus/tcp from the YAML ,like this https://imeter.club/topic/713#content3836and check whether this issue would occur again.Of course ,we would also check the issue of modbus HACS from ourside.

1. Yes i use the  manual configuration via YAML for the HA Modbus Integration.

2. The data comes from HomeAssistant. The values are readings from home assistant, not real exports.

Hello,1. Did you use the manual register setting method in configuration.yaml (instead of the hacs->IamMeter-modbus mode)2. Is the data in your list exported from homeassistant?

Well, if conditions permit, you can try it as I said above.

1. Yes i use the  manual configuration via YAML for the HA Modbus Integration.2. The data comes from HomeAssistant. The values are readings from home assistant, not real exports.

It seams to me that the issue is also present with the configuration i should use from https://imeter.club/topic/713#content3836.

I compared the measurement values from Modbus TCP and HTTP and exported the measurements. How can i upload you a history.csv file?

I have changed my YAML Modbus Configuration to the Configuration from https://imeter.club/topic/713#content3836.This configuration only contains the Power measurements from the three phases.I will observe if the issue is present with this configuration as well.

You can send the .csv data to support@devicebit.com. Earlier today, I exported the data from my hacs integrated ha_iammeter_modbus and checked it. There was no data confusion.

It seams to me that the issue is also present with the configuration i should use from https://imeter.club/topic/713#content3836.I compared the measurement values from Modbus TCP and HTTP and exported the measurements. How can i upload you a history.csv file?

I send you a history.csv export with measurements and also my YAML configuration file i use with the Modbus HA integration.

I also installed the HACS ha_iammeter_modbus integration.

I will observe if the issue is present again and if it only happens with the Modbus HA integration.

OK

I send you a history.csv export with measurements and also my YAML configuration file i use with the Modbus HA integration.I also installed the HACS
      ha_iammeter_modbus integration. I will observe if the issue is present again and if it only happens with the Modbus HA integration.

Hi Tim,

Have you used this Modbus interface recently, say within the last 2-3 weeks, or was it a long time ago?

I’d like to know if this issue occurred when you first started requesting data from Modbus in Home Assistant (HA), or if it had been running normally for a long time and only became abnormal in the last 2-3 weeks.

Hello, i first found the issue ~2 weeks ago.I am using the HomeAssistant Modbus Integration, i am not using the ha_iammeter_modbus HACS.

Hello, I put the yaml configuration you sent into my homeassistant and the interval for getting data is 15 seconds, while the data in the csv you sent is 5 seconds. In addition to the yaml configuration you sent, have you set any other parameters?

I send you a history.csv export with measurements and also my YAML configuration file i use with the Modbus HA integration.I also installed the HACS
      ha_iammeter_modbus integration. I will observe if the issue is present again and if it only happens with the Modbus HA integration.

I am using the Modbus interface of the WEM3080T for ~1 year with the HomeAssistant Modbus Integration and it worked fine for a long time.

But some weeks ago (2-4 weeks) i first noticed the issue. The issue was not present before, i could verify this by the energy charts of HA.

The issue did not occure when i first started requesting data from the WEM3080T via Modbus from HA.

Hi Tim,Have you used this Modbus interface recently, say within the last 2-3 weeks, or was it a long time ago?I’d like to know if this issue occurred when you first started requesting data from Modbus in Home Assistant (HA), or if it had been running normally for a long time and only became abnormal in the last 2-3 weeks.

In my YAML configuration the default scan_interval of 15s is used, cause i did not specify it.

The history.csv measurement data was generated using the configuration from https://imeter.club/topic/713#content3836.

In this configuration the scan_interval is changed to 5s. If you want to i can also export another history.csv with my configuration, if the issue occures again.

Hello, I put the yaml configuration you sent into my homeassistant and the interval for getting data is 15 seconds, while the data in the csv you sent is 5 seconds. In addition to the yaml configuration you sent, have you set any other parameters?

Also, the entity names in your yaml configuration file do not correspond to the names in the csv file one to one, so I am not sure whether the entity configurations in your csv data correspond to the yaml. Also, are there multiple names in your homeassistant: hub1?

I see. You still have the problem after using this configuration. I wonder if you can install another homeassistant and use the same configuration to read the data to see if the problem still exists.

I have sent you another export history2.csv via mail.

You can find the values ImportEnergySum, ExportEnergySum, VoltageL2/B, CurrentL2/B from all three interfaces i use at the moment.

* HomeAssistant Modbus Integration with the YAML configuration i sent you

* HACS IAMMeter Http

* HACS IAMMeter Modbus

Also, the entity names in your yaml configuration file do not correspond to the names in the csv file one to one, so I am not sure whether the entity configurations in your csv data correspond to the yaml. Also, are there multiple names in your homeassistant: hub1?

I just analyzed your data. From the data, we can see that the data obtained from HACS IAMMeter Modbus is normal, but the data obtained from 'HomeAssistant Modbus Integration with the YAML configuration' is problematic. This can determine that the modbustcp data source of the electricity meter is normal, and the problem is in HomeAssistant Modbus Integration. You can try to delete all custom configurations and only keep sensor.voltage_l2 to see if there is still a problem. If the problem is solved, then there is a problem with your yaml configuration. If there is still a problem, then there may be a problem with your ha, and you may need to go to the ha forum to seek official help.

I have sent you another export history2.csv via mail. You can find the values ImportEnergySum, ExportEnergySum,
      VoltageL2/B, CurrentL2/B from all three interfaces i use at the
      moment.
    * HomeAssistant Modbus Integration with the YAML configuration i
      sent you
    * HACS IAMMeter Http
    * HACS IAMMeter Modbus
Looks like you are new here. Register for free, learn and contribute.