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.
- no GUI planned, configuration via ini-file only
- no integration into HomeAutomation (HA) or other similar tools
- no recommendations for system hardware setup (look elsewhere for hardware and cabling setup recommendations)
Before running this script make sure you have the following met:
- a python installation not in status "end-of-life" according to python.org To check see section "Python prerequisite check"
- 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.
- user needs basic understanding of running python scripts and modification of configuration
- Tasmota Smart Meter Interface (e.g. "Hichi IR Lesekopf" or equal)
- Shelly EM, Shelly 3EM, Shelly 3EM Pro, Shelly 1PM, Shelly Plus 1PM
- SHRDZM Smartmeter Modul
- Emlog ("electronic meter log")
- ioBroker with simpleAPI
- HomeAssistant
- Volkszaehler (VZLogger)
- ESPHome
- Mitterbaur Amis IR Reader
- shell script based interface with examples for:
- Victron Multiplus-II (via modbus TCP)
- DDSU666 powermeter (via modbus TCP)
- MSunPV powermeter (http API)
- easy to implement new smart meter modules supporting WebAPI / JSON
- Ahoy - this script is developed with AHOY and therefore i recommend it
- OpenDTU
- Hoymiles MI, HM, HMS and HMT-Series Inverter (--> all inverters that are supported by AHOY / OpenDTU)
- Note: The Hoymiles inverters with a build-in DTU, like the HMS-xxxxW Series, are not supported!
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
Open a commant prompt and execute
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
if you get an error like "error: externally-managed-environment" you´ll need to install the requirements manually with the following command:
pip install -r requirements.txt --break-system-packages
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
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
If you want to update the script to the latest version on Github:
sudo chmod +x update.sh
sudo ./update.sh
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.
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
The script can optionally be controlled via MQTT. To enable this feature, you need to configure the [MQTT_CONFIG]
section in the configuration file.
Once configured, the script will listen for incoming MQTT messages on the specified topic and act accordingly.
zeropower/set/powermeter_target_point
: To change the target point of the powermeterzeropower/set/powermeter_max_point
: To change the max point of the powermeterzeropower/set/powermeter_min_point
: To change the min point of the powermeterzeropower/set/powermeter_tolerance
: To change the tolerance of the powermeterzeropower/set/on_grid_usage_jump_to_limit_percent
: To change the on grid usage jump to limit percentzeropower/set/on_grid_feed_fast_limit_decrease
: To enable or disable the on grid feed fast limit decreasezeropower/set/inverter/0/min_watt_in_percent
: To change the min watt in percent of the first inverterzeropower/set/inverter/0/normal_watt
: To change the battery normal watt of the first inverterzeropower/set/inverter/0/reduce_watt
: To change the battery reduce watt of the first inverterzeropower/set/inverter/0/battery_priority
: To change the battery priority of the first inverterzeropower/set/inverter/<n>/*
: To change the settings of the (n+1)th inverter
To reset a setting to its original value, you can send an empty message to the corresponding topic replacing set
with reset
, e.g. zeropower/reset/powermeter_target_point
.
Additionally, the script will publish the following MQTT messages:
zeropower/status
: The current status of the script. Possible values areonline
andoffline
zeropower/state/powermeter_target_point
: The current target point of the powermeterzeropower/state/powermeter_max_point
: The current max point of the powermeterzeropower/state/powermeter_min_point
: The current min point of the powermeterzeropower/state/powermeter_tolerance
: The current tolerance of the powermeterzeropower/state/on_grid_usage_jump_to_limit_percent
: The current on grid usage jump to limit percentzeropower/state/on_grid_feed_fast_limit_decrease
: The current on grid feed fast limit decreasezeropower/state/inverter/0/min_watt_in_percent
: The current min watt in percent of the first inverterzeropower/state/inverter/0/normal_watt
: The current battery normal watt of the first inverterzeropower/state/inverter/0/reduce_watt
: The current battery reduce watt of the first inverterzeropower/state/inverter/0/battery_priority
: The current battery priority of the first inverterzeropower/state/inverter/<n>/*
: The current settings of the (n+1)th inverter
The script can also be configured to publish log messages to MQTT. To enable this feature, you need to set MQTT_LOG_LEVEL
to INFO
, which will publish all log messages to the topic zeropower/log
.
- https://github.com/lumapu/ahoy
- https://github.com/tbnobody/OpenDTU
- https://tasmota.github.io/docs/Smart-Meter-Interface/
- https://ottelo.jimdofree.com/stromz%C3%A4hler-auslesen-tasmota/
- https://hessburg.de/tasmota-wifi-smartmeter-konfigurieren/
Please support me if you like this project by spending me a coffee instead of giving away your electricity.