ESPHome gateway for an Eastron SDM630 / SDM630-compatible three-phase Modbus energy meter, with an example Home Assistant dashboard.
- Tested with an SDM630-compatible Modbus RTU meter.
- ESP32-S3 gateway using UART/RS485.
- Reads phase voltage, current, active/apparent/reactive power, power factor, phase angle, frequency, demand, neutral current and import/export energy registers.
- Exposes grid import/export power helpers from the signed total active power value.
- Includes an example Home Assistant dashboard and helper package for energy counters.
Validated setup:
- ESP32-S3 board with RS485 transceiver.
- SDM630 / SDM630-compatible three-phase meter.
- Modbus RTU over RS485.
- Default Modbus slave address:
1. - Default serial settings:
9600 8N1.
Default ESPHome pins in devices/sdm630-gateway.yaml:
| Signal | Pin |
|---|---|
| RS485 TX | GPIO17 |
| RS485 RX | GPIO18 |
| RS485 flow control | GPIO21 |
Adjust the pins before flashing if your board wiring is different.
The energy counter registers are protected against Modbus response mismatches, which on a busy RTU bus can otherwise record spikes of thousands of kWh in a single hour:
send_wait_time: 500msgives the meter time to answer the largest merged register block (~100 ms of pure wire time at 9600 baud) before the next command is sent. With a shorter timeout, a late CRC-valid response can be matched to the wrong request — Modbus RTU responses carry no register address — and float data from voltage/current registers gets decoded into the energy sensors.- Every
total_increasingenergy sensor has a plausibility filter that rejects decreases and implausible jumps (>1 kWh per ~10 s poll, i.e. ~360 kW), logs each rejected reading as a warning taggedsdm630.<sensor>, and re-syncs automatically after 6 consecutive consistent rejections so a reboot or a genuine counter change can never lock the filter.
devices/sdm630-gateway.yaml- ESPHome node configuration.devices/secrets.yaml.example- required ESPHome secrets template.home-assistant/packages/sdm630_energy_helpers.example.yaml- optional Home Assistant helpers for dashboard energy periods.home-assistant/dashboards/sdm630_dashboard.example.yaml- Lovelace dashboard example.
- Copy
devices/sdm630-gateway.yamlinto your ESPHome configuration folder. - Copy
devices/secrets.yaml.exampletosecrets.yamlin the same ESPHome folder and fill your own values. - Update board, UART pins and Modbus address if needed.
- Run ESPHome validation.
- Flash the ESP32 gateway.
- Import the optional Home Assistant helper package.
- Import or copy the dashboard example into a YAML Lovelace dashboard.
The dashboard assumes the default ESPHome node name sdm630-gateway, which generates entity IDs such as:
sensor.sdm630_gateway_sdm630_total_power
sensor.sdm630_gateway_grid_import_power
sensor.sdm630_gateway_grid_export_power
If you rename the ESPHome node, update the dashboard entity IDs accordingly.
The helper package creates example integration and utility-meter sensors for daily, weekly, monthly and yearly energy views. Review the helper entity IDs before installing them into an existing Home Assistant instance.
This public repository uses placeholders only. It does not contain real Wi-Fi credentials, API encryption keys, OTA passwords, LAN IPs, MAC addresses, Home Assistant tokens, local paths or private dashboard entity IDs.
Do not paste real credentials, local paths, screenshots with private data or raw Home Assistant backups in public issues.
Initial public ESPHome release. The read path is low risk, but every electrical installation and meter variant should be validated locally before relying on the values for automation or billing decisions.