Skip to content

HIT SunSpec Proxy: ESP32-S3 + W5500 Gateway for Hoymiles Energy Systems

ESP32-S3 and W5500 turn Hoymiles HIT data into SunSpec, Modbus TCP, Home Assistant and KNX services for a multi-protocol HEMS gateway.

irina

Published November 23, 2026

Original author: atomi23Original source (new tab)

HIT SunSpec Proxy: ESP32-S3 + W5500 Gateway for Hoymiles Energy Systems

Components

Hardware components

WIZnet parts

Project description

프로젝트 개요

HIT SunSpec Proxy는 Hoymiles HIT 에너지 시스템의 데이터를 하나의 ESP32 기반 gateway에서 수집하고, 이를 SunSpec, Modbus TCP, Home Assistant, KNX, Tasmota 등 여러 상위 시스템으로 전달하는 오픈소스 프로젝트입니다.

기본 target board는 LILYGO T-Connect-Pro이며, 이 보드는 ESP32-S3 + WIZnet W5500 Ethernet + Display + Touch + RS485를 하나의 platform에 통합합니다.

프로젝트의 핵심 목적은 Hoymiles HIT에 여러 client가 각각 직접 연결하는 대신, gateway가 HIT와 하나의 지속적인 connection을 유지하고 데이터를 여러 서비스로 재배포하는 것입니다.

HIT SunSpec Proxy: ESP32-S3 + W5500 Gateway for Hoymiles Energy Systems, 프로젝트 개요
Hoymiles HIT
    │
    │ Modbus TCP
    │ or RS485 / Modbus RTU
    ▼
ESP32-S3 + W5500
LILYGO T-Connect-Pro
    │
    ├── SunSpec / Modbus TCP :1502
    ├── Modbus Gateway :502
    ├── Home Assistant / MQTT
    ├── KNX
    ├── Tasmota
    ├── HTTPS Web UI
    └── OTA
    │
    ▼
HEMS / Home Assistant / KNX / Other Clients

1. System Architecture

HIT SunSpec Proxy는 단순한 protocol converter가 아니라 여러 energy-management interface를 하나의 ESP32 gateway에서 제공하는 구조입니다.

Hoymiles HIT와의 연결은 두 가지 방식을 지원합니다.

  • Modbus TCP
  • RS485 / Modbus RTU

Gateway는 HIT와 하나의 connection을 유지하고, 수집된 정보를 내부 data model에 저장합니다.

이후 동일한 데이터를 여러 output interface가 공유합니다.

                Hoymiles HIT
                     │
              TCP or RS485
                     │
                     ▼
                HIT Client
                     │
                     ▼
                Data Broker
        ┌────────────┼────────────┐
        │            │            │
        ▼            ▼            ▼
     SunSpec       MQTT / HA      KNX
       TCP
        │
        └──── Modbus Gateway

이렇게 하면 Home Assistant, Consolinno HEMS, KNX 또는 일반 Modbus client가 각각 HIT에 직접 connection을 생성할 필요가 없습니다.

2. Default Hardware: LILYGO T-Connect-Pro

기본 PlatformIO build environment는 t-connect-pro입니다.

주요 구성은 다음과 같습니다.

ComponentRole
ESP32-S3Main application processor
WIZnet W5500Wired Ethernet interface
ST7796 DisplayLocal status / energy-flow display
CST226SE TouchLocal UI input
RS485Hoymiles HIT Modbus RTU
RS232Additional serial interface
CANExpansion interface
SX1262LoRa interface

T-Connect-Pro에는 PoE가 내장되어 있지 않습니다.

전원은 12–24 V DC 또는 USB를 사용하며 Ethernet은 data connection으로 사용됩니다.

W5500 Pin Mapping

W5500 SignalESP32-S3 GPIO
MOSIGPIO11
MISOGPIO13
SCLKGPIO12
CSGPIO10
INTGPIO9
RESETGPIO48

Display, Ethernet, LoRa는 GPIO11/12/13의 SPI bus를 공유하고 각각 별도의 Chip Select를 사용합니다.

3. W5500 Ethernet Integration

W5500은 문서상 존재하는 option에 그치지 않고 실제 source code에서 초기화됩니다.

