Hi Everyone,
I want to read the energy data from a power meter (Hager SM103e with SM213 Modbus TCP communication module).
If I read the data with another software (Simply Modbus TCP Client 8.1.2) I get the correct value (~170 kW).
In Home Assistant it shows a completely different value (36.410 kW) (. Also tried other registers, they all show wrong in Home Assistant, but correct in Simply Modbus…
My configuration.yaml looks like this (The Hub named “Logger1000” works fine…):
modbus:
- name: Logger1000
type: tcp
host: 192.168.1.147
port: 502
sensors:
- name: Aktuelle Produktion PV W
unique_id: LiveProdPVW
slave: 247
scale: 1
unit_of_measurement: W
address: 8069
data_type: uint64
input_type: input
count: 4
device_class: power
- name: Tages Produktion PV kWh
unique_id: DailyProdkWh
slave: 247
scale: 0.1
precision: 1
unit_of_measurement: kWh
address: 8073
data_type: uint32
input_type: input
count: 2
swap: word
device_class: energy
state_class: total
- name: Gesamt Produktion PV kWh
unique_id: TotalProdPVkWh
slave: 247
scale: 0.1
precision: 1
unit_of_measurement: kWh
address: 8079
data_type: uint64
input_type: input
count: 4
device_class: energy
state_class: total
- name: Trafo1
type: tcp
host: 192.168.1.61
port: 502
sensors:
- name: Aktueller Verbrauch Trafo 1 kW
unique_id: AktVerbrT1kW
slave: 5
scale: 2
unit_of_measurement: kW
address: 790
data_type: int32
swap: none
count: 2
device_class: power
What I saw in the Log is, that in the Log is, that for the Logger1000 (which is working fine) it shows “SEND”, “WAITING FOR REPLY”, “PROCESSING REPLY” and “TRANSACTION COMPLETE”
2023-08-23 10:16:37.699 DEBUG (SyncWorker_4) [pymodbus.logging] SEND: 0x0 0x1f 0x0 0x0 0x0 0x6 0xf7 0x4 0x1f 0x85 0x0 0x4
2023-08-23 10:16:37.699 DEBUG (SyncWorker_4) [pymodbus.logging] New Transaction state "SENDING"
2023-08-23 10:16:37.699 DEBUG (SyncWorker_4) [pymodbus.logging] Changing transaction state from "SENDING" to "WAITING FOR REPLY"
2023-08-23 10:16:37.701 DEBUG (SyncWorker_4) [pymodbus.logging] Changing transaction state from "WAITING FOR REPLY" to "PROCESSING REPLY"
2023-08-23 10:16:37.701 DEBUG (SyncWorker_4) [pymodbus.logging] RECV: 0x0 0x1f 0x0 0x0 0x0 0xb 0xf7 0x4 0x8 0x0 0x0 0x0 0x0 0x0 0x7 0xbc 0x6
2023-08-23 10:16:37.701 DEBUG (SyncWorker_4) [pymodbus.logging] Processing: 0x0 0x1f 0x0 0x0 0x0 0xb 0xf7 0x4 0x8 0x0 0x0 0x0 0x0 0x0 0x7 0xbc 0x6
2023-08-23 10:16:37.701 DEBUG (SyncWorker_4) [pymodbus.logging] Factory Response[ReadInputRegistersResponse': 4]
2023-08-23 10:16:37.701 DEBUG (SyncWorker_4) [pymodbus.logging] Adding transaction 31
2023-08-23 10:16:37.701 DEBUG (SyncWorker_4) [pymodbus.logging] Getting transaction 31
2023-08-23 10:16:37.701 DEBUG (SyncWorker_4) [pymodbus.logging] Changing transaction state from "PROCESSING REPLY" to "TRANSACTION_COMPLETE"
2023-08-23 10:16:37.704 DEBUG (SyncWorker_4) [pymodbus.logging] Current transaction state - TRANSACTION_COMPLETE
2023-08-23 10:16:37.704 DEBUG (SyncWorker_4) [pymodbus.logging] Running transaction 11
For the power meter (which is not working correctly) it only shows “SEND” and “TRANSACTION_COMPLETE”…
2023-08-23 10:16:37.704 DEBUG (SyncWorker_4) [pymodbus.logging] SEND: 0x0 0xb 0x0 0x0 0x0 0x6 0x5 0x3 0x3 0x16 0x0 0x2
2023-08-23 10:16:37.704 DEBUG (SyncWorker_4) [pymodbus.logging] New Transaction State "SENDING"
2023-08-23 10:16:37.704 DEBUG (SyncWorker_4) [pymodbus.logging] Current transaction state - TRANSACTION_COMPLETE
2023-08-23 10:16:37.704 DEBUG (SyncWorker_4) [pymodbus.logging] Running transaction 32
Any ideas?