Skip to content

Zero Export Script for Hoymiles Inverters using AhoyDTU / OpenDTU and Tasmota Smart Meter inferface / Shelly 3EM / SHRDZM / Emlog / ioBroker

License

Notifications You must be signed in to change notification settings

ms49434/HoymilesZeroExport

 
 

Repository files navigation

Hoymiles Zero Export Control / Hoymiles Nulleinspeisung

Introduction

Hoymiles Zero Export is a Python script for managing the power of the Hoymiles inverters to reduce the amount of the generated power to the grid. Based on the current power output, the script can automatically adjust the export limit of the inverter, allowing for optimal energy management.

Prerequisites

Before running this script make sure you have a powermeter which outputs a negative power value in case of returning to the grid. For example: the Holley DTZ541 shows -150W if the solar inverter is overproducing. This script does not use MQTT, it's based on webapi communication.

Supported Smart-Meter Modules:

Supported DTU and Inverters

  • Ahoy - this script is developed with AHOY and therefore i recommend it
  • OpenDTU
  • Hoymiles HM + HMS-Series Inverter (since V1.7 multiple inverters are supported) like 1-in-1, 2-in-1 or 4-in-1

Support of battery powered Hoymiles Inverters

With Version 1.28 and higher you can set various limits to support battery powered Hoymiles Inverters

  • power-off limit
  • limit reduction if battery voltage drops
  • auto-power-on if battery voltage rises

Examples in Home-Assistant:

qkeo2J4U IMG_E0136

Linux installation

Make sure you have Python 3.9.2 or greater installed:

python3 --version

if you don´t have python installed or an older version is on your machine, then install or upgrade it

Get the code and unpack the archive:

wget https://github.com/reserve85/HoymilesZeroExport/archive/refs/heads/main.zip
unzip main.zip
rm main.zip
mv HoymilesZeroExport-main/ HoymilesZeroExport/
cd HoymilesZeroExport/

Launch installscript to create zero export service

sudo chmod +x install.sh
sudo ./install.sh

Configuration Variant A:

Define your configuration: edit HoymilesZeroExport_Config_Override.ini. You need to provide a configuration where you override individual values. To do that edit HoymilesZeroExport_Config_Override.ini and set the configuration values from HoymilesZeroExport_Config.ini you'd like to override.

sudo nano HoymilesZeroExport_Config_Override.ini

The minimum content for using AhoyDTU with a Tasmota powermeter looks like this:

[SELECT_DTU]
USE_AHOY = true

[SELECT_POWERMETER]
USE_TASMOTA = true

[AHOY_DTU]
AHOY_IP = 192.168.10.57

[TASMOTA]
TASMOTA_IP = 192.168.10.90
...

Save with ctrl + s, exit with ctrl + x

Configuration Variant B:

You can also edit the default configuration, but i recommend the procedure described above (Configuration Variant A:)

sudo nano HoymilesZeroExport_Config.ini

save with ctrl + s, exit with ctrl + x

Restart the service after modified configuration or script

sudo ./restart.sh

View the output log

sudo journalctl -u HoymilesZeroExport.service -n 20000 -e -f

If you really don´t want the service anymore, just uninstall it

sudo ./uninstall_service.sh

Windows installation

Get Python 3 (download is available at https://www.python.org/) and then install the module "requests" and "packaging":

pip3 install -r requirements.txt

Now you can execute the script with python.

Docker

By default the Docker image uses a base configuration in HoymilesZeroExport_Config.ini. You need to provide a configuration where you override individual values. To do that, create a new HoymilesZeroExport_Config_Override.ini and set the configuration values from HoymilesZeroExport_Config.ini you'd like to override. The minimum config file for using AhoyDTU with a Tasmota powermeter looks like this:

[SELECT_DTU]
USE_AHOY = true

[SELECT_POWERMETER]
USE_TASMOTA = true

[AHOY_DTU]
AHOY_IP = 192.168.10.57

[TASMOTA]
TASMOTA_IP = 192.168.10.90

Then run the Docker image:

docker run -d --name hoymileszeroexport \
    -v ${PWD}/HoymilesZeroExport_Config_Override.ini:/app/HoymilesZeroExport_Config_Override.ini \
    ghcr.io/reserve85/hoymileszeroexport:main -c ./HoymilesZeroExport_Config_Override.ini

Using docker-compose:

version: '3.3'
services:
  hoymileszeroexport:
    image: ghcr.io/reserve85/hoymileszeroexport:main
    volumes:
      - ./HoymilesZeroExport_Config_Override.ini:/app/config.ini
    command: -c /app/config.ini

Special thanks to:

Donate and become a Sponsor

paypal

Please support me if you like this project by spending me a coffee instead of giving away your electricity.

About

Zero Export Script for Hoymiles Inverters using AhoyDTU / OpenDTU and Tasmota Smart Meter inferface / Shelly 3EM / SHRDZM / Emlog / ioBroker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.2%
  • Shell 4.6%
  • Dockerfile 1.2%