I have an energy meter which is used by my Alfen Car Charge Station to measure our electrical usage. The Alfen Charge Station uses these measurements to charge the car only when my solar panels are producing.
The energy meter is a Carlo Gavazzi EM24.
More specific: EM24DINAV53XE1X. The manufacturer describes it as:
Three-phase Energy analyzer, 120 to 277 V L-N, 208 to 480 V L-L, 5 (10) A, Modbus TCP/IP (Ethernet)
In essence it is able to measure 3 phases. And exposes the measurements over Modbus.
It has several Modbus registers that contain useful data.
| Modicon address | Address (hex) | Address (dec) | Length | Variable | Unit | Format |
|---|---|---|---|---|---|---|
| 300001 | 0000h | 0 | 2 | V L1-N | V | INT32 |
| 300003 | 0002h | 2 | 2 | V L2-N | V | INT32 |
| 300005 | 0004h | 4 | 2 | V L3-N | V | INT32 |
| 300007 | 0006h | 6 | 2 | V L1-L2 | V | INT32 |
| 300009 | 0008h | 8 | 2 | V L2-L3 | V | INT32 |
| 300011 | 000Ah | 10 | 2 | V L3-L1 | V | INT32 |
| 300013 | 000Ch | 12 | 2 | A L1 | A | INT32 |
| 300015 | 000Eh | 14 | 2 | A L2 | A | INT32 |
| 300017 | 0010h | 16 | 2 | A L3 | A | INT32 |
| 300019 | 0012h | 18 | 2 | W L1 | W | INT32 |
| 300021 | 0014h | 20 | 2 | W L2 | W | INT32 |
| 300023 | 0016h | 22 | 2 | W L3 | W | INT32 |
| 300025 | 0018h | 24 | 2 | VA L1 | VA | INT32 |
| 300027 | 001Ah | 26 | 2 | VA L2 | VA | INT32 |
| 300029 | 001Ch | 28 | 2 | VA L3 | VA | INT32 |
| 300031 | 001Eh | 30 | 2 | VAR L1 | var | INT32 |
| 300033 | 0020h | 32 | 2 | VAR L2 | var | INT32 |
| 300035 | 0022h | 34 | 2 | VAR L3 | var | INT32 |
| 300037 | 0024h | 36 | 2 | V L-N Σ | V | INT32 |
| 300039 | 0026h | 38 | 2 | V L-L Σ | V | INT32 |
| 300041 | 0028h | 40 | 2 | W Σ | W | INT32 |
| 300043 | 002Ah | 42 | 2 | VA Σ | VA | INT32 |
| 300045 | 002Ch | 44 | 2 | VAR Σ | var | INT32 |
| 300047 | 002Eh | 46 | 1 | PF L1 | INT16 | |
| 300048 | 002Fh | 47 | 1 | PF L2 | INT16 | |
| 300049 | 0030h | 48 | 1 | PF L3 | INT16 | |
| 300050 | 0031h | 49 | 1 | PF Σ | INT16 | |
| 300051 | 0032h | 50 | 1 | Phase sequence | INT16 | |
| 300052 | 0033h | 51 | 1 | Frequency | Hz | UINT16 |
| 300053 | 0034h | 52 | 2 | KWh(+) TOT | kWh | INT32 |
| 300055 | 0036h | 54 | 2 | Kvarh(+) TOT | kvarh | INT32 |
| 300057 | 0038h | 56 | 2 | DMD W Σ | W | INT32 |
| 300059 | 003Ah | 58 | 2 | DMD W Σ max | W | INT32 |
| 300061 | 003Ch | 60 | 2 | KWh(+) PAR | kWh | INT32 |
| 300063 | 003Eh | 62 | 2 | Kvarh(+) PAR | kvarh | INT32 |
| 300065 | 0040h | 64 | 2 | KWh(+) L1 | kWh | INT32 |
| 300067 | 0042h | 66 | 2 | KWh(+) L2 | kWh | INT32 |
| 300069 | 0044h | 68 | 2 | KWh(+) L3 | kWh | INT32 |
| 300071 | 0046h | 70 | 2 | KWh(+) T1 | kWh | INT32 |
| 300073 | 0048h | 72 | 2 | KWh(+) T2 | kWh | INT32 |
| 300075 | 004Ah | 74 | 2 | KWh(+) T3 | kWh | INT32 |
| 300077 | 004Ch | 76 | 2 | KWh(+) T4 | kWh | INT32 |
| 300079 | 004Eh | 78 | 2 | KWh(-) TOT | kWh | INT32 |
| 300081 | 0050h | 80 | 2 | Kvarh(-) TOT | kvarh | INT32 |
| 300091 | 005Ah | 90 | 2 | Hour | h | INT32 |
| 300111 | 006Eh | 110 | 2 | Kvarh(+) T1 | kvarh | INT32 |
| 300113 | 0070h | 112 | 2 | Kvarh(+) T2 | kvarh | INT32 |
| 300115 | 0072h | 114 | 2 | Kvarh(+) T3 | kvarh | INT32 |
| 300117 | 0074h | 116 | 2 | Kvarh(+) T4 | kvarh | INT32 |
| 300119 | 0076h | 118 | 2 | DMD VA Σ | VA | INT32 |
| 300121 | 0078h | 120 | 2 | DMD VA Σ max | VA | INT32 |
| 300123 | 007Ah | 122 | 2 | DMD A max | A | INT32 |
| 300012 | 000Bh | 11 | 1 | Carlo Gavazzi identification code | UINT16 |
For the full list you can check out the complete communication protocol. If you combine this with the manual it gets a lot easier to know what is what.
Home Assistant has support for modbus through the Modbus integration. Which is configured in `configuration.yaml`.
Below you can find the yaml configuration for all above sensors.
# Modbus
modbus:
- name: XXX
type: tcp
host: 192.168.X.X
port: 502
sensors:
- name: EM1 Phase 1 voltage
address: 0
slave: 1
unique_id: em1_phase_1_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 Phase 2 voltage
address: 2
slave: 1
unique_id: em1_phase_2_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 Phase 3 voltage
address: 4
slave: 1
unique_id: em1_phase_3_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 Phase 1-Phase 2 voltage
address: 6
slave: 1
unique_id: em1_phase_1_phase_2_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 Phase 2-Phase 3 voltage
address: 8
slave: 1
unique_id: em1_phase_2_phase_3_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 Phase 3-Phase 1 voltage
address: 10
slave: 1
unique_id: em1_phase_3_phase_1_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 Phase 1 current
address: 12
slave: 1
unique_id: em1_phase_1_current
data_type: int32
device_class: current
input_type: input
precision: 2
scale: 0.001
state_class: measurement
swap: word
unit_of_measurement: A
- name: EM1 Phase 2 current
address: 14
slave: 1
unique_id: em1_phase_2_current
data_type: int32
device_class: current
input_type: input
precision: 2
scale: 0.001
state_class: measurement
swap: word
unit_of_measurement: A
- name: EM1 Phase 3 current
address: 16
slave: 1
unique_id: em1_phase_3_current
data_type: int32
device_class: current
input_type: input
precision: 2
scale: 0.001
state_class: measurement
swap: word
unit_of_measurement: A
- name: EM1 Phase 1 active power
address: 18
slave: 1
unique_id: em1_phase_1_active_power
data_type: int32
device_class: power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: W
- name: EM1 Phase 2 active power
address: 20
slave: 1
unique_id: em1_phase_2_active_power
data_type: int32
device_class: power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: W
- name: EM1 Phase 3 active power
address: 22
slave: 1
unique_id: em1_phase_3_active_power
data_type: int32
device_class: power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: W
- name: EM1 Phase 1 apparent power
address: 24
slave: 1
unique_id: em1_phase_1_apparent_power
data_type: int32
device_class: apparent_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: VA
- name: EM1 Phase 2 apparent power
address: 26
slave: 1
unique_id: em1_phase_2_apparent_power
data_type: int32
device_class: apparent_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: VA
- name: EM1 Phase 3 apparent power
address: 28
slave: 1
unique_id: em1_phase_3_apparent_power
data_type: int32
device_class: apparent_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: VA
- name: EM1 Phase 1 reactive power
address: 30
slave: 1
unique_id: em1_phase_1_reactive_power
data_type: int32
device_class: reactive_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: var
- name: EM1 Phase 2 reactive power
address: 32
slave: 1
unique_id: em1_phase_2_reactive_power
data_type: int32
device_class: reactive_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: var
- name: EM1 Phase 3 reactive power
address: 34
slave: 1
unique_id: em1_phase_3_reactive_power
data_type: int32
device_class: reactive_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: var
- name: EM1 System phase-neutral voltage
address: 36
slave: 1
unique_id: em1_system_phase-neutral_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 System phase-phase voltage
address: 38
slave: 1
unique_id: em1_system_phase_phase_voltage
data_type: int32
device_class: voltage
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: V
- name: EM1 System active power
address: 40
slave: 1
unique_id: em1_system_active_power
data_type: int32
device_class: power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: W
- name: EM1 System apparent power
address: 42
slave: 1
unique_id: em1_system_apparent_power
data_type: int32
device_class: apparent_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: VA
- name: EM1 System reactive power
address: 44
slave: 1
unique_id: em1_system_reactive_power
data_type: int32
device_class: reactive_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: var
- name: EM1 Phase 1 power factor
address: 46
slave: 1
unique_id: em1_phase_1_power_factor
data_type: int16
device_class: power_factor
input_type: input
precision: 3
scale: 0.001
state_class: measurement
- name: EM1 Phase 2 power factor
address: 47
slave: 1
unique_id: em1_phase_2_power_factor
data_type: int16
device_class: power_factor
input_type: input
precision: 3
scale: 0.001
state_class: measurement
- name: EM1 Phase 3 power factor
address: 48
slave: 1
unique_id: em1_phase_3_power_factor
data_type: int16
device_class: power_factor
input_type: input
precision: 3
scale: 0.001
state_class: measurement
- name: EM1 System power factor
address: 49
slave: 1
unique_id: em1_system_power_factor
data_type: int16
device_class: power_factor
input_type: input
precision: 3
scale: 0.001
state_class: measurement
- name: EM1 Phase sequence
address: 50
slave: 1
unique_id: em1_phase_sequence
data_type: int16
input_type: input
precision: 0
scale: 1
state_class: measurement
- name: EM1 Frequency
address: 51
slave: 1
unique_id: em1_frequency
data_type: uint16
device_class: frequency
input_type: input
precision: 2
scale: 0.1
state_class: measurement
unit_of_measurement: hz
- name: EM1 Total imported active energy
address: 52
slave: 1
unique_id: em1_total_imported_active_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: total
swap: word
unit_of_measurement: kWh
- name: EM1 Total imported reactive energy
address: 54
slave: 1
unique_id: em1_total_imported_reactive_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: total
swap: word
unit_of_measurement: kvarh
- name: EM1 System active power dmd
address: 56
slave: 1
unique_id: em1_system_active_power_dmd
data_type: int32
device_class: power
input_type: input
precision: 2
scale: 0.1
state_class: total
swap: word
unit_of_measurement: W
- name: EM1 System active power dmd max
address: 58
slave: 1
unique_id: em1_system_active_power_dmd_max
data_type: int32
device_class: power
input_type: input
precision: 2
scale: 0.1
state_class: total
swap: word
unit_of_measurement: W
- name: EM1 Partial active energy
address: 60
slave: 1
unique_id: em1_partial_active_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Partial reactive energy
address: 62
slave: 1
unique_id: em1_partial_reactive_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kvarh
- name: EM1 Phase 1 Imported active energy
address: 64
slave: 1
unique_id: em1_phase_1_imported_active_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Phase 2 Imported active energy
address: 66
slave: 1
unique_id: em1_phase_2_imported_active_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Phase 3 Imported active energy
address: 68
slave: 1
unique_id: em1_phase_3_imported_active_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Imported active energy tariff 1
address: 70
slave: 1
unique_id: em1_imported_active_energy_tariff_1
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Imported active energy tariff 2
address: 72
slave: 1
unique_id: em1_imported_active_energy_tariff_2
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Imported active energy tariff 3
address: 74
slave: 1
unique_id: em1_imported_active_energy_tariff_3
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Imported active energy tariff 4
address: 76
slave: 1
unique_id: em1_imported_active_energy_tariff_4
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kWh
- name: EM1 Total exported active energy
address: 78
slave: 1
unique_id: em1_total_exported_active_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: total
swap: word
unit_of_measurement: kWh
- name: EM1 Total exported reactive energy
address: 80
slave: 1
unique_id: em1_total_exported_reactive_energy
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: total
swap: word
unit_of_measurement: kvarh
- name: EM1 Total load operating hours
address: 90
slave: 1
unique_id: em1_total_load_operating_hours
data_type: int32
device_class: duration
input_type: input
precision: 2
scale: 0.01
state_class: measurement
swap: word
unit_of_measurement: h
- name: EM1 Imported reactive energy tariff 1
address: 110
slave: 1
unique_id: em1_imported_reactive_energy_tariff_1
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kvarh
- name: EM1 Imported reactive energy tariff 2
address: 112
slave: 1
unique_id: em1_imported_reactive_energy_tariff_2
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kvarh
- name: EM1 Imported reactive energy tariff 3
address: 114
slave: 1
unique_id: em1_imported_reactive_energy_tariff_3
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kvarh
- name: EM1 Imported reactive energy tariff 4
address: 116
slave: 1
unique_id: em1_imported_reactive_energy_tariff_4
data_type: int32
device_class: energy
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: kvarh
- name: EM1 System apparent power dmd
address: 118
slave: 1
unique_id: em1_system_apparent_power_dmd
data_type: int32
device_class: apparent_power
input_type: input
precision: 2
scale: 0.1
state_class: total
swap: word
unit_of_measurement: VA
- name: EM1 System apparent power dmd max
address: 120
slave: 1
unique_id: em1_system_apparent_power_dmd_max
data_type: int32
device_class: apparent_power
input_type: input
precision: 2
scale: 0.1
state_class: measurement
swap: word
unit_of_measurement: VA
- name: EM1 Maximum dmd current
address: 122
slave: 1
unique_id: em1_maximum_dmd_current
data_type: int32
device_class: current
input_type: input
precision: 3
scale: 0.001
state_class: measurement
swap: word
unit_of_measurement: A
- name: EM1 Carlo Gavazzi identification code
address: 11
slave: 1
unique_id: em1_carlo_gavazzi_identification_code
data_type: uint16
input_type: input
For my future self:
- Gsheet with these registers + mapping for Home Assistant.
- If the power factor is negative, it means that electricity is used (lag: L) from the net. Positive means injecting. (lead: C)
Remark:
- I am only metering 1 phase. So I have not confirmed L2 and L3.
- I don’t use tariffs. So these are also not confirmed.