NetBoot.cpp에서는 T-Connect-Pro build일 때 W5500을 명시적으로 선택합니다.

SPI.begin(12, 13, 11);

ETH.begin(
    ETH_PHY_W5500,
    1,
    10,
    9,
    48,
    SPI
);

즉 hardware path는 다음과 같습니다.

ESP32-S3
    │
    │ SPI
    ▼
 W5500
    │
    ▼
Ethernet LAN

Firmware는 ETH.linkUp()과 ETH.localIP()를 이용해 Ethernet 상태와 할당된 IP address도 확인합니다.

Ethernet을 활성화한 T-Connect-Pro 구성에서는 W5500이 이러한 IP 기반 서비스의 유선 네트워크 경로를 제공합니다.

  • SunSpec server
  • Modbus TCP gateway
  • Web UI
  • Home Assistant / MQTT
  • KNX IP
  • Tasmota interface
  • OTA update

이 프로젝트에서 W5500의 역할은 ESP32-S3 application과 유선 LAN 사이의 Ethernet interface입니다.

4. SunSpec Server for HEMS

프로젝트의 핵심 기능 중 하나는 SunSpec-compatible Modbus TCP server입니다.

4. SunSpec Server for HEMS

SunSpec server는 기본적으로:

TCP Port 1502

에서 동작합니다.

WiFiServer server(1502);

Consolinno HEMS는 이 server에 연결해 HIT에서 수집된 inverter와 battery 정보를 표준화된 register map으로 읽을 수 있습니다.

Register Map

동일한 SunSpec image를 다음 base address에서 접근할 수 있도록 구성합니다.

  • 0
  • 40000
  • 50000

이를 통해 다양한 Modbus client의 address convention에 대응합니다.

현재 server code에서는 주요 Modbus function을 직접 처리합니다.

  • FC3 — Read Holding Registers
  • FC4 — Read Input Registers
  • FC6 — Write Single Register
  • FC16 — Write Multiple Registers

SunSpec map은 주기적으로 rebuild되어 최신 energy data를 반영합니다.

5. Power Control through SunSpec

HIT SunSpec Proxy는 monitoring만 수행하는 것은 아닙니다.

SunSpec Model 123의 일부 control register를 통해 power limit command도 처리할 수 있습니다.

대표적으로:

  • WMaxLimPct
  • WMaxLimPct_Ena

를 처리하고, 변경된 값을 HIT control logic으로 전달합니다.

HEMS
 │
 │ SunSpec FC6 / FC16
 ▼
ESP32 Gateway
 │
 │ Validate / Map
 ▼
HitControl
 │
 ▼
Hoymiles HIT

즉 HEMS가 SunSpec interface를 통해 power limit을 변경하면 gateway가 이를 실제 HIT control path로 연결할 수 있습니다.

6. Generic Modbus TCP Gateway

6. Generic Modbus TCP Gateway

SunSpec interface와 별도로 일반 Modbus TCP gateway도 제공합니다.

기본 port는:

  • TCP Port 502

입니다.

WiFiServer server(502);

이 gateway는 external Modbus client가 HIT의 register에 접근할 수 있도록 합니다.

지원되는 주요 function은:

  • FC3
  • FC4
  • FC5
  • FC6
  • FC15
  • FC16

입니다.

최대 4개의 client connection을 관리하며, 실제 request는 HitBus::transact()를 통해 HIT 쪽으로 전달합니다.

Modbus TCP Client
        │
        │ Port 502
        ▼
ESP32-S3 Gateway
        │
        │ TCP → RTU / TCP translation
        ▼
   Hoymiles HIT

따라서 SunSpec을 사용하지 않는 일반 automation system에서도 gateway를 사용할 수 있습니다.

7. Protection for Critical Registers

Energy system에서 remote write는 monitoring보다 더 신중하게 처리해야 합니다.

이 프로젝트에는 HIT의 중요한 network-protection register를 보호하는 logic이 포함되어 있습니다.

특히 FC6를 사용한 register 101–299 write를 차단합니다.

해당 영역에 대한 write request가 들어오면 HIT로 전달하지 않고 Modbus exception을 반환합니다.

