---
title: "Building a Cloud-Free Solar Energy Controller with ESP32-S3 and W5500"
url: "https://maker.wiznet.io/sophia/projects/building-a-cloud-free-solar-energy-controller-with-esp32-s3-and-w5500/"
markdown_url: "https://maker.wiznet.io/sophia/projects/building-a-cloud-free-solar-energy-controller-with-esp32-s3-and-w5500/md"
type: "UCC: User Created Content"
author: "ReinhardJesolowitz24"
author_url: "https://github.com/ReinhardJesolowitz24/zendure-regler-broker?utm_source=chatgpt.com"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "ReinhardJesolowitz24"
original_url: "https://github.com/ReinhardJesolowitz24/zendure-regler-broker?utm_source=chatgpt.com"
published: "2026-11-09"
updated: "2026-11-10"
language: "en"
hardware: ["WIZnet W5500", "Espressif ESP32"]
likes: 0
views: 144
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Building a Cloud-Free Solar Energy Controller with ESP32-S3 and W5500

> Zendure SolarFlow 2400 Pro — lokale Regelung (ESP32-S3 + W5500) (미국, 태양광 하이브리드 에너지, 제어시스템)

Original author: ReinhardJesolowitz24 (source: https://github.com/ReinhardJesolowitz24/zendure-regler-broker?utm_source=chatgpt.com)

## Components

- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))
- **Espressif ESP32** x 1 ([docs](https://www.espressif.com/en/products/socs/esp32))

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Article

### ![](https://maker.wiznet.io/upload/ckeditor5/25e2155bf3894223ae157041d445e5ce.jpg)

## Building a Cloud-Free Solar Energy Controller with ESP32-S3 and W5500

### Overview

How can a home solar energy system automatically manage battery charging and discharging without relying on cloud services?

This open-source project demonstrates a local energy control system for the Zendure SolarFlow 2400 Pro using two Waveshare ESP32-S3-ETH boards equipped with WIZnet W5500 Ethernet controllers.

The system measures household grid power and adjusts battery charging or discharging to minimize unwanted electricity export.

It combines wired Ethernet control devices, Wi-Fi-connected energy equipment, and MQTT messaging within the same local network.

This makes it an interesting example of hybrid networking for energy management applications.

### Why Was This Project Developed?

Solar panels generate electricity according to sunlight, while household electricity consumption changes throughout the day.

During sunny hours, generation may exceed household demand. In the evening, electricity consumption may increase when solar generation is low.

A battery storage system can help balance these differences.

However, effective charging and discharging require continuous power measurements and control decisions.

The developer created this project to adjust the Zendure battery automatically according to household grid power.

The main objective is to reduce unwanted electricity export, often referred to as zero feed-in control.

Another important goal is to keep the control system operating locally without relying on an external cloud service.

### How Does the System Work?

The system connects four main components.

#### 1. Shelly Pro 3EM – Measuring Power

The Shelly Pro 3EM measures electricity flowing between the household and the power grid.

Its measurements indicate whether the home is importing electricity or exporting surplus power.

#### 2. ESP32-S3 + W5500 Controller – Calculating Power Adjustments

The first Waveshare ESP32-S3-ETH board acts as the main controller.

It reads the power measurements and calculates how much the battery should charge or discharge.

The ESP32-S3 executes the control algorithm, while the W5500 provides wired Ethernet connectivity.

#### 3. ESP32-S3 + W5500 MQTT Broker – Delivering and Checking Commands

The second Waveshare ESP32-S3-ETH board runs a local MQTT broker.

MQTT is a lightweight messaging protocol used to exchange data between connected devices.

The broker receives control requests, checks permitted values, and forwards appropriate commands to the Zendure battery system.

It also receives battery telemetry and makes it available to the controller.

#### 4. Zendure SolarFlow 2400 Pro – Charging and Discharging

The battery system responds to control commands by adjusting its operation.

The controller continues monitoring grid power and uses battery feedback to calculate subsequent adjustments.

#### Communication Flow

**Shelly Pro 3EM → ESP32-S3 Controller → MQTT Broker → Zendure SolarFlow 2400 Pro**

Battery telemetry follows the reverse path through the MQTT broker to the controller.

All participating devices communicate within the same local network.

### A Practical Example

Consider a home with solar panels and battery storage.

#### During the Day

When solar generation exceeds household electricity consumption, the controller can request battery charging to use available surplus energy.

#### In the Evening

When solar generation decreases and household demand increases, the controller can request battery discharging.

The objective is to keep power exchange with the grid close to the configured target while respecting the battery's limits.

Actual charging and discharging depend on the battery state of charge, available power, and configured control settings.

### Hardware and Software Configuration

| Component | Specification | Function |
| --- | --- | --- |
| Controller board | Waveshare ESP32-S3-ETH | Energy control calculations |
| MQTT broker board | Waveshare ESP32-S3-ETH | MQTT messaging and command validation |
| Ethernet controller | WIZnet W5500, 2 units | SPI Ethernet MAC/PHY in MACRAW mode |
| Energy meter | Shelly Pro 3EM | Household grid power measurement |
| Battery system | Zendure SolarFlow 2400 Pro | Battery charging and discharging |
| Network technologies | Ethernet, Wi-Fi, MQTT | Local device communication |

Each Waveshare board includes an ESP32-S3R8 microcontroller, an onboard W5500, and a 10/100 Mbps RJ45 Ethernet port.

The original project documents the following W5500 SPI connections:

SCK: GPIO13

MISO: GPIO12

MOSI: GPIO11

CS: GPIO14

IRQ: GPIO10

RST: GPIO9

The software uses:

`ETH.h` from the ESP32 Arduino core for Ethernet connectivity

ESP-IDF Ethernet driver integration for W5500

lwIP for software TCP/IP networking

PubSubClient for MQTT client communication

PicoMQTT for the local MQTT broker

ArduinoJson for JSON processing

The developer reports approximately 1.5 W combined operating power consumption for the two ESP32-S3 Ethernet boards.

### How W5500 Is Used: ETH.h, MACRAW, and lwIP

Although the W5500 includes a hardware TCP/IP engine, this project does not use that engine to offload TCP/IP processing.

The developer uses the ESP32 Arduino core's `ETH.h` interface rather than the WIZnet Ethernet library.

In this configuration, the W5500 operates through the ESP-IDF Ethernet driver in **MACRAW mode**.

Ethernet frames are transferred between the W5500 and ESP32-S3 over SPI.

The **lwIP software TCP/IP stack runs on the ESP32-S3**, handling the TCP/IP communication required by the MQTT applications.

The data path can be summarized as:

**MQTT Application → ESP32-S3 lwIP → ESP-IDF Ethernet Driver → SPI → W5500 MACRAW → Ethernet Network**

The responsibilities are therefore divided as follows:

**ESP32-S3:** Runs the energy control application, MQTT software, and lwIP.

**W5500:** Provides the wired Ethernet MAC/PHY interface and frame communication.

**MQTT software:** Exchanges control commands and telemetry.

**Zendure:** Performs charging and discharging according to permitted commands.

This is an important distinction: **the W5500 is used for Ethernet connectivity, not hardware TCP/IP offloading in this implementation**.

### Why Are Two W5500-Based Boards Used?

The developer separates the control logic and MQTT broker into two independent devices.

The first board calculates the required charging or discharging power.

The second board validates requests before forwarding commands to the battery system.

This separation provides an additional opportunity to detect and respond to incorrect commands.

For example, the broker can reject values outside the configured operating limits.

It can also respond when expected control messages stop arriving.

These safeguards are implemented in the ESP32-S3 application software. They are not functions of the W5500 Ethernet hardware.

Both boards use W5500 for wired network communication.

The developer reports installing the two devices in a ventilated electrical enclosure for continuous local operation.

### Why This Is a Hybrid Network Project

The system combines two network connection technologies.

**Wired Ethernet**

ESP32-S3 energy controller with W5500

ESP32-S3 MQTT broker with W5500

**Wi-Fi**

Shelly Pro 3EM energy meter

Zendure SolarFlow 2400 Pro battery system

The existing energy devices communicate wirelessly, while the two control devices use Ethernet.

This means the developer can add wired control and messaging functions without replacing the existing Wi-Fi-connected equipment.

It is a practical example of hybrid networking, where different connection technologies coexist in one IoT system.

The main value is the system architecture, rather than hardware TCP/IP offloading.

### Local Control and Safety Features

The developer reports that the system has been tested in operation with bidirectional battery control.

The software includes several features intended to support controlled operation.

#### Automatic Power Control

A PI controller calculates charging and discharging adjustments based on grid power measurements.

#### Battery State-of-Charge Limits

Configurable limits prevent the controller from requesting charging or discharging beyond defined battery thresholds.

#### Communication Monitoring

Watchdog mechanisms and stale-data checks help detect missing or outdated information.

#### Independent Command Validation

The MQTT broker checks requested values against configured limits before forwarding permitted commands.

#### Local Diagnostics

Both ESP32-S3 devices provide read-only JSON status information through `GET /status`.

However, the project still has limitations.

External alarm functionality remains under development, and safe-state behavior should be verified before unattended operation.

The MQTT broker uses anonymous access for compatibility with the Zendure setup, making appropriate local network isolation important.

These are application-level design and security considerations, not W5500 hardware features.

### What Makes This Project Useful?

#### 1. More Effective Solar Energy Utilization

The system automatically adjusts battery operation according to changing household electricity demand.

This can help increase the use of locally generated electricity and reduce unwanted grid export.

#### 2. Local Operation

Control decisions are made within the local network, reducing dependence on an external cloud service for routine operation.

#### 3. Integration with Existing Wi-Fi Equipment

W5500-based Ethernet controllers can be added without replacing existing wireless energy devices.

#### 4. Separation of Control and Messaging

The dedicated controller and broker allow calculations and command validation to run on separate devices.

#### 5. Low-Power Embedded Operation

The developer reports approximately 1.5 W combined operating power for the two Ethernet boards, illustrating a low-power approach to continuous local control.

Actual energy savings, long-term reliability, and safety performance depend on the installation and have not been independently established.

### Potential Applications

The general design approach could be explored in other fields.

#### Residential Energy Management

Controlling energy storage according to household electricity consumption.

#### Building Energy Monitoring

Collecting power measurements and connecting energy devices to local controllers.

#### Industrial IoT

Exchanging operating data between distributed equipment and embedded controllers.

#### Hybrid Network Integration

Adding Ethernet-connected control or MQTT messaging devices to existing Wi-Fi systems.

These are potential applications, not verified commercial deployments of the original project.

### Why This Project Is Interesting for WIZnet

This project demonstrates how two W5500-based Ethernet devices can be used in a local energy management system alongside existing Wi-Fi equipment.

The W5500 provides the wired network connection, while the ESP32-S3 executes the software TCP/IP stack and application logic.

Even without using the W5500's hardware TCP/IP offload engine, the project provides a practical example of embedded Ethernet integration.

The most interesting aspect is the combination of wired and wireless devices.

Instead of replacing existing Wi-Fi equipment, the developer added dedicated Ethernet-connected controllers for local energy management.

For WIZnet, this highlights potential applications in energy monitoring, building automation, and hybrid IoT systems.

**The key takeaway is that W5500-based Ethernet devices can complement existing wireless equipment, creating new opportunities for embedded connectivity in energy management applications.**

### Project Resources

Original project: <https://github.com/ReinhardJesolowitz24/zendure-regler-broker>

Controller source: <https://github.com/ReinhardJesolowitz24/zendure-regler-broker/tree/main/regler>

MQTT broker source: <https://github.com/ReinhardJesolowitz24/zendure-regler-broker/tree/main/mqtt_broker>

Espressif W5500 driver: <https://components.espressif.com/components/espressif/w5500>

W5500 product documentation: <https://docs.wiznet.io/Product/iEthernet/W5500/overview>

**Original creator:** ReinhardJesolowitz24 (GitHub)
**Project type:** Open-source energy management project

---

Source: https://maker.wiznet.io/sophia/projects/building-a-cloud-free-solar-energy-controller-with-esp32-s3-and-w5500/
