Skip to content

Commit 2effa5f

Browse files
authored
Bugfix fallback value
## V1.83 ### script * Bugfix fallback value ### config * added comment
1 parent cd0c964 commit 2effa5f

3 files changed

Lines changed: 46 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## V1.83
4+
### script
5+
* Bugfix fallback value
6+
### config
7+
* added comment
8+
39
## V1.82
410
### script
511
* read the power rating of each inverter from config file.

HoymilesZeroExport.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
__author__ = "Tobias Kraft"
18-
__version__ = "1.82"
18+
__version__ = "1.83"
1919

2020
import requests
2121
import time
@@ -1161,7 +1161,12 @@ def CreateDTU() -> DTU:
11611161
NAME.append(str('yet unknown'))
11621162
TEMPERATURE.append(str('--- degC'))
11631163
HOY_MAX_WATT.append(config.getint('INVERTER_' + str(i + 1), 'HOY_MAX_WATT'))
1164-
HOY_INVERTER_WATT.append(config.getint('INVERTER_' + str(i + 1), 'HOY_INVERTER_WATT', fallback=HOY_MAX_WATT[i]))
1164+
1165+
if (config.get('INVERTER_' + str(i + 1), 'HOY_INVERTER_WATT') != ''):
1166+
HOY_INVERTER_WATT.append(config.getint('INVERTER_' + str(i + 1), 'HOY_INVERTER_WATT'))
1167+
else:
1168+
HOY_INVERTER_WATT.append(HOY_MAX_WATT[i])
1169+
11651170
HOY_MIN_WATT.append(int(HOY_INVERTER_WATT[i] * config.getint('INVERTER_' + str(i + 1), 'HOY_MIN_WATT_IN_PERCENT') / 100))
11661171
CURRENT_LIMIT.append(int(0))
11671172
AVAILABLE.append(bool(False))

HoymilesZeroExport_Config.ini

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# ---------------------------------------------------------------------
2020

2121
[VERSION]
22-
VERSION = 1.82
22+
VERSION = 1.83
2323

