Skip to content

Commit

Permalink
Bugfix fallback value
Browse files Browse the repository at this point in the history
## V1.83
### script
* Bugfix fallback value
### config
* added comment
  • Loading branch information
reserve85 authored Mar 5, 2024
1 parent cd0c964 commit 2effa5f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 35 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## V1.83
### script
* Bugfix fallback value
### config
* added comment

## V1.82
### script
* read the power rating of each inverter from config file.
Expand Down
9 changes: 7 additions & 2 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.82"
__version__ = "1.83"

import requests
import time
Expand Down Expand Up @@ -1161,7 +1161,12 @@ 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(config.getint('INVERTER_' + str(i + 1), 'HOY_INVERTER_WATT', fallback=HOY_MAX_WATT[i]))

if (config.get('INVERTER_' + str(i + 1), 'HOY_INVERTER_WATT') != ''):
HOY_INVERTER_WATT.append(config.getint('INVERTER_' + str(i + 1), 'HOY_INVERTER_WATT'))
else:
HOY_INVERTER_WATT.append(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))
Expand Down
66 changes: 33 additions & 33 deletions HoymilesZeroExport_Config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# ---------------------------------------------------------------------

[VERSION]
VERSION = 1.82
VERSION = 1.83

[SELECT_DTU]
# --- define your DTU (only one) ---
Expand Down Expand Up @@ -238,9 +238,9 @@ POWERMETER_MAX_POINT = 0
[INVERTER_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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -279,9 +279,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_2]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -320,9 +320,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_3]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -361,9 +361,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_4]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -402,9 +402,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_5]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -443,9 +443,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_6]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -484,9 +484,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_7]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -525,9 +525,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_8]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -566,9 +566,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_9]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -607,9 +607,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_10]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -648,9 +648,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_11]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -689,9 +689,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_12]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -730,9 +730,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_13]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -771,9 +771,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_14]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -812,9 +812,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_15]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down Expand Up @@ -853,9 +853,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
[INVERTER_16]
# 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
# manufacturer power rating of your inverter.
HOY_INVERTER_WATT =
# power limit of your inverter
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
HOY_MAX_WATT = 1500
# minimum limit in percent, e.g. 5% of your inverter power rating
HOY_MIN_WATT_IN_PERCENT = 5
Expand Down

0 comments on commit 2effa5f

Please sign in to comment.