Skip to content

Using an ESP8266/ESP32 to emulate a Shelly Power Meter using various energy meter data inputs

License

Notifications You must be signed in to change notification settings

erikgieseler/Energy2Shelly_ESP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Energy2Shelly_ESP

Getting started

This is a Shelly Pro 3EM Emulator running on ESP8266 or ESP32 using various input sources for power data.
This can be used for zero feed-in with Hoymiles MS-A2 and Marstek Venus (testers needed!).

Kudos to @sdeigms excellent work at https://github.com/sdeigm/uni-meter which made this port easily possible.
SMA Multicast code is based on https://www.mikrocontroller.net/topic/559607

Installation

  1. compile for your microcontrollers
  2. flashing and power up (it opens a hotspot named "Energy2Shelly")
  3. running WifiManager for intial WiFi setup and further configuration

On the captive portal you can currently enter:

  • MQTT

    • Server IP, port and topic; power values on the MQTT topic are expected in JSON format. The are multiple fields to define the available values using a JSON Path-style syntax. You can also select between monophase and triphase power data.

      examples (monophase profile):

      • Total power JSON path -> ENERGY.Power for {"ENERGY":{"Power":9.99}}
      • Phase 1 power JSON path -> "no definition"
      • Phase 2 power JSON path -> "no definition"
      • Phase 3 power JSON path -> "no definition"
      • Energy from grid JSON path -> ENERGY.Consumption for {"ENERGY":{"Consumption"77}}
      • Energy to grid JSON path -> ENERGY.Production for {"ENERGY":{"Production"33}}
        -> Energy2Shelly_ESP responds to
        {"ENERGY":{"Power": 9.99,"Consumption":77,"Production":33}}

      examples (triphase profile):

      • Total power JSON path -> ENERGY.Power for {"ENERGY":{"Power":7.3}}
      • Phase 1 power JSON path -> ENERGY.Pow1 for {"ENERGY":{"Pow1":98}}
      • Phase 2 power JSON path -> ENERGY.Pow2 for {"ENERGY":{"Pow2":196}}
      • Phase 3 power JSON path -> ENERGY.Pow3 for {"ENERGY":{"Pow3":294}}
      • Energy from grid JSON path -> ENERGY.Consumption for {"ENERGY":{"Consumption"98}}
      • Energy to grid JSON path -> ENERGY.Production for {"ENERGY":{"Production"131}}
        -> Energy2Shelly_ESP responds to
        {"ENERGY":{"Power":7.3,"Pow1":98,"Pow2":196,"Pow3":294,"Consumption":98,"Production":131}}
  • SMA

    • SMA Energy Meter or Home Manager UDP multicast data
  • SHRDZM

    • SHRDZM smart meter interface (common in Austria) with UDP unicast data; please enable UDP broadcasts to the IP of the ESP and port 9522 within SHRDZM
  • HTTP

    • a generic HTTP input; enter a query URL in the second parameter field which delivers JSON data and define at least the JSON Path for total power. For full details on JSONPath configuration, check the section on MQTT above.

Here are some sample generic HTTP query paths for common devices:

The Shelly ID defaults to the ESP's MAC address, you may change this if you want to substitute an existing uni-meter configuration without reconnecting the battery to a new shelly device.

  1. Check if your device is visible in the WLAN. http://IP-address
  2. Check the current power data at http://IP-address/status
  • (Optional) If you want to reset you Wifi-Configuration and/or reconfigure other settings go to http://IP-address/reset and reconnect to the Energy2Shelly hotspot.

Tested microcontrollers

  • ESP32 (ESP32-WROOM-32)
  • ESP8266

You found a bug

First, sorry. This software is not perfect.

  1. Open a issue -With helpful title - use descriptive keywords in the title and body so others can find your bug (avoiding duplicates).
  • Which branch, what microcontroller, what setup
  • Steps to reproduce the problem, with actual vs. expected results
  • If you find a bug in our code, post the files and the lines.


some screenshots from project

wifi

Settings

settings settings

main

status

Note

Images may vary depending on the version. We always try to be up to date.

About

Using an ESP8266/ESP32 to emulate a Shelly Power Meter using various energy meter data inputs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%