2424
[SELECT_DTU]
2525
# --- define your DTU (only one) ---
@@ -238,9 +238,9 @@ POWERMETER_MAX_POINT = 0
238238
[INVERTER_1]
239239
# 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).
240240
SERIAL_NUMBER =
241-
# power rating of your inverter
241+
# manufacturer power rating of your inverter.
242242
HOY_INVERTER_WATT =
243-
# power limit of your inverter
243+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
244244
HOY_MAX_WATT = 1500
245245
# minimum limit in percent, e.g. 5% of your inverter power rating
246246
HOY_MIN_WATT_IN_PERCENT = 5
@@ -279,9 +279,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
279279
[INVERTER_2]
280280
# 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).
281281
SERIAL_NUMBER =
282-
# power rating of your inverter
282+
# manufacturer power rating of your inverter.
283283
HOY_INVERTER_WATT =
284-
# power limit of your inverter
284+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
285285
HOY_MAX_WATT = 1500
286286
# minimum limit in percent, e.g. 5% of your inverter power rating
287287
HOY_MIN_WATT_IN_PERCENT = 5
@@ -320,9 +320,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
320320
[INVERTER_3]
321321
# 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).
322322
SERIAL_NUMBER =
323-
# power rating of your inverter
323+
# manufacturer power rating of your inverter.
324324
HOY_INVERTER_WATT =
325-
# power limit of your inverter
325+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
326326
HOY_MAX_WATT = 1500
327327
# minimum limit in percent, e.g. 5% of your inverter power rating
328328
HOY_MIN_WATT_IN_PERCENT = 5
@@ -361,9 +361,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
361361
[INVERTER_4]
362362
# 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).
363363
SERIAL_NUMBER =
364-
# power rating of your inverter
364+
# manufacturer power rating of your inverter.
365365
HOY_INVERTER_WATT =
366-
# power limit of your inverter
366+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
367367
HOY_MAX_WATT = 1500
368368
# minimum limit in percent, e.g. 5% of your inverter power rating
369369
HOY_MIN_WATT_IN_PERCENT = 5
@@ -402,9 +402,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
402402
[INVERTER_5]
403403
# 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).
404404
SERIAL_NUMBER =
405-
# power rating of your inverter
405+
# manufacturer power rating of your inverter.
406406
HOY_INVERTER_WATT =
407-
# power limit of your inverter
407+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
408408
HOY_MAX_WATT = 1500
409409
# minimum limit in percent, e.g. 5% of your inverter power rating
410410
HOY_MIN_WATT_IN_PERCENT = 5
@@ -443,9 +443,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
443443
[INVERTER_6]
444444
# 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).
445445
SERIAL_NUMBER =
446-
# power rating of your inverter
446+
# manufacturer power rating of your inverter.
447447
HOY_INVERTER_WATT =
448-
# power limit of your inverter
448+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
449449
HOY_MAX_WATT = 1500
450450
# minimum limit in percent, e.g. 5% of your inverter power rating
451451
HOY_MIN_WATT_IN_PERCENT = 5
@@ -484,9 +484,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
484484
[INVERTER_7]
485485
# 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).
486486
SERIAL_NUMBER =
487-
# power rating of your inverter
487+
# manufacturer power rating of your inverter.
488488
HOY_INVERTER_WATT =
489-
# power limit of your inverter
489+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
490490
HOY_MAX_WATT = 1500
491491
# minimum limit in percent, e.g. 5% of your inverter power rating
492492
HOY_MIN_WATT_IN_PERCENT = 5
@@ -525,9 +525,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
525525
[INVERTER_8]
526526
# 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).
527527
SERIAL_NUMBER =
528-
# power rating of your inverter
528+
# manufacturer power rating of your inverter.
529529
HOY_INVERTER_WATT =
530-
# power limit of your inverter
530+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
531531
HOY_MAX_WATT = 1500
532532
# minimum limit in percent, e.g. 5% of your inverter power rating
533533
HOY_MIN_WATT_IN_PERCENT = 5
@@ -566,9 +566,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
566566
[INVERTER_9]
567567
# 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).
568568
SERIAL_NUMBER =
569-
# power rating of your inverter
569+
# manufacturer power rating of your inverter.
570570
HOY_INVERTER_WATT =
571-
# power limit of your inverter
571+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
572572
HOY_MAX_WATT = 1500
573573
# minimum limit in percent, e.g. 5% of your inverter power rating
574574
HOY_MIN_WATT_IN_PERCENT = 5
@@ -607,9 +607,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
607607
[INVERTER_10]
608608
# 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).
609609
SERIAL_NUMBER =
610-
# power rating of your inverter
610+
# manufacturer power rating of your inverter.
611611
HOY_INVERTER_WATT =
612-
# power limit of your inverter
612+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
613613
HOY_MAX_WATT = 1500
614614
# minimum limit in percent, e.g. 5% of your inverter power rating
615615
HOY_MIN_WATT_IN_PERCENT = 5
@@ -648,9 +648,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
648648
[INVERTER_11]
649649
# 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).
650650
SERIAL_NUMBER =
651-
# power rating of your inverter
651+
# manufacturer power rating of your inverter.
652652
HOY_INVERTER_WATT =
653-
# power limit of your inverter
653+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
654654
HOY_MAX_WATT = 1500
655655
# minimum limit in percent, e.g. 5% of your inverter power rating
656656
HOY_MIN_WATT_IN_PERCENT = 5
@@ -689,9 +689,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
689689
[INVERTER_12]
690690
# 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).
691691
SERIAL_NUMBER =
692-
# power rating of your inverter
692+
# manufacturer power rating of your inverter.
693693
HOY_INVERTER_WATT =
694-
# power limit of your inverter
694+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
695695
HOY_MAX_WATT = 1500
696696
# minimum limit in percent, e.g. 5% of your inverter power rating
697697
HOY_MIN_WATT_IN_PERCENT = 5
@@ -730,9 +730,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
730730
[INVERTER_13]
731731
# 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).
732732
SERIAL_NUMBER =
733-
# power rating of your inverter
733+
# manufacturer power rating of your inverter.
734734
HOY_INVERTER_WATT =
735-
# power limit of your inverter
735+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
736736
HOY_MAX_WATT = 1500
737737
# minimum limit in percent, e.g. 5% of your inverter power rating
738738
HOY_MIN_WATT_IN_PERCENT = 5
@@ -771,9 +771,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
771771
[INVERTER_14]
772772
# 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).
773773
SERIAL_NUMBER =
774-
# power rating of your inverter
774+
# manufacturer power rating of your inverter.
775775
HOY_INVERTER_WATT =
776-
# power limit of your inverter
776+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
777777
HOY_MAX_WATT = 1500
778778
# minimum limit in percent, e.g. 5% of your inverter power rating
779779
HOY_MIN_WATT_IN_PERCENT = 5
@@ -812,9 +812,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
812812
[INVERTER_15]
813813
# 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).
814814
SERIAL_NUMBER =
815-
# power rating of your inverter
815+
# manufacturer power rating of your inverter.
816816
HOY_INVERTER_WATT =
817-
# power limit of your inverter
817+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
818818
HOY_MAX_WATT = 1500
819819
# minimum limit in percent, e.g. 5% of your inverter power rating
820820
HOY_MIN_WATT_IN_PERCENT = 5
@@ -853,9 +853,9 @@ HOY_BATTERY_AVERAGE_CNT = 1
853853
[INVERTER_16]
854854
# 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).
855855
SERIAL_NUMBER =
856-
# power rating of your inverter
856+
# manufacturer power rating of your inverter.
857857
HOY_INVERTER_WATT =
858-
# power limit of your inverter
858+
# max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)
859859
HOY_MAX_WATT = 1500
860860
# minimum limit in percent, e.g. 5% of your inverter power rating
861861
HOY_MIN_WATT_IN_PERCENT = 5

0 commit comments

Comments
 (0)