Skip to content

a-bit-of-coding/MQTT-Goe-Broker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTT Power Bridge: Energy Meter & Inverter to go-eCharger

This project provides a lightweight, reliable bridge between your solar inverter, energy meter, and a go-eCharger. It is designed to run on an ESP8266 (or ESP32) to ensure maximum uptime for PV excess charging, independent of a central Home Automation server.

🚀 The Goal

Many smart homes use complex systems like Home Assistant to manage EV charging. However, if the server updates, crashes, or the network is busy, PV charging might fail.

This project follows a "Keep It Simple" philosophy:

  • Runs on a dedicated microcontroller (ESP8266/ESP32).
  • Lower complexity than a full OS.
  • Higher reliability for critical power management.

🛠 Features

  • MQTT Integration: Subscribes to multiple topics (e.g., Inverter data and Tasmota-based Smart Meter).
  • JSON Parsing: Deep-parsing of nested JSON strings to extract real-time power values.
  • go-eCharger Support: Aggregates data and publishes it in the format required by the go-eCharger for PV excess charging.
  • Web Interface: On-the-fly configuration of MQTT brokers and topics via a built-in webserver.
  • Persistent Storage: Settings are saved to the internal FileSystem (LittleFS).

📋 Hardware Requirements

  • ESP8266 (e.g., NodeMCU or Wemos D1 Mini).
  • Optional: ESP32 (requires replacing #include <ESP8266WiFi.h> with #include <WiFi.h>).
  • A running MQTT Broker (e.g., Mosquitto).
  • Tasmota Smart Meter Interface (to provide grid data via MQTT).

🔧 Installation & Configuration

  1. Clone the repository.
  2. Update config.h: Enter your WiFi credentials.
  3. Flash the ESP: Use Arduino IDE or VS Code/PlatformIO.
  4. Web Configuration:
    • Once running, access the ESP via its IP address in your browser.
    • Enter your MQTT broker details.
    • Define the JSON paths for your data (e.g., StatusSNS.lk13be.Power).
    • Save and Restart.

📡 Data Flow

  1. Inverter/Meter → publishes JSON to → MQTT Broker.
  2. ESP8266 → parses JSON → calculates totals.
  3. ESP8266 → publishes combined data → go-eCharger Topic.
  4. go-eCharger → adjusts charging current based on PV excess.

⚠️ Limitations & Security Risks

While this project aims for high reliability, users should be aware of the following points:

1. Network Stability (WiFi vs. LAN)

This implementation relies on a WiFi connection. In environments with high interference or weak signal, the connection to the MQTT broker may drop.

  • Impact: If the connection is lost, the go-eCharger will not receive updated power data, which might lead to incorrect charging behavior.
  • Recommendation: For maximum stability, consider using hardware with an Ethernet port (e.g., an ESP32 with LAN shield) or ensure a very robust WiFi coverage.

2. Security & Privacy

This is a exmperimental implementation and is open for further improvement

  • No Authentication: The built-in configuration webserver is currently not password protected. Anyone in your local network can view and modify your settings.
  • Plaintext Storage: All credentials (WiFi password, MQTT password) are stored in plaintext within a JSON file on the internal flash memory (LittleFS).
    • Risk: If someone gains physical access to the ESP or the filesystem, they can easily read your passwords.
    • Recommendation: Use a dedicated, isolated "IoT-VLAN" for your smart home devices and only use a specific MQTT user with restricted permissions for this device.

3. Fail-Safe Logic

The current logic assumes that the latest MQTT data is always valid.

  • Future Improvement: Implementation of a "Watchdog" or "Heartbeat" mechanism that stops charging if no fresh data has been received for a certain period.

⚖️ License

This project is open-source. Feel free to modify and adapt it to your specific inverter or meter setup.

About

MQTT Power Bridge: Energy Meter & Inverter to go-eCharger

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages