Skip to content

Commit ecafa67

Browse files
authored
Merge pull request #175 from reserve85/HOY_BATTERY_THRESHOLD_NORMAL_LIMIT_IN_V
Fix battery threshold normal limit in v
2 parents dec2145 + d582bfd commit ecafa67

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

CHANGELOG.md

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

3+
## V1.90
4+
### script
5+
* fix HOY_BATTERY_THRESHOLD_NORMAL_LIMIT_IN_V, see https://github.com/reserve85/HoymilesZeroExport/issues/174
6+
37
## V1.89
48
### script
59
* Auto-retry failed requests

HoymilesZeroExport.py

Lines changed: 6 additions & 10 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.89"
18+
__version__ = "1.90"
1919

2020
import requests
2121
import time
@@ -459,11 +459,13 @@ def GetCheckBattery():
459459
DTU.WaitForAck(i, SET_LIMIT_TIMEOUT_SECONDS)
460460
SetLimit.LastLimit = -1
461461
HOY_BATTERY_GOOD_VOLTAGE[i] = True
462-
HOY_MAX_WATT[i] = GetBatteryNormalWatt(i)
462+
if (minVoltage >= HOY_BATTERY_THRESHOLD_NORMAL_LIMIT_IN_V[i]) and (HOY_MAX_WATT[i] != CONFIG_PROVIDER.get_normal_wattage(i)):
463+
HOY_MAX_WATT[i] = CONFIG_PROVIDER.get_normal_wattage(i)
464+
SetLimit.LastLimit = -1
463465

464466
elif minVoltage >= HOY_BATTERY_THRESHOLD_NORMAL_LIMIT_IN_V[i]:
465-
if HOY_MAX_WATT[i] != GetBatteryNormalWatt(i):
466-
HOY_MAX_WATT[i] = GetBatteryNormalWatt(i)
467+
if HOY_MAX_WATT[i] != CONFIG_PROVIDER.get_normal_wattage(i):
468+
HOY_MAX_WATT[i] = CONFIG_PROVIDER.get_normal_wattage(i)
467469
SetLimit.LastLimit = -1
468470

469471
if HOY_BATTERY_GOOD_VOLTAGE[i]:
@@ -522,12 +524,6 @@ def GetMinWatt(pInverter: int):
522524
min_watt_percent = CONFIG_PROVIDER.get_min_wattage_in_percent(pInverter)
523525
return int(HOY_INVERTER_WATT[pInverter] * min_watt_percent / 100)
524526

525-
def GetBatteryNormalWatt(pInverter: int):
526-
normal_watt = CONFIG_PROVIDER.get_normal_wattage(pInverter)
527-
if normal_watt > HOY_MAX_WATT[pInverter]:
528-
normal_watt = HOY_MAX_WATT[pInverter]
529-
return normal_watt
530-
531527
def CutLimitToProduction(pSetpoint):
532528
if pSetpoint != GetMaxWattFromAllInverters():
533529
ActualPower = GetHoymilesActualPower()

0 commit comments

Comments
 (0)