또 일반 gateway write 역시 설정에서 명시적으로 허용해야 동작합니다.

Modbus Write
     │
     ▼
Is write enabled?
     │
     ├── No → Reject
     │
     ▼
Protected register?
     │
     ├── Yes → Reject
     │
     ▼
Send to HIT

이 구조는 단순 protocol forwarding이 아니라 gateway 자체에서 write policy를 적용한다는 점에서 의미가 있습니다.

 

8. Home Assistant, KNX and Other Outputs

HIT에서 수집된 데이터는 SunSpec만을 위한 것이 아닙니다.

사용자는 setup wizard에서 필요한 service만 선택할 수 있습니다.

지원되는 주요 기능은:

  • SunSpec
  • Generic Modbus Gateway
  • Home Assistant
  • KNX
  • Tasmota
  • Cloud
8. Home Assistant, KNX and Other Outputs

입니다.

선택되지 않은 service는 실행되지 않고 menu에서도 제거됩니다.

Home Assistant

MQTT를 이용해 inverter, battery, energy-flow data를 Home Assistant에 전달할 수 있습니다.

KNX

Energy information을 KNX 기반 building automation network에도 제공할 수 있습니다.

Tasmota

별도의 Tasmota energy/meter device와 연동해 grid 또는 meter 정보를 통합할 수도 있습니다.

즉 이 gateway는 하나의 data source를 여러 building/energy automation protocol로 분배하는 역할을 합니다.

 

9. Local Display and History

T-Connect-Pro에는 480×222 display와 touch interface가 포함됩니다.

Local display에서는 여러 page를 통해 주요 정보를 확인할 수 있습니다.

  • Live energy flow
  • PV string information
  • Grid information
  • System state

Gateway 내부 LittleFS에는 history도 저장합니다.

대표적으로:

최근 24시간

  • Daily history
  • Monthly history
  • Yearly history

를 관리할 수 있도록 구성되어 있습니다.

이 덕분에 network client가 없어도 local screen에서 현재 system 상태를 확인할 수 있습니다.

10. Ethernet and Wi-Fi Recovery

Firmware는 Ethernet과 Wi-Fi 상태를 모두 관리합니다.

기본적으로 network display 우선순위는 Ethernet입니다.

1. Ethernet
2. Home Wi-Fi
3. Device AP

Ethernet을 선택했지만 약 1분 동안 유효한 IP address를 얻지 못하면 device Wi-Fi AP를 emergency access path로 활성화할 수 있습니다.

Ethernet이 다시 정상화되면 emergency AP는 다시 비활성화됩니다.

이 기능은 Ethernet cable, DHCP 또는 network configuration 문제로 Web UI에 접근하기 어려운 상황에서 local recovery path를 제공합니다.

11. HTTPS, OTA and Configuration

PSRAM을 사용할 수 있는 board에서는 Web UI가 HTTPS port 443으로 동작합니다.

HTTP request는 setup 중인 경우를 제외하고 HTTPS로 redirect됩니다.

Device는 자체 certificate를 생성하고 IP address 또는 .local hostname에 맞춰 certificate를 관리합니다.

지원 기능에는 다음이 포함됩니다.

  • HTTPS Web UI
  • OTA firmware update
  • Factory reset
  • Configuration backup
  • Configuration restore
  • Restart reason logging

PSRAM이 충분하지 않은 일부 alternative board에서는 HTTPS 대신 HTTP Web UI가 사용됩니다.

12. Alternative Hardware Builds

이 프로젝트는 W5500 한 종류의 hardware만 지원하는 것은 아닙니다.

BuildMCUEthernet
T-Connect-ProESP32-S3W5500
T-POE-ProESP32LAN8720
WT32-ETH01ESP32LAN8720
ESP32-P4-WIFI6-POE-ETHESP32-P4IP101

중요한 점은 default build가 W5500 기반 T-Connect-Pro라는 것입니다.

[platformio]
default_envs = t-connect-pro

따라서 이 글에서는 W5500 기반 기본 configuration을 중심으로 설명하지만, firmware 자체는 다른 Ethernet hardware에도 port되어 있습니다.

