TapHome

Carlo Gavazzi EM24

Modbus RTU
Submitted by
Last updated: 03. 2026
Carlo Gavazzi EM24

The Carlo Gavazzi EM24 is a DIN-rail mounted 3-phase energy analyzer that communicates via Modbus RTU over RS-485. The TapHome template provides 7 devices covering per-phase energy metering (L1/L2/L3), dual-tariff energy counters (T1/T2), and bidirectional import/export totals. Each per-phase meter includes service attributes for voltage, current, apparent power, and reactive power.

The EM24 is available in direct connection variants (AV2, AV9 — up to 65 A) and CT connection variants (AV5, AV6 — for higher currents via 5 A secondary CTs). All register values are INT32 with LSW-first word order (Little Endian word swap), read via Modbus function codes 03h or 04h (interchangeable).

Hardware connection

RS-485 wiring

The EM24 has a 2-wire RS-485 serial interface. Connect using a daisy-chain topology:

  • A (line A) to A+/D+ on TapHome RS-485
  • B (line B) to B-/D- on TapHome RS-485
  • GND — connect a third wire for ground reference, grounded only at the host side

The RS-485 bus must be terminated at both ends with a 120 ohm resistor (1/2 W, 5%) between lines A and B. Termination is required even for point-to-point connections or short cable runs. For distances over 1000 m or more than 160 instruments, a signal repeater is required.

Cable specification:

  • Type: AWG24 balanced pair with third wire for GND (shielded recommended)
  • Topology: Daisy-chain only (no star or stub/tee)
  • Max cable length: 1000 m (without repeater)

Configuration

Communication parameters

The default Modbus settings match the TapHome template:

ParameterDefaultOptions
Baud rate96009600, 4800
Data bits8Fixed
ParityNoneFixed
Stop bits1Fixed
Slave ID11-247

Communication parameters can be changed via the front panel settings menu or via Modbus write commands to holding registers (H:4362 for slave ID, H:4363 for baud rate).

Changing settings via the front panel
  1. Press the joystick for 3+ seconds to enter the password page
  2. Enter the password (default: 0, change password range: 0-9999)
  3. Navigate with left/right to the desired setting page (e.g., AddrESS for slave ID, bAudrAtE for baud rate)
  4. Press the joystick to enter edit mode, use up/down to change the value
  5. Press to confirm, then scroll to End to exit settings
Application type

The EM24 supports 8 application types (A through H) that determine which measurements are available. Application H provides the most comprehensive set, including separate import/export energy, per-phase details, tariff registers, and totalizers. Applications E, F, and H operate without “easy connection”, meaning import and export energy are tracked separately — this is required for bidirectional metering in solar PV installations.

ApplicationKey FeaturesEasy Connection
ABasic: voltages, frequency, total kWh(+), power demandYes
BA + reactive energy, apparent power demandYes
CA + tariff energy, totalizers 1/2/3Yes
DSingle-phase: kWh(+), voltage onlyYes
EImport + export kWh, run hours, power, PFNo
FFull: all measurements, totalizers, per-phase detailsNo
GLike F with easy connection, per-phase, tariffsYes
HLike F without easy connection, per-phase, tariffsNo

For solar PV installations where bidirectional metering is needed, select application E, F, or H (without easy connection). With easy connection enabled (applications A-D, G), import and export energy are combined into a single total, making it impossible to distinguish grid consumption from grid feed-in.

Slave ID

When connecting multiple EM24 meters on the same RS-485 bus, each meter must have a unique Slave ID (range 1-247). After importing the TapHome template, adjust the Slave ID in the module connection settings to match the meter.

Device capabilities

The template creates 7 devices organized into three groups: per-phase energy meters, tariff counters, and bidirectional totals. All devices are read-only and polled at 15-second intervals.

Per-phase energy metering

Three ModbusElectricityMeter devices provide per-phase energy and power readings:

  • Energy L1 — phase 1 import active energy (kWh) and active power (kW). Service attributes: voltage L1-N (V), current L1 (A), apparent power L1 (VA), and reactive power L1 (VAR).
  • Energy L2 — phase 2 import active energy (kWh) and active power (kW). Service attributes: voltage L2-N (V), current L2 (A), apparent power L2 (VA), and reactive power L2 (VAR).
  • Energy L3 — phase 3 import active energy (kWh) and active power (kW). Service attributes: voltage L3-N (V), current L3 (A), apparent power L3 (VA), and reactive power L3 (VAR).
Tariff energy counters

Two ModbusVariable devices track energy consumption by tariff period:

  • Tariff 1 Energy — import active energy accumulated during tariff T1 period (kWh). Includes reactive power T1 (kvarh) as a service attribute.
  • Tariff 2 Energy — import active energy accumulated during tariff T2 period (kWh). Includes reactive power T2 (varh) as a service attribute.

Tariff switching can be controlled via digital inputs on the meter or via Modbus command (register H:4327). The EM24 supports up to 4 tariffs (T1-T4) natively, but the TapHome template tracks T1 and T2.

Bidirectional energy totals

