Thanks for the advice. I had to change to an int32 to avoid HA throwing a conversion error and subtract ‘1’ from all of my register values as it seems the integration is fixed to 0-based numbering.
- name: Mains Total Active Energy
unique_id: active_energy
device_class: energy
state_class: total_increasing
input_type: holding
scale: 0.001
precision: 2
unit_of_measurement: kWh
data_type: int32
count: 2
slave: 1
address: 3205
Hey @beerygaz can you share an example for the configuration you have done, in the above solution I didn’t get the subtracting 1 from the register values. An example regarding the same could be a great help for me.
Sorry for the late reply. In the Schenider documentation for my power meter, the “Mains Total Active Energy” modbus register is 3206 and an Int64. Given each register can hold an Int16, we’d need to read 4 registers (3206/7/8/9) and then combine them to get the actual value.
Some modbus systems start counting their registers from 1 and some from 0 - it seems the HA implementation always uses 0-based register numbers, whereas the. Schneider documents use 1-based.
So instead of reading 4 registers 3206/7/8/9 per the manual, I tell HA to read 3205/6/7/8 - subtract ‘1’ form the register the manual says to use.
You’ll also see that I ask HA to read an int32 data_type: int32 with a count of 2 count: 2. An int32 would be two consecutive int16 registers - so 2 x int32 = 4 x int16 = 1 int64 value.