Related WIZnet Maker Projects

Rewired-S 

Rewired-S는 Sungrow WiNet-S2의 기존 ESP32-S3 + W5500 hardware를 활용해 inverter 데이터를 local Web UI, MQTT/Home Assistant, Modbus TCP로 제공하는 replacement firmware입니다.

HIT SunSpec Proxy와 마찬가지로 energy device와 local network 사이의 gateway 역할을 하지만, Rewired-S는 Sungrow communication dongle 자체를 대체하는 firmware라는 점이 다릅니다.

Solar2MQTT

Solar2MQTT는 Waveshare ESP32-S3-ETH + W5500을 이용해 RS485/RS232 inverter data를 MQTT와 Home Assistant로 전달합니다. W5500 SPI pin mapping과 ETH.begin(ETH_PHY_W5500, ...) 구현이 명확히 포함되어 있습니다.

HIT SunSpec Proxy가 SunSpec/Modbus/KNX 등 여러 output protocol을 제공한다면, Solar2MQTT는 MQTT 중심 solar monitoring에 더 집중합니다.

OpenDTU-OnBattery

OpenDTU-OnBattery는 Hoymiles 계열 inverter와 battery energy system을 제어·모니터링하는 프로젝트로, W5500 Ethernet을 이용한 energy-management application이라는 점에서 유사합니다.


Project Comparison

FeatureHIT SunSpec ProxyRewired-SSolar2MQTTOpenDTU-OnBattery
Main MCUESP32-S3ESP32-S3ESP32-S3ESP32 family
WIZnetW5500W5500W5500W5500
Target SystemHoymiles HITSungrowSolar InverterHoymiles / Battery
SunSpecYes–––
Modbus TCP ServerYesYesDevice dependentYes
MQTT / Home AssistantYesYesYesYes
KNXYes–––
RS485YesYesYesYes
Local DisplayYesWeb dashboardWeb UIWeb UI
Write ControlYesYesMainly monitoringYes

Key Difference

HIT SunSpec Proxy의 가장 큰 차별점은 단순 monitoring gateway를 넘어 Hoymiles HIT 데이터를 표준 SunSpec interface로 재구성해 HEMS에서 사용할 수 있도록 한다는 점입니다.

또한 동일한 gateway에서:

HIT
 │
 ▼
One Data Source
 │
 ├── SunSpec
 ├── Modbus TCP
 ├── MQTT / Home Assistant
 ├── KNX
 └── Tasmota

형태로 여러 system에 동시에 데이터를 제공할 수 있습니다.

FAQ

Q. W5500은 이 프로젝트에서 어떤 역할을 하나요?

기본 T-Connect-Pro board에서 ESP32-S3와 SPI로 연결되어 wired Ethernet interface 역할을 합니다.

SunSpec, Modbus TCP, Web UI, MQTT, KNX 및 OTA와 같은 IP-based service가 이 Ethernet interface를 통해 동작할 수 있습니다.

Q. Hoymiles HIT는 어떻게 연결되나요?

HIT는 Modbus TCP 또는 RS485 기반 Modbus RTU를 통해 gateway와 연결할 수 있습니다.

Q. SunSpec과 일반 Modbus Gateway는 같은 서비스인가요?

아닙니다.

SunSpec-compatible server는 기본적으로 port 1502를 사용하고, generic Modbus gateway는 port 502를 사용합니다.

Q. Monitoring만 가능한가요?

아닙니다.

설정에 따라 Modbus write를 허용할 수 있으며, SunSpec power-limit 관련 control도 지원합니다.

다만 일부 protection register에 대한 write는 gateway에서 차단합니다.

Q. T-Connect-Pro는 PoE를 지원하나요?

아닙니다.

기본 T-Connect-Pro는 12–24 V DC 또는 USB power를 사용하며 Ethernet은 data 용도입니다.

PoE가 필요한 경우 별도로 지원되는 T-POE-Pro 같은 hardware build를 사용할 수 있지만 해당 board는 W5500이 아니라 다른 Ethernet PHY를 사용합니다.


Project Overview

