Skip to content

About

ESPHome SDM630 Modbus RTU gateway with Home Assistant dashboard examples

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ESPHome SDM630 Gateway

ESPHome gateway for an Eastron SDM630 / SDM630-compatible three-phase Modbus energy meter, with an example Home Assistant dashboard.

What Works

  • 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.

Hardware

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.

Reliability

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: 500ms gives 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_increasing energy 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 tagged sdm630.<sensor>, and re-syncs automatically after 6 consecutive consistent rejections so a reboot or a genuine counter change can never lock the filter.

Repository Layout

  • 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.

Quick Start

  1. Copy devices/sdm630-gateway.yaml into your ESPHome configuration folder.
  2. Copy devices/secrets.yaml.example to secrets.yaml in the same ESPHome folder and fill your own values.
  3. Update board, UART pins and Modbus address if needed.
  4. Run ESPHome validation.
  5. Flash the ESP32 gateway.
  6. Import the optional Home Assistant helper package.
  7. Import or copy the dashboard example into a YAML Lovelace dashboard.

Home Assistant 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.

Privacy

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.

Status

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.

About

ESPHome SDM630 Modbus RTU gateway with Home Assistant dashboard examples

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages