Local Home Assistant integration for Deye three-phase hybrid inverters (SUN-*K-SG04LP3 / SG05LP3 family, including the SUN-12K-SG05LP3). It talks Modbus TCP directly to the inverter's WiFi/LAN logger or an RS485-to-TCP gateway — no cloud, no SolarMAN account required.
This is a custom repository. It is not (yet) in the default catalog, so you add it by link — see Installation.
- 100% local polling over Modbus TCP — nothing leaves your network.
- Talks directly to the Deye WiFi/LAN logger (default port 8899) or to an RS485↔TCP gateway (Elfin EW11, USR, etc. — usually port 502).
- Guided config flow: pick your inverter model from a dropdown, then enter host, port, Modbus unit ID and scan interval. No YAML editing needed.
- Rich set of sensors: PV strings, battery, grid import/export, per-phase grid/inverter/load, temperatures, plus daily and lifetime energy counters (ready for the HA Energy dashboard).
- Writable controls as native HA entities: work mode, solar sell, grid/generator charge, battery current & SOC limits, max sell power, and full 6-slot time-of-use programming.
- Driven by a human-readable YAML register map — adding a model is just a new map file, no code changes.
- Options flow to tune scan interval, transport, address offset and serial parameters at any time.
- Low-level services for advanced/manual register access.
pymodbusis pulled in automatically by Home Assistant via the manifest.
Home Assistant 2026.11 replaced HACS with the built-in Marketplace; HACS can no longer be installed there.
- Go to Settings ▸ Marketplace (administrators only; accept the warning on the first visit).
- Select Add from link in the upper-right corner. Adding a custom repository needs a connected GitHub account — the Marketplace asks for it if it is missing.
- Under GitHub link enter
https://github.com/Developer089/deye-modbus-haand select Add. If it asks for a Type, choose Integration. - Open the repository page and select Install.
- Restart Home Assistant.
- Go to Settings ▸ Devices & Services ▸ Add Integration and search for Deye Modbus.
If you installed this integration with HACS before upgrading, it is migrated automatically and keeps receiving updates under Settings ▸ Updates.
- In Home Assistant go to HACS.
- Open the top-right menu ⋮ → Custom repositories.
- Add the repository URL
https://github.com/Developer089/deye-modbus-haand choose category Integration. - Find Deye Modbus (Hybrid Inverter) in the list and click Download / Install.
- Restart Home Assistant.
- Go to Settings ▸ Devices & Services ▸ Add Integration and search for Deye Modbus.
- Copy the folder
custom_components/deye_modbusfrom this repository into your Home Assistant/config/custom_components/directory, so you end up with/config/custom_components/deye_modbus/. - Restart Home Assistant.
- Add the integration via Settings ▸ Devices & Services ▸ Add Integration → "Deye Modbus".
When you add the integration you get a single setup form:
| Field | Default | Notes |
|---|---|---|
| Inverter model | SUN-12K-SG05LP3 | Dropdown; selects the bundled register map. |
| Host / IP | — | IP address of the inverter's logger or your RS485↔TCP gateway, e.g. 192.168.x.x. |
| Port | 8899 |
See the port guidance below. |
| Modbus unit ID | 1 |
The Modbus slave/device address. Leave at 1 unless you changed it on a gateway. |
| Scan interval (s) | 15 |
How often to poll, range 5–300 seconds. |
8899— the Deye/SolarMAN WiFi or LAN stick logger exposes Modbus TCP on this port. This is the right choice for most people plugging into the inverter's own logger.502— a third-party RS485-to-TCP gateway (Elfin EW11, USR, etc.) wired to the inverter's Modbus/BMS RS485 port. These typically speak standard Modbus TCP on 502.
If you are unsure, try 8899 first; if no data appears, try 502.
Look in your router's DHCP client list for the logger (often named Solarman* / IGEN* / the stick's serial), or use the SolarMAN app / a network scanner. Assigning it a static DHCP lease is recommended so the address never changes.
All of these share the three-phase low-voltage hybrid protocol (device type 0x0500) and the same register map:
| Model key | Label |
|---|---|
sun12k_sg05lp3 |
Deye SUN-12K-SG05LP3 (3-phase hybrid) — default |
sun_sg05lp3_3ph |
Deye SUN-5/6/8/10/12K-SG05LP3 (3-phase hybrid) |
sun_sg04lp3_3ph |
Deye SUN-5/6/8/10/12K-SG04LP3 (3-phase hybrid) |
Rebadged units on the same platform (Sunsynk, etc.) will generally work too.
| Area | Entities |
|---|---|
| Status | Run State |
| PV | PV1/PV2 voltage, current, power (PV3/PV4 available, disabled by default) |
| Battery | SOC, voltage, current, power, temperature (corrected capacity disabled by default) |
| Grid / CT | Grid voltage L1–L3, frequency, per-phase power, total grid power (import +, export −) |
| Inverter | Inverter total power (per-phase voltages, frequency disabled by default) |
| Load | Total load power (per-phase load power/voltage disabled by default) |
| Backup / Generator | Backup power, generator voltage/power (disabled by default) |
| Temperatures | AC (radiator) temperature, DC temperature |
| Energy — today | PV production, battery charge/discharge, grid import/export, load consumption |
| Energy — total | PV production, battery charge/discharge, grid import/export, load consumption (32-bit lifetime counters) |
| Type | Entities |
|---|---|
| Switch | Inverter On/Off, Solar Sell (Export), Grid Charge Enable, Generator Charge Enable, Grid Charge Signal, Generator Charge Signal, Generator Force, Grid / Generator Peak Shaving, Micro Inverter Export Cutoff, On Grid Always On |
| Select | Work Mode (Selling First / Zero Export To Load / Zero Export To CT), Energy Pattern (Battery First / Load First), Generator Port Mode (Generator / Smart Load / Micro Inv Input) |
| Number | Max Sell Power (register 143), Max Solar Power (register 340), Active Power Regulation, Battery Max Charge/Discharge Current, Grid Charge Current, Battery Shutdown/Restart/Low SOC, Battery Capacity, Grid Voltage High/Low limits |
| Number (battery) | Equalization / Absorption / Float / Empty / Shutdown / Restart / Low voltage, Equalization cycle and time, Temperature compensation, Resistance, Charge efficiency |
| Number (charging) | Grid Charge Start Voltage / SOC, Generator Charge Start Voltage / SOC, Generator Charge Current, Generator Max Run Time / Cooling Time / Min Solar Power |
| Number (other) | Zero Export Power, Smart Load On / Off Voltage and SOC, Grid / Generator Peak Shaving Power, Grid Reconnect Time, Grid Frequency High/Low limits, AC Couple Frequency High |
| Time-of-use | Master switch + weekday switches, and 6 slots × Time / Power / Voltage / SOC / Charge Source (Off / Grid / Generator / Grid+Generator) |
The entities mirror the Time of Use table on the inverter screen:
- Time Of Use switches the whole schedule on or off; TOU Day 1 Monday … TOU Day 7 Sunday select the days it runs (all eight live in register 146).
- TOU N Time is when slot N starts. A slot lasts until the next slot's time; slot 6 wraps around to slot 1. Times are rounded down to 5 minutes, like on the inverter.
- TOU N Power is the battery power limit (W) during the slot.
- TOU N Voltage / TOU N SOC is the level the battery is held at in the slot: it is discharged down to it, and charged up to it when a charge source is allowed. The inverter uses only one of the two — the read-only Battery Control Mode sensor tells you which (
Voltage→ TOU N Voltage,Capacity (SOC)→ TOU N SOC). Batteries without BMS communication normally run in voltage mode. - TOU N Charge Source allows charging from the grid and/or generator in the slot.
There are no separate charge / discharge power registers on these inverters: charging is capped by Battery Max Charge Current and Grid Charge Current, discharging by TOU N Power and Battery Max Discharge Current.
Disabled-by-default entities. To keep the device tidy, some entities ship disabled: PV3/PV4, per-phase inverter/load detail, generator/backup, grid protection limits and a few rarely changed battery parameters. Enable any of them under the device's Entities list → open the entity → Settings → toggle Enabled.
Open the integration and click Configure to change (no restart needed — the entry reloads):
- Scan interval — 5–300 s.
- Transport —
tcp(standard Modbus TCP) orrtutcp(RTU frame over a raw TCP socket, for some gateways). - Address offset — added to every register address, for gateways that shift the map.
- Serial parameters — baud rate, byte size, parity (N/E/O), stop bits (only relevant for
rtutcp). - Write mode — Modbus function code used when a control entity (number / select / switch) writes a single register:
fc16(default) — "Write Multiple Registers" with one value. This is what Deye's protocol document specifies, and many Deye inverters/loggers silently ignore FC06, which shows up asNo response received after 3 retriesand a value that never changes.fc06— "Write Single Register" (behaviour of v0.1.1 and earlier). Only use this if your gateway does not support FC16.
For advanced/manual register access. Addresses are decimal and given before any configured address offset.
| Service | Purpose | Key fields |
|---|---|---|
deye_modbus.write_register |
Write one holding register (uses the Write mode option, FC16 by default). | address, value (0–65535) |
deye_modbus.write_registers |
Write a list of 16-bit values starting at an address (FC16). | address, values (list) |
deye_modbus.write_u32 |
Write a 32-bit value across two registers (FC16). | address, value (0–4294967295), word_order (high_low default / low_high) |
Example:
service: deye_modbus.write_register
data:
address: 145 # Solar Sell enable
value: 1- Everything is read with function code
0x03(FC03, read holding registers) — on this inverter both the live measurements and the writable settings live in the holding-register space. Writes use FC16 ("write multiple registers") — Deye ignores FC06. - 32-bit energy counters are stored low-word-first (
word_order: low_high, little-endian by word). The integration reassembles them automatically. - Temperatures use a raw offset of 1000 and scale 0.1, i.e.
°C = (raw − 1000) × 0.1. - Signed values (battery/grid/load power and current) are decoded as two's-complement. Grid total power is positive when importing, negative when exporting.
- The register map is a plain YAML file (
custom_components/deye_modbus/maps/sun_3ph_hybrid.yaml) derived from Deye's official three-phase energy-storage Modbus protocol document.
- No data / entities unavailable. Double-check the port (
8899for the Deye logger vs502for an RS485↔TCP gateway) and the Modbus unit ID (usually1). Confirm the IP is reachable from the HA host (ping), and that the logger firmware is recent. - Only one Modbus master at a time. The inverter/logger accepts a single Modbus connection. This integration will conflict with the SolarMAN cloud logging and with any other Modbus poller (a second HA integration, Node-RED, etc.). If the SolarMAN app / cloud is actively connected you may see dropouts — expect to give up cloud logging, or poll via a separate RS485 gateway.
- Setting a control has no effect / write timeouts. Make sure Write mode in Options is
fc16. Failed writes are logged bycustom_components.deye_modbus.coordinatorand shown as an error in the UI. - Intermittent timeouts. Increase the scan interval, reduce competing connections, or improve WiFi signal to the logger. For flaky gateways try the
rtutcptransport in Options. - Wrong or shifted values. If a gateway shifts the address map, set an address offset in Options.
The control and service entities write settings to your inverter. Changing work mode, sell/charge behaviour, SOC and current limits, grid protection windows or time-of-use programming can affect how your inverter operates, including battery health and grid interaction. Use these features at your own risk; the authors accept no liability for any damage or loss. If in doubt, leave the write entities disabled and use the integration for monitoring only. This project is not affiliated with or endorsed by Deye.
This integration is free and open source. If it saves you time, you can buy me a coffee — entirely optional.
- Architecture modeled on a Growatt Modbus Home Assistant integration (coordinator + YAML-driven register map pattern).
- Register map derived from Deye's official Modbus protocol documentation for the three-phase energy-storage (hybrid) inverters.
- Built on
pymodbus.
Deye Modbus pro Home Assistant je lokální integrace pro třífázové hybridní měniče Deye (řada SUN-*K-SG04LP3 / SG05LP3, včetně SUN-12K-SG05LP3). Komunikuje přímo přes Modbus TCP s WiFi/LAN loggerem měniče (výchozí port 8899) nebo s převodníkem RS485↔TCP (obvykle port 502). Nepotřebuje cloud ani účet SolarMAN — vše probíhá ve vaší síti.
Od verze 2026.11 nahradil HACS vestavěný Marketplace; HACS už nainstalovat nejde.
- Otevřete Nastavení ▸ Marketplace (jen pro administrátory; při první návštěvě potvrďte upozornění).
- Vpravo nahoře zvolte Add from link. Je k tomu potřeba propojený účet GitHub — Marketplace si o něj řekne.
- Do pole GitHub link zadejte
https://github.com/Developer089/deye-modbus-haa potvrďte Add. Pokud se zeptá na Type, zvolte Integration. - Otevřete stránku repozitáře a zvolte Install.
- Restartujte Home Assistant a přidejte integraci Deye Modbus v Nastavení ▸ Zařízení a služby.
Integrace nainstalovaná dříve přes HACS se po aktualizaci převede sama a dál dostává aktualizace v Nastavení ▸ Aktualizace.
- V HACS otevřete menu ⋮ → Custom repositories (Vlastní repozitáře).
- Přidejte adresu
https://github.com/Developer089/deye-modbus-haa jako kategorii zvolte Integration. - Najděte Deye Modbus (Hybrid Inverter) a nainstalujte.
- Restartujte Home Assistant.
- Přejděte do Nastavení ▸ Zařízení a služby ▸ Přidat integraci a vyhledejte Deye Modbus.
Ruční instalace: zkopírujte složku custom_components/deye_modbus do /config/custom_components/ a Home Assistant restartujte.
Ve formuláři při přidání integrace zadáte:
- Model měniče — výběr z rozbalovacího seznamu (určuje mapu registrů).
- Host / IP — adresa loggeru nebo převodníku, např.
192.168.x.x. - Port —
8899pro WiFi/LAN logger Deye,502pro převodník RS485↔TCP. Pokud si nejste jistí, zkuste nejdřív8899. - Modbus unit ID — obvykle
1. - Interval dotazování —
15s (rozsah 5–300 s).
IP adresu měniče najdete v seznamu klientů DHCP na routeru; doporučuje se nastavit statickou (rezervovanou) adresu.
Integrace zpřístupní senzory (FV panely, baterie, síť import/export, zátěž, teploty, denní i celková energie) a ovládací prvky (režim práce, prodej do sítě, nabíjení ze sítě/generátoru, Energy Pattern, limity proudu a SOC baterie, napětí baterie, start nabíjení ze sítě a z generátoru, Smart Load, peak shaving, maximální prodejní výkon, programování podle času – TOU). Některé entity jsou ve výchozím stavu vypnuté (PV3/PV4, detaily po fázích) — zapnete je v nastavení dané entity.
TOU (Time of Use): přepínač Time Of Use zapíná celý plán, TOU Day 1 Monday … TOU Day 7 Sunday vybírají dny. Každý ze 6 slotů má začátek (TOU N Time), limit výkonu baterie (TOU N Power), cílovou úroveň baterie (TOU N Voltage nebo TOU N SOC) a povolený zdroj nabíjení (TOU N Charge Source). Měnič používá jen jednu z cílových hodnot — kterou, ukazuje senzor Battery Control Mode (Voltage → TOU N Voltage, Capacity (SOC) → TOU N SOC). Baterie bez komunikace s BMS běží obvykle v napěťovém režimu.
Zápisové entity a služby mění nastavení měniče a mohou ovlivnit jeho chování i baterii. Používejte na vlastní riziko. Pozor: měnič/logger přijímá jen jedno Modbus spojení — integrace se proto vylučuje se SolarMAN cloudem i s jiným Modbus dotazovačem.
Integrace je zdarma a s otevřeným kódem. Pokud vám ušetřila čas, můžete mi koupit kávu — je to zcela dobrovolné.