HIT SunSpec Proxy is an open-source energy gateway that collects data from a Hoymiles HIT system and redistributes it to multiple upper-level systems including SunSpec, Modbus TCP, Home Assistant, KNX and Tasmota.

The default hardware target is the LILYGO T-Connect-Pro, combining an ESP32-S3, WIZnet W5500 Ethernet interface, display, touch controller and RS485 on a single platform.

Instead of allowing several applications to create separate connections to the HIT, the gateway maintains a single HIT connection and makes the collected information available through multiple services.

HIT SunSpec Proxy: ESP32-S3 + W5500 Gateway for Hoymiles Energy Systems, Project Overview
Hoymiles HIT
    │
    │ Modbus TCP
    │ or RS485 / Modbus RTU
    ▼
ESP32-S3 + W5500
LILYGO T-Connect-Pro
    │
    ├── SunSpec / Modbus TCP :1502
    ├── Modbus Gateway :502
    ├── Home Assistant / MQTT
    ├── KNX
    ├── Tasmota
    ├── HTTPS Web UI
    └── OTA
    │
    ▼
HEMS / Home Assistant / KNX / Other Clients

 

1. System Architecture

The gateway can communicate with the Hoymiles HIT through either Modbus TCP or RS485-based Modbus RTU.

A single HIT connection supplies data to an internal shared data layer.

That information can then be exposed through several network services.

                Hoymiles HIT
                     │
              TCP or RS485
                     │
                     ▼
                HIT Client
                     │
                     ▼
                Data Broker
        ┌────────────┼────────────┐
        │            │            │
        ▼            ▼            ▼
     SunSpec       MQTT / HA      KNX
       TCP
        │
        └──── Modbus Gateway

This architecture avoids requiring Home Assistant, the HEMS and other Modbus clients to maintain their own individual HIT connections.

 

2. Default Hardware

The default PlatformIO environment is t-connect-pro.

ComponentRole
ESP32-S3Main processor
WIZnet W5500Wired Ethernet interface
ST7796 DisplayLocal system display
CST226SE TouchLocal UI
RS485HIT Modbus RTU connection
RS232Additional serial interface
CANExpansion interface
SX1262LoRa interface

The T-Connect-Pro does not include PoE. It uses 12–24 V DC or USB power, while Ethernet is used for data.

W5500 SPI Mapping

W5500 SignalESP32-S3
MOSIGPIO11
MISOGPIO13
SCLKGPIO12
CSGPIO10
INTGPIO9
RESETGPIO48

The display, Ethernet controller and LoRa device share the SPI bus with separate chip-select signals.

3. W5500 Ethernet Integration

The W5500 is initialized directly in the project's network startup code.

SPI.begin(12, 13, 11);

ETH.begin(
    ETH_PHY_W5500,
    1,
    10,
    9,
    48,
    SPI
);

The resulting network path is:

ESP32-S3
    │ SPI
    ▼
 W5500
    │
    ▼
Ethernet LAN

The firmware also monitors Ethernet link state and assigned IP address.

When Ethernet is enabled and active, the W5500 provides the wired network path for these IP-based services.

  • SunSpec
  • Generic Modbus TCP
  • MQTT / Home Assistant
  • KNX IP
  • Web UI
  • OTA

4. SunSpec Server

The project provides a GEN24-compatible SunSpec server for HEMS integration.

4. SunSpec Server

The default TCP port is:

1502

WiFiServer server(1502);

The same register image can be accessed from base addresses:

  • 0
  • 40000
  • 50000

The current implementation processes:

  • FC3
  • FC4
  • FC6
  • FC16

This allows HEMS clients to both read energy data and, where permitted, write selected control values.

5. SunSpec Power Control

The gateway also implements selected SunSpec Model 123 power-control registers.

Examples include:

  • WMaxLimPct
  • WMaxLimPct_Ena

When a supported control value is written, the gateway updates its local map and forwards the required action to the HIT control layer.

HEMS
 │
 │ SunSpec
 ▼
Gateway
 │
 │ Validate / Map
 ▼
HitControl
 │
 ▼
Hoymiles HIT

This makes the project more than a read-only energy monitor.

6. Generic Modbus Gateway

6. Generic Modbus Gateway

A second Modbus TCP server provides direct gateway access on:

