https://github.com/mortylabs/epever-modbus-mqtt-dashboard
Monitor EpEver solar charge controllers via ESP8266, RS485, MQTT & Modbus. Web dashboard + Home Assistant ready.
https://github.com/mortylabs/epever-modbus-mqtt-dashboard
arduino d1-mini epever esp32 esp8266 home-assistant homeassistant iot modbus mqtt rs485 solar solar-energy
Last synced: 3 months ago
JSON representation
Monitor EpEver solar charge controllers via ESP8266, RS485, MQTT & Modbus. Web dashboard + Home Assistant ready.
- Host: GitHub
- URL: https://github.com/mortylabs/epever-modbus-mqtt-dashboard
- Owner: mortylabs
- License: apache-2.0
- Created: 2025-06-08T08:02:06.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-14T20:24:35.000Z (4 months ago)
- Last Synced: 2025-07-06T00:33:03.983Z (3 months ago)
- Topics: arduino, d1-mini, epever, esp32, esp8266, home-assistant, homeassistant, iot, modbus, mqtt, rs485, solar, solar-energy
- Language: C++
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π EpEver Solar Monitor
Monitor your EPEVER solar charge controller via ESP8266, MQTT, and Home Assistant β **fully local and all sunshine,** no vendor cloud required.**

> π [Buy the Charge Controller](https://amzn.eu/d/51auldm)
> π [Buy the DS485Max Controller](https://www.amazon.co.uk/dp/B07B667STP)Monitor your off-grid solar system in real-time with a WiFi-enabled, Arduino-powered NodeMCU ESP8266. This firmware speaks fluent **Modbus over RS485**, publishes readings via **MQTT**, and auto-discovers in **Home Assistant** - no cloud, no fuss, just data.
---
## β‘οΈ Highlights
β Polls Modbus registers from EPEVER MPPT via RS485 (MAX485)
β Sends clean JSON over MQTT
β Works out-of-the-box with Home Assistant MQTT Discovery
β OTA firmware updates
β Optional Deep Sleep for ultra-low power
---
## π§ How It Works
The ESP8266 queries your EPEVER solar charge controller via RS485 using the Modbus protocol. It extracts real-time data like voltages, amps, SOC, and temperatures - then sends it wirelessly over MQTT to your broker (e.g., Mosquitto). If youβre running Home Assistant, it auto-discovers and configures the entities.
No YAML, no cables, no vendor cloud.
---
## πͺ Hardware Wiring
Use an RJ45/Ethernet cable to neatly bridge the EPEVER RS485 port, MAX485 breakout board, and your NodeMCU ESP8266.
### Ethernet Cable Mapping (T568B standard)
```
Green/White β RS485MAX B
Blue/White β RS485MAX A
Brown/White β NodeMCU GND
Orange β NodeMCU VIN 5v
```### Full Connection Table
| Device | Pin | Connects To |
|---------------|---------------|-------------------|
| EPEVER | A (+) | MAX485 A |
| | B (β) | MAX485 B |
| | GND | MAX485 GND |
| MAX485 | RO | NodeMCU RX (D7) |
| | DI | NodeMCU TX (D6) |
| | RE | NodeMCU D1 |
| | DE | NodeMCU D2 |
| | VCC | NodeMCU 3.3V |
| NodeMCU | GND | Common Ground |> π‘ **Pro tip**: Use stranded Cat5/6 for flexibility and reduced noise.
---
## π¦ Dependencies
Install these via Arduino Library Manager:
- `ModbusMaster` by Doc Walker
- `PubSubClient` by Nick O'Leary
- `ESP8266WiFi` (built-in)
- `ArduinoOTA` (built-in)
- `SoftwareSerial`---
## π§ Prerequisites- Arduino IDE with ESP8266 board support installed
- USB-to-MicroUSB cable for uploading firmware
- Local MQTT broker (e.g. Mosquitto)
- Basic knowledge of Home Assistant (for integration)
---
## π§° Getting Started1. Clone the repo and open `EpEverSolarMonitor.ino`
2. Copy `secrets_template.h` β `secrets.h` and fill in:
```cpp
const char* hostname = "espSolarChargerOTA";
const char* mqtt_user = "your_user";
const char* mqtt_pass = "your_pass";
const char* mqtt_server = "192.168.1.x";
const int mqtt_port = 1883;
etc
```
3. Upload the sketch via USB
4. Device connects to WiFi, starts publishing via MQTT, and auto-registers in Home Assistant---
## π Published Metrics
These show up in MQTT as JSON:
- `pv_volt`, `pv_amps`, `pv_power`
- `batt_volt`, `batt_amps`, `batt_power`, `batt_charge`, `batt_soc`, `batt_temp`
- `load_volt`, `load_amps`, `load_power`**Topic**: `epever/state`
---
## π Home Assistant Integration
When `#define ENABLE_DISCOVERY` is set:
- Entities auto-register under `homeassistant/sensor/epever_*`
- Includes correct `device_class`, `unit_of_measurement`, and `unique_id`
- No YAML required---
## π Deep Sleep Support
Low power deployment? Wire **GPIO16 (D0)** to **RST** to enable wake-from-deep-sleep.
Control sleep via MQTT:
- Topic: `mortylabs/solar/deepsleep`
- Payload: `1`---
## πΈ Screenshot

---
MIT License - Made with βοΈ by MortyLabs
[](LICENSE)
[](https://arduino-esp8266.readthedocs.io/)
[](https://www.arduino.cc/)