Two ModbusVariable devices provide system-wide import and export energy counters:

  • Total Import Energy — total import (grid consumption) active energy across all phases (kWh). Includes total import reactive energy (kvarh) as a service attribute.
  • Total Export Energy — total export (grid feed-in) active energy across all phases (kWh). Includes total export reactive energy (kvarh) as a service attribute.

The export energy counter is only meaningful when the EM24 is configured with an application type that supports bidirectional metering (E, F, or H — without easy connection). With easy connection enabled, the export register remains at zero.

Module-level service attributes

The template also provides three module-level service attributes:

  • Frequency — grid frequency (Hz)
  • Keypad — front panel lock status (Locked / Unlocked)
  • Measuring System — configured wiring system (3Pn, 3P1, 2P, 1P, 3P)
Additional capabilities

The EM24 also exposes registers for line-to-line voltages (L1-L2, L2-L3, L3-L1), system-level totals for active/apparent/reactive power, per-phase and system power factor, phase sequence indicator, power demand with peak tracking, tariffs T3 and T4, per-phase export energy counters, operating hours, and partial (resettable) energy counters. These can be added in a future template update.

Troubleshooting

No communication
  1. Verify the RS-485 wiring is daisy-chained (not star topology)
  2. Check A/B terminal connections — swap A and B if communication fails
  3. Confirm bus termination: 120 ohm resistor at each end of the bus
  4. Ensure the TapHome baud rate matches the meter setting (default 9600, 8N1)
  5. Verify the Slave ID in TapHome matches the meter (default 1)
Maximum registers per request

The EM24 supports a maximum of 11 registers per read request. The TapHome template is designed within this limitation, but custom configurations should respect this constraint to avoid communication errors.

Incorrect readings
  1. Confirm the application type supports the expected measurements — export energy requires application E, F, or H
  2. Verify the measuring system (3Pn, 3P1, 2P, 1P) matches the actual wiring installation
  3. For CT-connected models (AV5, AV6), verify the CT ratio is correctly configured — incorrect ratios cause proportionally wrong energy and power readings
Register byte order

The EM24 uses Little Endian word order (LSW first, MSW second) for all 32-bit registers. The TapHome template uses LittleEndianInt32, which matches the meter’s native format. If readings appear as extremely large or small numbers, this typically indicates a byte order mismatch.

Available devices

Carlo Gavazzi EM24 Module
Service Attributes
Frequency
KeypadFront panel lock status — Locked or Unlocked
Measuring SystemConfigured wiring system — 3Pn (3-phase with neutral), 3P1, 2P, 1P, or 3P

Carlo Gavazzi EM24

Service Attributes
Frequency
MODBUSR(H, 55, Int16) / 10 + " Hz"
Keypad
IF(MODBUSr(H, 772, Uint16) = 3, "Locked", "Unlocked");
Measuring System
SWITCH(MODBUSR(H, 4354, Uint16), 0, "3Pn",
1, "3P1",
2, "2P",
3, "1P",
4, "3P",
"Error"
);
Energy L1 Electricity Meter Read-only

Phase 1 energy and power — import active energy (kWh) and instantaneous active power (kW), with service attributes for voltage, current, apparent power, and reactive power

Register: H:70 (readtotalconsumption), H:18 (readdemand) LittleEndianInt32 Unit: kWh / kW numeric
Service Attributes
Current L1
Electrical Power L1
Reactive Power L1
Voltage L1 - N

Energy L1

Read total consumption
MODBUSR(H, 70, LittleEndianInt32) / 10
Read demand
MODBUSR(H, 18, LittleEndianInt32) / 10000
Service Attributes
Current L1
MODBUSR(H, 12, LittleEndianInt32) / 1000 + " A"
Electrical power L1
MODBUSR(H, 24, LittleEndianInt32) / 10 + " VA"
Reactive Power L1
MODBUSR(H, 30, LittleEndianInt32) / 10 + " VAR"
Voltage L1 - N
MODBUSR(H, 0, LittleEndianInt32)/10 + " V"
Energy L2 Electricity Meter Read-only

Phase 2 energy and power — import active energy (kWh) and instantaneous active power (kW), with service attributes for voltage, current, apparent power, and reactive power

Register: H:72 (readtotalconsumption), H:20 (readdemand) LittleEndianInt32 Unit: kWh / kW numeric
Service Attributes
Current L2
Electrical Power L2
Reactive Power L2
Voltage L2 - N

Energy L2

Read total consumption
MODBUSR(H, 72, LittleEndianInt32) / 10
Read demand
MODBUSR(H, 20, LittleEndianInt32) / 10000
Service Attributes
Current L2
MODBUSR(H, 14, LittleEndianInt32) / 1000 + " A"
Electrical Power L2
MODBUSR(H, 26, LittleEndianInt32) / 10 + " VA"
Reactive Power L2
MODBUSR(H, 32, LittleEndianInt32) / 10 + " VAR"
Voltage L2 - N
MODBUSR(H, 2, LittleEndianInt32)/10 + " V"
Energy L3 Electricity Meter Read-only

