From 9fad98bc4c13bb718d51dba40a36bb94e37a21d0 Mon Sep 17 00:00:00 2001 From: Richard van den Berg Date: Tue, 16 May 2023 23:24:41 +0200 Subject: [PATCH] Set default maxAmpsAllowedFromGrid to 16A --- etc/twcmanager/config.json | 2 +- lib/TWCManager/TWCMaster.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/twcmanager/config.json b/etc/twcmanager/config.json index f99e89f7..d59588bb 100644 --- a/etc/twcmanager/config.json +++ b/etc/twcmanager/config.json @@ -55,7 +55,7 @@ # "charge_amps": "settings.scheduledAmpsMax", # "charge_limit": "config.scheduledLimit"}, - "maxAmpsAllowedFromGrid": 15, + "maxAmpsAllowedFromGrid": 16, # https://teslamotorsclub.com/tmc/threads/model-s-gen2-charger-efficiency-testing.78740/#post-1844789 diff --git a/lib/TWCManager/TWCMaster.py b/lib/TWCManager/TWCMaster.py index b3bc52b1..c3e2942d 100644 --- a/lib/TWCManager/TWCMaster.py +++ b/lib/TWCManager/TWCMaster.py @@ -675,7 +675,7 @@ def getMaxAmpsToDivideFromGrid(self): consumptionA = self.convertWattsToAmps(consumptionW - generationW) # Calculate what we should max offer to align with max grid energy - maxAmpsAllowedFromGrid = self.config["config"]["maxAmpsAllowedFromGrid"] + maxAmpsAllowedFromGrid = self.config["config"].get("maxAmpsAllowedFromGrid", 16) amps = maxAmpsAllowedFromGrid - consumptionA + currentOffer if consumptionA > maxAmpsAllowedFromGrid: logger.info(f"getMaxAmpsToDivideFromGrid limited power: consumption {consumptionA:.1f}A > {maxAmpsAllowedFromGrid}A") @@ -1343,7 +1343,7 @@ def setMaxAmpsToDivideAmongSlaves(self, amps): if amps > self.config["config"]["wiringMaxAmpsAllTWCs"]: # Never tell the slaves to draw more amps than the physical charger # wiring can handle. - logger.info( + logger.error( "ERROR: specified maxAmpsToDivideAmongSlaves " + str(amps) + " > wiringMaxAmpsAllTWCs "