Port 502

WiFiServer server(502);

It supports standard read and write operations and can forward requests to the HIT through HitBus.

The implementation manages up to four client connections and includes explicit write-policy checks.

7. Register Protection

Remote control of energy equipment requires careful handling of write operations.

The project blocks FC6 writes to HIT registers 101–299, preventing those requests from reaching the target device.

Generic gateway writes can also be disabled completely in configuration.

Write Request
     │
     ▼
Write Enabled?
     │
     ▼
Protected Address?
     │
     ▼
Forward to HIT

This provides a useful safety boundary between external Modbus clients and the energy device.

8. Multiple Output Services

Users can enable individual services from the setup wizard.

8. Multiple Output Services

Available output paths include:

  • SunSpec
  • Generic Modbus Gateway
  • Home Assistant
  • KNX
  • Tasmota
  • Cloud services

Unused services do not need to run.

This allows the device to act as a common energy-data gateway rather than being tied to one particular automation platform.

9. Local Display and History

The T-Connect-Pro's 480×222 display provides local pages for:

  • Live energy flow
  • PV strings
  • Grid information
  • System status

The gateway also stores history in LittleFS for short- and long-term energy views.

This local interface remains useful even when an external dashboard is unavailable.

10. Network Recovery

Ethernet is given priority when available.

The project can also use a home Wi-Fi connection and a device access point.

If Ethernet is selected but cannot obtain a usable address for about one minute, the device can enable its own Wi-Fi AP as an emergency access path.

When Ethernet returns, the emergency AP can be disabled again.

11. HTTPS, OTA and Maintenance

On boards with sufficient PSRAM, the Web UI supports HTTPS on port 443.

The firmware also provides:

  • OTA updates
  • Factory reset
  • Configuration backup and restore
  • Restart-reason logging
  • Certificate handling

Boards with tighter memory limits can fall back to HTTP.

12. Alternative Ethernet Hardware

The project also supports several alternative boards.

BuildMCUEthernet
T-Connect-ProESP32-S3W5500
T-POE-ProESP32LAN8720
WT32-ETH01ESP32LAN8720
ESP32-P4-WIFI6-POE-ETHESP32-P4IP101

The important distinction is that the default build is the W5500-based T-Connect-Pro, while the software has also been ported to other Ethernet interfaces.

Related WIZnet Maker Projects

Rewired-S

Rewired-S uses the W5500-equipped WiNet-S2 to expose Sungrow inverter data through a local web interface, MQTT/Home Assistant and Modbus TCP.

Solar2MQTT

Solar2MQTT uses an ESP32-S3 and W5500 to collect inverter data through RS485/RS232 and forward it to MQTT, Home Assistant and a local Web UI.

OpenDTU-OnBattery

OpenDTU-OnBattery is another W5500-enabled energy-management project targeting solar inverter and battery systems.

Key Difference

HIT SunSpec Proxy stands out because it does not only expose inverter data through MQTT.

It converts the HIT data into a SunSpec-compatible HEMS interface while simultaneously supporting generic Modbus TCP, Home Assistant, KNX and other outputs.

Hoymiles HIT
      │
      ▼
Common Gateway Data
      │
      ├── SunSpec
      ├── Modbus TCP
      ├── MQTT / Home Assistant
      ├── KNX
      └── Tasmota

This makes it a multi-protocol energy gateway rather than a single-purpose monitor.

FAQ

What role does the W5500 play?

On the default T-Connect-Pro hardware, the W5500 provides the wired Ethernet interface between the ESP32-S3 application and the LAN.

How does the gateway communicate with the HIT?

The HIT connection can use Modbus TCP or RS485 / Modbus RTU.

Are SunSpec and the generic Modbus gateway the same service?

No. The SunSpec server normally uses port 1502, while the generic Modbus gateway uses port 502.

Can the system write values as well as read them?

Yes. Selected write operations and SunSpec power-limit control are supported, while sensitive register areas are protected.

Does the default T-Connect-Pro use PoE?

No. The default board uses 12–24 V DC or USB power. Alternative hardware builds provide different Ethernet and power options.

Comments

Similar projects you might like

Comments