The ADE7953 is a single-phase electricity-metering IC with two current-measurement channels. When a compatible board already contains its mains-voltage sensing network and current-sensing circuits, ESPHome can expose voltage, frequency, current, active power, apparent power, reactive power and power factor to Home Assistant. A familiar implementation is the original Shelly 2.5. This guide concentrates on the measurements, what the two channels really mean, a documented Shelly 2.5 configuration, and how to turn watts into useful energy histories.
This is not a generic mains-wiring tutorial. An ADE7953 chip or unverified breakout cannot be wired directly to household AC, and a board that operates from mains may have a microcontroller ground that is itself live. The safe approach is to use a correctly designed, enclosed metering product, keep mains work with a qualified professional and never attach a USB programmer or ESP32 development board to an energised or otherwise unverified non-isolated device.
What the ADE7953 measures
The IC measures one AC voltage waveform and two current waveforms, labelled A and B. It uses those simultaneous measurements to calculate electrical quantities for each current channel relative to the same voltage reference. That is useful for two loads connected to the same phase, such as the two outputs of a supported dual-channel smart relay. It does not provide two independent voltage channels, and it is not a substitute for a three-phase meter.
| Reading | Meaning | Practical use |
|---|---|---|
| Voltage (V) | Measured voltage of the common single-phase reference | Check mains voltage and contextualise both channels |
| Current A/B (A) | RMS current in each input | Observe two separate loads or branches |
| Active power A/B (W) | Real power for each channel | Track consumption and calculate kWh |
| Apparent power A/B (VA) | Voltage × current magnitude | Understand power supplied to a non-resistive load |
| Reactive power A/B (var) | Reactive component of AC power | Diagnose certain motors and inductive loads |
| Power factor A/B | Relationship between active and apparent power, including convention/sign | Understand why current × voltage is not necessarily watts |
For example, if both channels measure loads on a nominal 230 V single-phase supply, channel A can read a heater while channel B reads a fan. The voltage reference is shared, but current and active power are independent measurements. If channel B actually belongs to a different phase, applying the first phase’s voltage waveform can produce incorrect power and energy results. The ESPHome component documentation describes the sensor specifically as single phase.
ADE7953 versus ATM90E32, PZEM and CT-only monitoring
The ADE7953 occupies a different niche from the ESP32 CT-clamp monitor: a CT-only installation measures current but needs a voltage reference for genuine active power and power factor. The ADE7953 already incorporates the metering calculations, provided the complete hardware includes properly designed voltage and current sensing. The ATM90E32, covered in our previous multi-circuit article, has three current channels and three voltage channels; those extra voltage inputs matter when monitoring multiple phases.
A PZEM-016 module instead exposes its measurements over RS485 and is often considered when the measurement hardware should sit away from the ESP32. The relevant choice is not simply “which chip measures more channels?” It is whether the finished product is suitable for the circuit, whether its sensing is calibrated and electrically safe, and which interface is actually available on that product.
Before buying or flashing hardware
- Check the complete metering product, exact hardware revision, supply requirements and approved load rating; the ADE7953 IC rating is not the relay, PCB or terminal rating.
- Confirm that both measured loads are on the phase used by the product’s voltage-sensing network. Do not assume two outputs automatically mean two independent phases.
- Identify whether the host device is an ESP8266, an ESP32 or another controller. Shelly 2.5 is an ESP8266-based example, not an ESP32 development board.
- Retain a working firmware backup and the actual relay, switch, thermal-protection and safe-boot requirements of the product. Monitoring-only YAML is not a substitute for its complete control firmware.
- Verify how any programming interface is isolated. If the manufacturer does not establish safe isolation, treat all accessible programming pads and ground as potentially mains-live.
Important: Some mains-powered smart devices connect their digital ground directly to mains circuitry. A laptop, USB adapter, oscilloscope ground or another ESP32 connected to those pads can create an electric-shock or equipment-damage hazard. Only connect programming/debug equipment when the device is properly disconnected and its circuit-specific safe programming method has been verified by a qualified person. Do not test exposed circuitry while energised.
How the host controller talks to ADE7953
ESPHome supports both ade7953_i2c and ade7953_spi. The I²C configuration defaults to address 0x38; SPI requires the actual chip-select pin. These are alternative host interfaces, not two separate metering chips. The chosen bus and GPIO pins must match the board schematic. A bare IC also needs the correct clock, analogue front end, reference components and layout: supplying only SDA and SCL does not build an electricity meter.
For a custom properly isolated ESP32 metering assembly, an I²C configuration could start with SDA on GPIO21 and SCL on GPIO22, at logic levels verified against the isolated host interface. Those pin names describe the host only; they do not specify a safe voltage-sensing or current-sensing circuit. On any product with non-isolated metering electronics, a direct ESP32 connection is not acceptable without a separately engineered isolation boundary.
# ESP32 host-side illustration ONLY.
# Requires a verified isolated ADE7953 interface and
# a separately engineered, correctly rated metering front end.
i2c:
sda: GPIO21
scl: GPIO22
scan: true
sensor:
- platform: ade7953_i2c
address: 0x38
voltage:
name: "Meter Voltage"
current_a:
name: "Meter Current A"
current_b:
name: "Meter Current B"
active_power_a:
name: "Meter Active Power A"
active_power_b:
name: "Meter Active Power B"
update_interval: 10s
For SPI hardware, use spi: plus platform: ade7953_spi and its board-specific cs_pin. Do not copy an arbitrary pin map from a different meter. In both cases, the measurement channel naming should follow the schematic and an independent verification under known load, rather than a guess based on connector position.
A documented real-world example: original Shelly 2.5
The original Shelly 2.5 contains an ESP8266 and ADE7953. ESPHome documents I²C on GPIO12 (SDA) and GPIO14 (SCL), plus the ADE7953 IRQ connection on GPIO16. Its device-specific documentation states that specifying irq_pin: GPIO16 is required to avoid a documented overheating condition on this model. The example below is a measurement-focused firmware illustration for a device already running ESPHome. It deliberately does not define relay or button control and must not be installed as the complete firmware of a live dual-relay installation.
# Original Shelly 2.5 -- measurement section for an
# EXISTING, complete, correctly configured ESPHome device.
# Merge into the complete device YAML; do not overwrite
# the relay/switch/thermal-protection configuration.
i2c:
sda: GPIO12
scl: GPIO14
scan: true
sensor:
- platform: ade7953_i2c
address: 0x38
irq_pin: GPIO16
voltage:
name: "Shelly Supply Voltage"
frequency:
name: "Shelly AC Frequency"
current_a:
name: "Shelly Output 2 Current"
current_b:
name: "Shelly Output 1 Current"
active_power_a:
name: "Shelly Output 2 Power Raw"
id: shelly_power_a
active_power_b:
name: "Shelly Output 1 Power Raw"
id: shelly_power_b
apparent_power_a:
name: "Shelly Output 2 Apparent Power"
apparent_power_b:
name: "Shelly Output 1 Apparent Power"
power_factor_a:
name: "Shelly Output 2 Power Factor"
power_factor_b:
name: "Shelly Output 1 Power Factor"
update_interval: 10s
The original Shelly 2.5 hardware documentation maps the ADE7953 A/B current measurements to opposite external output labels. However, published ESPHome examples differ in their treatment of active-power signs: the component documentation shows a negative multiplier for both channels, while the ESPHome device entry describes one normal-sign channel and one inverted-sign channel. Do not assume either convention is universal across firmware versions and board revisions. Start with raw values, identify which output changes with a known resistive load and determine whether a sign correction is actually needed.
If a channel produces approximately −60 W when an independently measured 60 W resistive load is operating, apply a sign correction to that channel only, after confirming the measurement, wiring and hardware version. A single sign correction is a numerical convention, not a cure for incorrect calibration or a phase mismatch. If you require power-flow direction for import/export monitoring, converting every negative measurement to its absolute value would destroy that information.
# Add this filter under the affected active_power_* sensor ONLY
# after verifying that its sign is inverted on your hardware:
filters:
- multiply: -1
Preparing a working ESPHome installation
If the device is already running ESPHome, keep its existing esphome:, controller definition, Wi-Fi, API, OTA, relay/switch, button and safety configuration, and merge in just the ADE7953 measurement section. On the original Shelly 2.5 the microcontroller definition is normally an ESP8266 board profile, not esp32:. Do not change the framework or memory layout as part of a metering-only adjustment unless you have validated that change against the exact device revision.
After merging, use ESPHome’s configuration validation before uploading, and retain the last working YAML. Native OTA configuration uses ota: - platform: esphome in current ESPHome releases. Authentication and encryption settings must match the firmware already installed on the device; moving an older OTA-password deployment to encrypted OTA needs the documented staged migration, not a simultaneous untested replacement of both settings. The official OTA guide covers these details.
Keep the first metering test simple: no automated relay switching, no motor control and no energy-based load shedding. Verify stable voltage, update intervals and the individual channel mapping while the installed device continues its normal approved control operation. If the unit starts overheating or its relay behaviour changes, disconnect it using the normal safe isolation procedure and investigate the hardware and full firmware before further use.
Interpreting watts, volt-amperes and power factor
A 100 W resistive lamp on 230 V nominal AC should ordinarily show active power near its real consumption, and apparent power in a similar range. A motor or switch-mode supply may draw current out of phase with the voltage or draw a distorted waveform; then volts × amperes gives apparent power, not necessarily active power. Power factor helps explain the difference. Do not calibrate a meter by setting current × 230 equal to wattage for every appliance.
Some loads also vary quickly. With a ten-second update interval, ESPHome samples its measurements periodically for reporting; a short startup surge may never appear in the Home Assistant history. More frequent reporting can improve responsiveness but increases logging and network traffic, and it still does not turn these values into certified billing measurements. Choose a reporting interval based on the application rather than the fastest value the interface permits.
Calibrate each channel against a reference
First use a stable resistive load that is safely within the product’s rating. Compare reported active power to a trusted reference meter operating on the same load. Switch off that output, apply the reference load to the other output and repeat. Watch the raw current and power readings simultaneously; this confirms both calibration and A/B mapping.
- Voltage: compare the ADE7953 reading with an appropriate reference measurement carried out safely by a qualified person. Both channels depend on this common voltage measurement.
- Current: compare each channel separately at more than one normal operating point. A channel may appear correct near one ampere and diverge at higher load if its sensing hardware or gain is wrong.
- Active power: verify under a resistive load before inspecting power-factor or reactive-power readings on more complex loads. Check the sign rather than applying
abs()blindly. - Zero load: review idle noise and offset. A small zero-load fluctuation should not be treated as evidence of consumption or fixed by suppressing every negative value.
- Repeatability: retest after firmware updates and after changes to wiring, board revision or load placement. Keep a record of reference readings and the applied configuration.
ESPHome exposes voltage_gain, current_gain_a, current_gain_b, and channel-specific active-power gain settings. Their default values are register-scale coefficients, not user-friendly “amps per volt” constants. Adjust them only with hardware-specific calibration instructions and a repeatable reference test; a mismatch caused by an incorrect current sensor or phase reference cannot be repaired by a convenient multiplier. You can use a sensor filters: multiply factor for modest presentation corrections, but document the reason and do not use filtering as a substitute for safe, correctly designed sensing.
Convert active power into energy for Home Assistant
Power is the instantaneous rate in watts; energy accumulates consumption over time in watt-hours or kilowatt-hours. A meter reporting 100 W continuously for two hours has measured about 0.2 kWh. The ADE7953 ESPHome component exposes active-power sensors, so you need an accumulation step before using each output as an energy-consumption entity.
For an already deployed Shelly, a straightforward approach is to perform that accumulation in Home Assistant, using one Integral (Riemann sum integral) helper per output. Choose the correctly signed active-power entity, set the integration time unit to hours and use kWh scaling as appropriate to the helper configuration. Check that the created entities report kWh and have the correct energy device and state classes before adding them as individual devices in the Energy dashboard. The integration accumulates reported samples: missed intervals during an ESPHome/Home Assistant/network outage can reduce the estimate.
Alternatively, add ESPHome integration sensors to the same existing sensor: list, using the IDs defined in the measurement example. The output below integrates watts over hours into Wh and then multiplies by 0.001 for kWh. It presumes that the two power channels have already been verified to report non-negative consumption for the chosen loads. If a channel can export power, split import and export before constructing consumption-only totals rather than integrating signed net power as a monotonic consumption counter.
# Append both entries to your EXISTING sensor: list.
# Requires the previously defined shelly_power_a / shelly_power_b IDs.
- platform: integration
name: "Shelly Output 2 Energy"
sensor: shelly_power_a
time_unit: h
integration_method: trapezoid
restore: false
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
accuracy_decimals: 3
filters:
- multiply: 0.001
- platform: integration
name: "Shelly Output 1 Energy"
sensor: shelly_power_b
time_unit: h
integration_method: trapezoid
restore: false
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
accuracy_decimals: 3
filters:
- multiply: 0.001
With restore: false, these on-device integration totals restart at zero after an ESPHome reboot. Home Assistant can often interpret a genuine reset on a total_increasing source, but historical reconciliation deserves checking, particularly if the device is frequently rebooted or offline. Setting restore: true may preserve an intermediate total at the cost of flash writes; it does not recover energy consumed while the controller was not measuring. For a mains-powered device with Home Assistant available, the Home Assistant Integral helper is often simpler for keeping the accumulation outside the embedded flash.
Add the resulting channel-energy entities in Settings → Dashboards → Energy as individual devices, not as two separate electricity-grid import meters. If both are downstream of the same grid meter, the Home Assistant grid total already includes them; putting each submeter into “grid consumption” would double-count. If one downstream sensor includes the other, do not sum them without accounting for that overlap. Home Assistant’s own guidance also warns that summing asynchronously resetting daily counters can create inflated statistics.
Optional accumulated-energy registers
The ADE7953 component offers use_accumulated_energy_registers: true. Its documentation says this changes the mechanism used to calculate power to use the chip’s energy accumulation between reads, which can provide a better estimate over the interval. It does not automatically expose a persistent lifetime kWh register in Home Assistant, and it does not remove the need for an energy entity or a sensible restart strategy. Test the effect on your exact firmware and product before assuming it improves every use case.
Practical troubleshooting
| Symptom | What to check |
|---|---|
| No sensor data or I²C address missing | Confirm that the host I²C pins and 0x38 address match the actual board. Check firmware logs; never probe live non-isolated pads with ordinary USB equipment. |
| Output labels are reversed | Switch a known load on one output at a time and observe raw A/B current and power; the original Shelly 2.5 has documented reversed external labels. |
| Power is negative for an ordinary consuming load | Confirm channel mapping, then check the board-specific sign convention before applying a per-channel −1 filter. Do not automatically use absolute values for bidirectional systems. |
| Voltage looks plausible but power is wrong | Check the load belongs to the measured phase, each current channel’s hardware and its calibration. Never infer watts from current alone for arbitrary AC loads. |
| One load works but the other is zero | Check which current channel senses the relevant relay output and whether it has actually been energised, without defeating the device’s normal protection. |
| Energy is absent from Home Assistant | Watts are power; create a suitable kWh integration entity, verify energy device class/state class and investigate any Statistics warnings. |
| Energy jumps after reboot or restart | Check whether an on-device accumulator restarted, whether cumulative sensors are being added incorrectly, and whether historic long-term statistics need correction. |
| Device becomes unusually warm | Stop using it and investigate its complete hardware/firmware. On original Shelly 2.5, verify the documented GPIO16 IRQ configuration and all original thermal and control protections. |
When to choose a different meter
Use the ADE7953 when an existing, properly engineered single-phase product already provides two independently sensed current channels with their common voltage reference. Choose a dedicated three-phase meter when the currents are on different phases, or a documented isolated RS485 meter when physical separation between the mains metering assembly and ESP32 is essential. For a non-invasive electricity meter reader, our optical pulse-reader guide avoids electrical connection to the meter’s internal mains circuit. The energy-monitoring methods comparison sets out where pulse, CT, PZEM and Modbus approaches fit.
The practical takeaway is to separate the metering IC’s theoretical capabilities from the finished board’s capabilities and safety. Two ADE7953 current channels can make an excellent two-load monitor on one phase, but correct phase reference, channel mapping, calibration, isolation and energy accumulation determine whether the Home Assistant figures are trustworthy.
Further reading and official references
- ESPHome: ADE7953 Power Sensor — supported I²C/SPI settings and the Shelly 2.5 note.
- ESPHome Devices: Shelly 2.5 — model-specific channel mapping, sign guidance and IRQ pin.
- ESPHome: Integration Sensor — power-to-energy integration and restart behaviour.
- Home Assistant: Individual device energy usage — adding calculated kWh to the dashboard.
- Home Assistant: Energy FAQ — power versus energy and pitfalls with summed resettable totals.
- ESPHome: Native OTA — current OTA syntax and migration precautions.