Measuring DIN kWh meters, how precise is the readout in HA?

Hey all,

I’ve got a kWh meter in the fuse box that monitors the mains, directly after the main switch. The readout is via modbus. And it reads, I think, every 3 seconds. I’ve added the total power usage with Riemann sum integral sensor to the Energy dashboard.

Now I wonder, how precise is the total usage? I mean, how precise is the usage with a 3 second interval? I was thinking. The meter has a parameter that stores the total used kWh. This is not resettable (as far as I know). Would this value not be MORE precise than an external monitor (HA)? In other words, what if I readout the total used kWh value and compare it to the last readout value.

Is this an know or existing approach? How to implement this then? If not, would it be interesting to implement this? Would it make a (huge) difference to the ‘current power usage’ readout? And if so, how would this work? Would you do a readout of the value, store the timestamp somewhere. Do another readout in 5 seconds and compare the last and current value to get the used power since last readout?

Anyway, I’m sure I’m not the first to think of this. Any thoughts?

I’ve a similar configuration with an Schneider iem3155 in my fusebox measuring both my grid import and PV export to grid. I use the energy meters total/daily register values in the HA energy dashboard.
The precision is very high as the meter has dedicated hardware for the task and a high sampling rate.

I would not even consider doing manual calculations in HA, when you have a total register at hand in your energy meter.

1 Like

Hi @htvekov , exactly. The meter is dedicated to do so. May I ask, does your meter have this necessary kWh value for the Energy Dashboard? Or do you read the total (all time) used power and calculate the used power since last readout? In other words, can you read the right value straight from the meter or do you convert it in HA?

I can read both the grid import- and export values directly from meter and feed into HA.
One register being daily total and reset at midnight (in the device) and one register as a total increasing. HA’s energy integration will manage both types without further configuration.

I read both registers in kWh from the device and push the sensor value without any conversion from ESPhome.

  # Partial energy register used here as daily energy import sensor
  # Will be reset at midnight by custom_command
  - platform: modbus_controller
    modbus_controller_id: iem3155
    name: "Daily Energy Import Total"
    id: daily_energy_import_total
    register_type: holding
    address: 45107
    unit_of_measurement: "kWh"
    device_class: energy
    # Set state_class in order for HA to use sensor in the Energy component
    state_class: total_increasing 
    value_type: FP32
    accuracy_decimals: 3

  - platform: modbus_controller
    modbus_controller_id: iem3155
    name: "Energy Export Total"
    id: total_energy_export_total
    register_type: holding
    address: 45101
    unit_of_measurement: "kWh"
    device_class: energy
    # Set state_class in order for HA to use sensor in the Energy component
    state_class: total_increasing
    value_type: FP32
    accuracy_decimals: 3
1 Like

I see. Ahhhh… hmm, the Eastron SDM630 v2 Modbus has no daily kWh register. As far as I can see.

You can use the total_increasing registers directly. HA’s energy integration will do the math for you :slight_smile:

oh-oh-snap

I did not know that. Seems to work well. Oh man, I’m happy I posted the question and not started messing with custom calculations on the same register Thanks Henning, you saved the day.

You’re welcome :sunglasses: