GithubHelp home page GithubHelp logo

telekatz / venus.dbus-hoymiles Goto Github PK

View Code? Open in Web Editor NEW
24.0 9.0 4.0 1019 KB

Integrate Hoymiles microinverter into Victron Energies Venus OS

License: GNU General Public License v3.0

Python 79.24% Shell 4.25% QML 16.51%
ahoy hoymiles opendtu venusos victron victronenergy

venus.dbus-hoymiles's Introduction

dbus-hoymiles

Integrate Hoymiles microinverters into Victron Energies Venus OS

Purpose

With the scripts in this repo it should be easy possible to install, uninstall, restart a service that connects Hoymiles microinverters to the VenusOS and GX devices from Victron.

The script is intended to be used with battery powered Hoymiles inverters. It provides functions to regulate the output power of the inverters to realize a zero export system. This script cannot be used in a system that already has a Multiplus/Quattro installed.

As interface between the GX device and the Hoymiles microinverter OpenDTU or Ahoy is used:

Inspiration

This project is my first on GitHub and with the Victron Venus OS, so I took some ideas and approaches from the following projects - many thanks for sharing the knowledge:

How it works

System diagram

My setup

Pictures

Install & Configuration

Get the code

Just grab a copy of the main branch and copy them to a folder under /data/ e.g. /dbus-hoymiles. After that call the install.sh script.

The following script should do everything for you:

wget https://github.com/telekatz/venus.dbus-hoymiles/archive/refs/heads/main.zip
unzip main.zip "venus.dbus-hoymiles-main/*" -d /data
mv /data/venus.dbus-hoymiles-main /data/dbus-hoymiles
chmod a+x /data/dbus-hoymiles/install.sh
/data/dbus-hoymiles/install.sh
rm main.zip

Before installing a new version, uninstall the installed version:

/data/dbus-hoymiles/uninstall.sh

Change config.ini

Within the project there is a file /data/dbus-hoymiles/config.ini. Create a new section for each inverter to be created.

Section Config value Explanation
Inverter[n] Deviceinstance Unique ID identifying the inverter in Venus OS.

Inverter settings

The following settings are available in the device settings menu inside Venus OS:

Config value Explanation
Enabled Enables the use of the inverter.
Maximum Inverter Power Maximum power of the inverter.
Phase Valid values L1, L2 or L3: represents the phase where inverter is feeding in.
MQTT URL IP address of the MQTT server.
MQTT Port Port of the MQTT server.
MQTT User Username for the MQTT server. Leave blank if no username/password required.
MQTT Password Password for the MQTT server. Leave blank if no username/password required.
MQTT Inverter Path Path on which the DTU publishes the inverter data.
DTU Type of the DTU.
Inverter ID Number of the inverter in Ahoy.

The following settings are available only in the settings menu of the first inverter and apply for all created inverters:

Config value Explanation
Startup Limit Limits the AC power of the inverter to the generated PV power.
Startup Limit Min Initial limit.
Startup Limit Max Ends the limitation as soon as the generated PV power reaches this value.
Feed-In Limit Mode Selection of the feed in limit mode (Maximum Power, Grid Target Power or Base Load).
Grid Target Interval Minimum power change interval for grid target mode.
Grid Target Power Target power for grid import.
Grid Target Tolerance Minimum Maximal allowed lower deviation from the target grid power.
Grid Target Tolerance Maximum Maximal allowed upper deviation from the target grid power.
Base Load Period Observation period for base load mode.
Inverter Minimum Interval Minimum interval between limit changes.
Power Meter Use of an external power meter instead of internal inverter power meters for the total power. The role of the external power meter must be AC load.
Restart inverter at midnight Restarts the inverter at midnight to reset the yield day counter.

Feed-In limit modes

Mode Explanation
Maximum Power Inverter power is set to Maximum Inverter Power.
Grid Target Imported power from the grid will be regulated to the Grid Target Power. New limit will be set, if the grid power exceeds the limits specified by Grid Target Tolerance Minimum and Grid Target Tolerance Maximum. Grid Target Interval specifies the minimum time interval between two limit changes.
Base Load Inverter Power will be regulated to the lowest load power during the past Base Load Period.
Venus OS Inverter Power will be regulated by Venus OS.
External Inverter Power can be regulated by writing the limit to the path /Ac/PowerLimit of the dbus service com.victronenergy.hm.

Used documentation

venus.dbus-hoymiles's People

Contributors

telekatz avatar wolakp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

venus.dbus-hoymiles's Issues

Second Inverter is always disabled

I have enabled a second hoymiles inverter in the config.ini (both inverters connected through one OpenDTU). I can see him inside VenusOS and can change his settings. I can see his values too. But unfortunatelly the second inverter receives always the command to shut down from Venus OS although he is enabled in my settings. Even if I restart him manually, a few minutes later he receives a command from Venus OS to shut down. Is that a bug or have I done something wrong?
Thx