Phase 3 energy and power — import active energy (kWh) and instantaneous active power (kW), with service attributes for voltage, current, apparent power, and reactive power

Register: H:74 (readtotalconsumption), H:22 (readdemand) LittleEndianInt32 Unit: kWh / kW numeric
Service Attributes
Current L3
Electrical Power L3
Reactive Power L3
Voltage L3 - N

Energy L3

Read total consumption
MODBUSR(H, 74, LittleEndianInt32) / 10
Read demand
MODBUSR(H, 22, LittleEndianInt32) / 10000
Service Attributes
Current L3
MODBUSR(H, 16, LittleEndianInt32) / 1000 + " A"
Electrical power L3
MODBUSR(H, 28, LittleEndianInt32) / 10 + " VA"
Reactive Power L3
MODBUSR(H, 34, LittleEndianInt32) / 10 + " VAR"
Voltage L3 - N
MODBUSR(H, 4, LittleEndianInt32)/10 + " V"
Tariff 1 Energy Variable Read-only

Tariff T1 energy counter — accumulates import active energy (kWh) when the tariff input selects T1

Register: H:76 (readstate) LittleEndianInt32 Unit: kWh numeric
Service Attributes
Reactive Power T1

Tariff 1 Energy

Read
MODBUSR(H, 76, LittleEndianInt32)/10
Service Attributes
Reactive power T1
MODBUSR(H, 84, LittleEndianInt32)/10 + " kvarh"
Tariff 2 Energy Variable Read-only

Tariff T2 energy counter — accumulates import active energy (kWh) when the tariff input selects T2

Register: H:78 (readstate) LittleEndianInt32 Unit: kWh numeric
Service Attributes
Reactive Power T2

Tariff 2 Energy

Read
MODBUSR(H, 78, LittleEndianInt32)/10
Service Attributes
Reactive Power
MODBUSR(H, 86, LittleEndianInt32)/10 + " varh"
Total Export Energy Variable Read-only

Energy exported to the grid (feed-in) — total export active energy across all phases (kWh), only active with application types E, F, or H

Register: H:92 (readstate) LittleEndianInt32 Unit: kWh numeric
Service Attributes
Reactive Power

Total Export Energy

Read
MODBUSR(H, 92, LittleEndianInt32)/10
Service Attributes
Reactive Power
MODBUSR(H, 94, LittleEndianInt32)/10 + " kvarh"
Total Import Energy Variable Read-only

Energy imported from the grid (consumption) — total import active energy across all phases (kWh)

Register: H:62 (readstate) LittleEndianInt32 Unit: kWh numeric
Service Attributes
Total Reactive EnergyTotal import reactive energy across all phases (kvarh)

Total Import Energy

Read
MODBUSR(H, 62, LittleEndianInt32)/10
Service Attributes
Total (+)
MODBUSR(H, 64, LittleEndianInt32)/10 + " kvarh"
Connection: Modbus RTU • 9600 baud• 8N1 • Slave ID: $[SlaveId]
Possible improvements (21)
  • H:6 V L1-L2 — Line-to-line voltage L1-L2, INT32 V×10
  • H:8 V L2-L3 — Line-to-line voltage L2-L3, INT32 V×10
  • H:10 V L3-L1 — Line-to-line voltage L3-L1, INT32 V×10
  • H:36 V L-N sys — System average line-to-neutral voltage, INT32 V×10
  • H:38 V L-L sys — System average line-to-line voltage, INT32 V×10
  • H:40 W sys — Total system active power, INT32 W×10
  • H:42 VA sys — Total system apparent power, INT32 VA×10
  • H:44 var sys — Total system reactive power, INT32 var×10
  • H:46 PF L1 — Phase 1 power factor, INT16 PF×1000
  • H:47 PF L2 — Phase 2 power factor, INT16 PF×1000
  • H:48 PF L3 — Phase 3 power factor, INT16 PF×1000
  • H:49 PF sys — System power factor, INT16 PF×1000
  • H:50 Phase sequence — Phase sequence indicator: 0=L1-L2-L3, 1=L1-L3-L2, INT16
  • H:52 kWh (+) TOT — Total import active energy (non-resettable), INT32 kWh×10. Template uses H:62 (partial/resettable) instead
  • H:54 kvarh (+) TOT — Total import reactive energy, INT32 kvarh×10
  • H:56 kW dmd — Power demand, INT32 W×10
  • H:58 kW dmd peak — Peak power demand, INT32 W×10
  • H:60 kWh (+) PARTIAL — Partial import active energy counter (resettable), INT32 kWh×10
  • H:88 kWh (-) L1 — Phase 1 export active energy, INT32 kWh×10. Only available on ET series or EM24 with bidirectional metering
  • H:90 kWh (-) L2 — Phase 2 export active energy, INT32 kWh×10. Only available on ET series or EM24 with bidirectional metering
  • H:96 kWh (-) L3 — Phase 3 export active energy, INT32 kWh×10. Only available on ET series or EM24 with bidirectional metering

Sources