Termo Solar — SR501 Water Heater Sensor for ESPHome

ESPHome component that reads temperature and water level from an SR501 solar water heater controller via its proprietary 30-byte serial protocol.

Hardware

  • Board: Wemos D1 Mini (ESP8266)
  • Wiring: SR501 serial TX → D5 (GPIO14). The SR501 can be powered directly from the Wemos 5V pin. Although the Wemos is a 3.3V device, the SR501’s serial output in practice it works reliably without a level shifter (some voltage is also lost on cabling).
  • Baud: 4800 8N1, inverted signal

Installation on Home Assistant

Option A — Import via ESPHome Dashboard

  1. Open Settings → Add-ons → ESPHome in Home Assistant
  2. Click + NEW DEVICE → Continue → skip this step
  3. Paste the contents of termo-solar.yaml into the editor
  4. Click Install and follow the WiFi provisioning flow

Option B — Manual USB flash

  1. Install ESPHome CLI or use uvx --python 3.13 esphome
  2. Connect the Wemos D1 Mini via USB
  3. Run:
    esphome run termo-solar.yaml
    
  4. After first flash, the device creates a WiFi AP named termo-solar-XXXXXX (password: 12345678)
  5. Connect to it and configure your home WiFi via the captive portal

Sensors

Sensor Unit Description
Water Heater Temperature °C Tank temperature (0–100°C, ~9% safety margin)
Water Heater Level % Water level (0–100%, with low-end and L4 corrections)

Files

termo-solar.yaml                        ← main ESPHome config
components/sr501_water_heater/
  ├── __init__.py                        ← component registration
  ├── sensor.py                          ← sensor platform
  └── sr501.h                            ← C++ protocol decoder

Protocol

The SR501 sends 30-byte binary packets at 4800 baud:

  • Header: 0x00 0x01 (bytes 0–1)
  • Temperature ADC: bytes 5 (low) + 6 (high) → 12-bit value
  • Water level: bytes 27 (low) + 28 (high) → raw/450×100 = %

License

MIT