Keine Anzeige mehr nach Installation, nur noch weißer Bildschirm

Hallo Telekatz,

nach Installation via:

root@raspberrypi2:~# wget https://github.com/telekatz/venus.dbus-hoymiles/archive/refs/heads/main.zip
--2023-07-12 11:32:54--  https://github.com/telekatz/venus.dbus-hoymiles/archive/refs/heads/main.zip
Resolving github.com... 140.82.121.3
Connecting to github.com|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/Telekatz/venus.dbus-hoymiles/zip/refs/heads/main [following]
--2023-07-12 11:32:55--  https://codeload.github.com/Telekatz/venus.dbus-hoymiles/zip/refs/heads/main
Resolving codeload.github.com... 140.82.121.10
Connecting to codeload.github.com|140.82.121.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘main.zip’

main.zip                                                        [ <=>                                                                                                                                     ] 521.02K  3.01MB/s    in 0.2s

2023-07-12 11:32:55 (3.01 MB/s) - ‘main.zip’ saved [533528]

root@raspberrypi2:~# /data/dbus-hoymiles/uninstall.sh
-sh: /data/dbus-hoymiles/uninstall.sh: No such file or directory

root@raspberrypi2:~# unzip main.zip "venus.dbus-hoymiles-main/*" -d /data
Archive:  main.zip
   creating: venus.dbus-hoymiles-main/
  inflating: venus.dbus-hoymiles-main/HMpvinverter.py
  inflating: venus.dbus-hoymiles-main/LICENSE
  inflating: venus.dbus-hoymiles-main/README.md
  inflating: venus.dbus-hoymiles-main/config.ini
   creating: venus.dbus-hoymiles-main/img/
  inflating: venus.dbus-hoymiles-main/img/inverter.png
  inflating: venus.dbus-hoymiles-main/img/main.png
  inflating: venus.dbus-hoymiles-main/img/settings.png
  inflating: venus.dbus-hoymiles-main/img/system_diagram.png
  inflating: venus.dbus-hoymiles-main/install.sh
   creating: venus.dbus-hoymiles-main/qml/
  inflating: venus.dbus-hoymiles-main/qml/MultiHm.qml
  inflating: venus.dbus-hoymiles-main/qml/OverviewGridParallel.diff
  inflating: venus.dbus-hoymiles-main/qml/PageHmSetup.qml
  inflating: venus.dbus-hoymiles-main/qml/PageMain.diff
  inflating: venus.dbus-hoymiles-main/qml/PageVebusHm.qml
  inflating: venus.dbus-hoymiles-main/qml/overview-inverter-Hm.svg
  inflating: venus.dbus-hoymiles-main/qml/overview-inverter-short-Hm.svg
  inflating: venus.dbus-hoymiles-main/restart.sh
   creating: venus.dbus-hoymiles-main/service/
  inflating: venus.dbus-hoymiles-main/service/run
  inflating: venus.dbus-hoymiles-main/uninstall.sh
