Peacefair PZEM-6L24 Three-Phase Energy Monitor
The pzem6l24 sensor platform allows you to use PZEM-6L24 three-phase energy monitors from Peacefair with
ESPHome. It is similar to the single-phase PZEM-004T V3 but measures all three
phases simultaneously, reporting voltage, current, active power, reactive power, apparent power, power factor,
and energy for each phase individually as well as combined totals.
The communication with this component is done via a UART using Modbus.
You must therefore have a uart: entry in your configuration with both the TX and RX pins set
to some pins on your board and the baud rate set to 9600, and a modbus: hub using that UART.
The PZEM-6L24 exposes two physical interfaces:
- Direct UART — a 4-pin header labeled GND / TX / RX / +5V. This is the simplest connection when the ESP is close to the meter. The TX and RX signal lines operate at 3.3 V logic, so they connect directly to any ESP32 or ESP8266 GPIO without a level shifter. The PZEM-6L24 is self-powered from its AC inputs, so the +5V pin on the UART header is not needed.
- RS-485 — screw terminals on the meter. Use an RS-485 transceiver module when the ESP is further away from
the meter, when the meter is on a shared RS-485 bus with multiple devices, or when you want proper
differential signalling for noise immunity. ESPHome is the Modbus master and has to transmit every request,
so a plain MAX485 or MAX3485 module needs its DE/RE direction pin switched by a GPIO: set
flow_control_pinon the UART component if it supports it, otherwise on the Modbus component. Modules with automatic direction control need no direction pin.
When using RS-485 with multiple devices on the same bus, each device must have a unique Modbus address (1–247). Use the DIP switches on the meter for hardware addressing, or configure a software address through the device’s settings before integrating it into ESPHome.
# Example configuration entrysensor: - platform: pzem6l24 voltage_a: name: "Voltage Phase A" current_a: name: "Current Phase A" total_active_power: name: "Total Active Power" total_active_energy: name: "Total Active Energy"Configuration Variables
Section titled “Configuration Variables”Per-Phase Sensors
Section titled “Per-Phase Sensors”Each per-phase key follows the pattern <measurement>_a, <measurement>_b, <measurement>_c. All are
optional and support all options from Sensor.
- voltage_a, voltage_b, voltage_c (Optional): Line voltage for the phase in volts (V), resolution 0.1 V.
- current_a, current_b, current_c (Optional): Line current for the phase in amperes (A), resolution 0.01 A.
- active_power_a, active_power_b, active_power_c (Optional): Active (real) power for the phase in watts (W), resolution 0.1 W.
- reactive_power_a, reactive_power_b, reactive_power_c (Optional): Reactive power for the phase in VAR, resolution 0.1 VAR.
- apparent_power_a, apparent_power_b, apparent_power_c (Optional): Apparent power for the phase in VA, resolution 0.1 VA.
- power_factor_a, power_factor_b, power_factor_c (Optional): Power factor for the phase (0.00–1.00), resolution 0.01.
- active_energy_a, active_energy_b, active_energy_c (Optional): Accumulated active energy for the phase in kWh, resolution 0.1 kWh.
- reactive_energy_a, reactive_energy_b, reactive_energy_c (Optional): Accumulated reactive energy for the phase in kVARh, resolution 0.1 kVARh.
- apparent_energy_a, apparent_energy_b, apparent_energy_c (Optional): Accumulated apparent energy for the phase in kVAh, resolution 0.1 kVAh.
Combined Sensors
Section titled “Combined Sensors”- frequency (Optional): Grid frequency in hertz (Hz), resolution 0.01 Hz. Derived from phase A (all phases share the same grid frequency).
- total_active_power (Optional): Sum of active power across all three phases in watts (W), resolution 0.1 W.
- total_reactive_power (Optional): Sum of reactive power across all three phases in VAR, resolution 0.1 VAR.
- total_apparent_power (Optional): Sum of apparent power across all three phases in VA, resolution 0.1 VA.
- total_power_factor (Optional): Combined power factor across all three phases (0.00–1.00), resolution 0.01.
- total_active_energy (Optional): Total accumulated active energy across all three phases in kWh, resolution 0.1 kWh.
- total_reactive_energy (Optional): Total accumulated reactive energy across all three phases in kVARh, resolution 0.1 kVARh.
- total_apparent_energy (Optional): Total accumulated apparent energy across all three phases in kVAh, resolution 0.1 kVAh.
Other Options
Section titled “Other Options”- update_interval (Optional, Time): The interval to check the
sensor. Defaults to
60s. - address (Optional, int): The address of the sensor if multiple sensors are attached to the same UART
bus. You will need to set the address of each device manually. Defaults to
1. - modbus_id (Optional, ID): Manually specify the ID of the Modbus hub.
pzem6l24.reset_energy Action
Section titled “pzem6l24.reset_energy Action”This action resets the energy counters on the device with the given ID when executed.
on_...: then: - pzem6l24.reset_energy: id: pzem phase: allConfiguration variables:
- id (Required, ID): The ID of the PZEM-6L24 component to reset.
- phase (Optional, string): Which energy counters to reset. One of
all(phases A, B, C and the combined total),a,b,corcombined. Defaults toall.