Skip to content

Commit

Permalink
Merge pull request #158 from ms49434/main
Browse files Browse the repository at this point in the history
Allow the configuration of HOY_INVERTER_WATT
  • Loading branch information
reserve85 authored Mar 5, 2024
2 parents 4093497 + 9d776c6 commit cd0c964
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 20 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## V1.82
### script
* read the power rating of each inverter from config file.
* calculate HOY_MIN_POWER based on the inverter power rating.
### config
* add HOY_INVERTER_WATT to INVERTER_x section

## V1.81
### script
* add option to enable/disable to set the inverter to min watts when the powermeter can´t be read out. https://github.com/reserve85/HoymilesZeroExport/issues/28#issuecomment-1967306742 + https://github.com/reserve85/HoymilesZeroExport/issues/74
Expand Down
6 changes: 3 additions & 3 deletions HoymilesZeroExport.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__author__ = "Tobias Kraft"
__version__ = "1.81"
__version__ = "1.82"

import requests
import time
Expand Down Expand Up @@ -1161,8 +1161,8 @@ def CreateDTU() -> DTU:
NAME.append(str('yet unknown'))
TEMPERATURE.append(str('--- degC'))
HOY_MAX_WATT.append(config.getint('INVERTER_' + str(i + 1), 'HOY_MAX_WATT'))
HOY_INVERTER_WATT.append(HOY_MAX_WATT[i])
HOY_MIN_WATT.append(int(HOY_MAX_WATT[i] * config.getint('INVERTER_' + str(i + 1), 'HOY_MIN_WATT_IN_PERCENT') / 100))
HOY_INVERTER_WATT.append(config.getint('INVERTER_' + str(i + 1), 'HOY_INVERTER_WATT', fallback=HOY_MAX_WATT[i]))
HOY_MIN_WATT.append(int(HOY_INVERTER_WATT[i] * config.getint('INVERTER_' + str(i + 1), 'HOY_MIN_WATT_IN_PERCENT') / 100))
CURRENT_LIMIT.append(int(0))
AVAILABLE.append(bool(False))
LASTLIMITACKNOWLEDGED.append(bool(False))
Expand Down
66 changes: 49 additions & 17 deletions HoymilesZeroExport_Config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# ---------------------------------------------------------------------

[VERSION]
VERSION = 1.81
VERSION = 1.82

[SELECT_DTU]
# --- define your DTU (only one) ---
Expand Down Expand Up @@ -239,8 +239,10 @@ POWERMETER_MAX_POINT = 0
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -278,8 +280,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -317,8 +321,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -356,8 +362,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -395,8 +403,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -434,8 +444,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -473,8 +485,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -512,8 +526,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -551,8 +567,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -590,8 +608,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -629,8 +649,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -668,8 +690,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -707,8 +731,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -746,8 +772,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -785,8 +813,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down Expand Up @@ -824,8 +854,10 @@ HOY_BATTERY_AVERAGE_CNT = 1
# serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).
SERIAL_NUMBER =
# power rating of your inverter
HOY_INVERTER_WATT =
# power limit of your inverter
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5%
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
Expand Down

0 comments on commit cd0c964

Please sign in to comment.