root@raspberrypi2:~# mv /data/venus.dbus-hoymiles-main /data/dbus-hoymiles
root@raspberrypi2:~# chmod a+x /data/dbus-hoymiles/install.sh
root@raspberrypi2:~# /data/dbus-hoymiles/install.sh
patching file /opt/victronenergy/gui/qml/PageMain.qml
patching file /opt/victronenergy/gui/qml/OverviewGridParallel.qml
`root@raspberrypi2:~#

wird nichts mehr angezeigt:

Telekatz

Auch ein

root@raspberrypi2:~# reboot
brachte nix.

Glücklicherweise ist wieder alles ok nach zweimal uninstall.sh, jedoch gab es Fehlermeldungen:

root@raspberrypi2:~# /data/dbus-hoymiles/uninstall.sh
/data/dbus-hoymiles/uninstall.sh: line 8: ./restart.sh: No such file or directory
root@raspberrypi2:~# /data/dbus-hoymiles/uninstall.sh
rm: can't remove '/service/dbus-hoymiles': No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
/data/dbus-hoymiles/uninstall.sh: line 8: ./restart.sh: No such file or directory
cp: can't stat '/opt/victronenergy/gui/qml/OverviewGridParallel._qml': No such file or directory
cp: can't stat '/opt/victronenergy/gui/qml/PageMain._qml': No such file or directory
rm: can't remove '/opt/victronenergy/gui/qml/OverviewGridParallel._qml': No such file or directory
rm: can't remove '/opt/victronenergy/gui/qml/PageMain._qml': No such file or directory
rm: can't remove '/opt/victronenergy/gui/qml/MultiHm.qml': No such file or directory
rm: can't remove '/opt/victronenergy/gui/qml/PageHmSetup.qml': No such file or directory
rm: can't remove '/opt/victronenergy/gui/qml/PageVebusHm.qml': No such file or directory
rm: can't remove '/opt/victronenergy/themes/ccgx/images/overview-inverter-Hm.svg': No such file or directory
rm: can't remove '/opt/victronenergy/themes/ccgx/images/overview-inverter-short-Hm.svg': No such file or directory

venus os v3.00

Gruß Gerd

Script läuft nach Stromausfall nicht wieder an

Moin!
Zuerst einmal vielen Dank für das tolle Script, es trifft genau meinen Anwendungsfall und ist super!

Folgendes Problem:
Nach einem Stromausfall/dem Ziehen der Sicherung läuft das Script nicht wieder an, womit letztlich die Akkus leer gezogen werden, bis das BMS eingreift.
Auch wenn ich die Komponenten nach Einsatz der Sicherung von Hand in vorgesehener Reihenfolge wieder einschalte, bleibt im Venus OS (v.2.94) folgendes Bild (dort sind auch meine Komponenten erkennbar (HM-300 ist ein kleines Panel, welches nicht über Dein Script gesteuert wird)) :
telekatz1

Auch nach Reboot des Venus OS ändert sich nichts, erst wenn ich deinen Service per SSH neu starte/neu installiere, läuft er wieder.
Beim Versuch des unistall.sh kommt noch folgender Fehler:
telekatz2

Lässt sich das Ganze besser abfangen?
Danke und Gruß,
Tom

Akku auschalten, wenn voll oder kein Überschuss vorhanden ist

Hi,

hast du schonmal drüber nachgedacht, ob es möglich ist den Akku vollkommen aus zu schalten?

  • Wenn er voll ist und der PV-Überschuss eingespeist wird.
  • Am Morgen, wenn noch kein Überschuss vorhanden ist und die PV Leistung im Haus verbraucht wird.
  • Im Winter oder schlechten Tagen, wenn man ihn dann gerne auf 50% stehen lassen will.

Wahrscheinlich ist es aber gar nicht möglich, da der Laderegler ja mit dem Akku zusammen arbeitet.

Ich weiß (bisher) nicht, ob es über den CAN-Bus möglich wäre, aber die Kontakt-Schnittstelle scheint ja Pin 1 & 2 dafür zu haben:
image

Wenn er voll ist, macht er bei mir dieses hier, glaube nicht, dass das auf Dauer so gut für den Akku ist:
image
Würde mich mal interessieren, wie das mit einem Victron Wechselrichter aussieht.

Hängt vielleicht aber auch damit zusammen, dass der Hoymiles (bei mir) sehr unruhig ist, wenn man das Limit über 200W einstellt, da schwankt die Leistung sekündlich um 50-100W rauf und runter, was der Akku dann natürlich liefert und die Steuerung versucht dagegen zu steuern.

image

Wobei es dann auch wieder Bereiche gibt, da ist es wieder stabiler:
image

After installing, all values in VenusOS are 0 - including battery voltage, causing alarm

Hello, I installed the code as described. Immediately after running the install.sh script, all values in Venus (such as Grid, Critical Loads etc.) were set to zero - causing a battery alarm. So I quickly uninstalled the code, and everything went back to normal. Do you have any idea why this could happen, and how to install the code more safely? Thank you

Support for HMS/Three-Phase-Inverters?

Ich habe etwas durch den Code geschaut und habe dort leider nur Support für (mehrere) einphasige Inverter gefunden. Ich plane gerade ein neues System und stehe aktuell vor der Entscheidung, mehrere einphasige oder einen dreiphasigen Inverter zu besorgen. Ist da aktuell support für geplant oder generell nicht? (Ich habe mich leider noch zu wenig damit auseinandergesetzt, ob der limit-mode bei den HMS-Invertern auch für jede Phase einzeln oder nur global geht.)

Danke schonmal für dieses coole Projekt! Falls dreiphasig nicht geplant ist, werde ich einfach einphasige verwenden, ist kein Problem!

(PR) Allow external control of HM

Dear Telekatz,
thank you for this great project. I am using a similar setup as yours but use Node-Red for the control
of the HM via Open-DTU. Would it be possible to implement another "limit Mode" that would disable the
steering of the HM via your driver and only leave the display of the values in the cerbo?

Thanks
Andreas

Akku wird zu leer gesaugt, BMS trennt Akku vom System

Hallo, zunächst möchte ich mich bei dir bedanken für das tolle Projekt. Ich nutze es mit einem div 14kw lifepo4 Akku mit Seplos BMS.
2 Victron Laderegler + Cerbo + Victron Shunt.
Da die Steuerung über das Seplos BMS alles andere als genau ist, habe ich mich entschlossen zusätzlich einen Victron Shunt dafür einzusetzen, was jetzt auch spürbar besser geworden ist. Trotzdem verrechnet sich der Shunt von Zeit zu Zeit, was dazu führt, das die Batterien viel zu leer gezogen wird. Deshalb möchte ich dich bitten, eine Batterie Steuerung hinzu zu fügen, welche dafür sorgt, das der hoymiles Wechselrichter ab einer eingestellten Spannung (Volt) abgeschaltet wird. In der Konfiguration von einem Muliplus ist so eine Einstellung möglich. Mfg

Mehrere Inverter

Hallo Telekatz,
das ist wirklich ein super Ansatz, die Inverter direkt in Venus zu integieren. Meine Frage ist, wie das ganze mit mehreren , z.B. 3 Stück HM1500 an einer DTU, aussehen würde. Würde dies schon funktionieren?
Vielen Dank und Grüße
Volker

Feed-in PowerLimit will set to 30W, therefore no regulation

venus.dbus-hoymiles

HM1500 with openDTU is integrated
All settings in the Victron Cerbo are made
Maximum Power Inverter is set to 700W
MQTT Settings are made
Feed in Power Mode is set to VENUS OS
Tasmota as Grid is installed
ESS is konfigured-
The Problem:
With these settings, the Feed-in Power Limit will be set to 30W or 32W?

ESS Settings

Hi, ich habe heute mit den Victron settings>ESS Einstellungen rumgespielt und war verwundert, warum mein Hoymiles auf Maximum läuft, obwohl ich "Maximum inverter power" und "Grid setpoint" eingestellt habe.
Hat eine Weile gedauert, bis ich gemerkt habe, dass die Einstellungen dort gar nichts machen?
Auf jeden Fall hat mein Hoymiles sein Limit nicht mehr geändert, bis ich dann im ESS den Mode weg von "Optimized (with BatteryLife)" gestellt hab. Erst als ich dann hier "Optimized (without BatteryLife)" gesagt habe, hat dein Script den Hoymiles wieder auf 30W geregelt. (Warum eigentlich 30W, geht nicht weniger?)

Sprich: Welche Einstellungen unter "ESS" nimmt dein Script und welche werden ignoriert? Ich dachte der Vorteil von dem Venus OS (gegenüber openDTUonBattery) sei, dass da "jemand" (also Victron) mit KnowHow und Sicht auf das BMS und die Batterie-Lebensdauer den Laderegler und den Inverter steuert. Quasi das Venus OS denkt, dass der Hoymiles ein "normaler" Victron-Wechselrichter sei und diesen fernsteuert.

(Nebenbei verstehe ich die Einstellungen unter "Startup" nicht und die "Tolerance" ist mir auch nicht so ganz klar.)
Ich habe einen HM-1500, möchte diesen aber gerne auf 800W drosseln, wenn der Akku voll ist kann er PV-Überschuss gerne einspeisen, aber soll bitte nichts aus dem Akku ins Netz schicken was ich nicht verbrauche. Vielleicht kannst du mir mit den Settings helfen?

support with the settings

I'm new to VictronOS and Solar.
My setup: Two PV modules, Victron SmartSolar MTTP 150/35, battery with 3.5 KWH, Raspi with VictronOS, Hoymiles HM-600, Shelly 3em for the load indicator.
So far everything is fine, everything is running.
First I tried OpenDtu later I tried it with OpenDTU on battery, unfortunately not as I wanted.
Today I came across your script, but I didn't really understand the settings and I couldn't find any instructions either.
Your script takes data from the ESS and which one adjusts.
I don't know if it's possible.
I would first charge the battery until its SOC is 90%, later when the battery is full, I think it can feed in a full 600w or what comes from the charge controller, but if the charge controller no longer brings anything, i.e. no more sun, it should be with 150w keep running until the battery runs out.

I would be very happy if you would help me, I think that these settings would help many people.

How can I set AcPosition

How can I select the position for the inverts?

AcPosition shown in Remote Console (0=AC input 1; 1=AC output; 2=AC input 2)

Startup limit min/max

Hello Telekatz,

thx for this module!
Actually i am testing with this and wondering how to configure the Startup limit min and max. and the feed-in limit mode.

My system looks like yours, but containes an additionally pv generater, which Venus didnt know (SMA SB5000TL-20) and the total grid power is <0 with enough sunshine. Maybe thats my problem !?

Startup limit = off -> feed-in mode grid and load seems ok , but what does managed by VenusOs mean?
If i choose it and battery is full loaded, the mppt runs down and no feed-in is generated. If i choose maximum power, the inverter feeds with selected power, but all the time and is using the battery, if there isnt enough power from mppt.
Is there an option for feed-in only the overhead power with selected startup min/max ? And if there isnt enough power to reduce gridpower to configured value, then battery will be used ?

Or any other idea? Maybe i am confused with all these options -.-

Greetings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.