From 701ab1b492385c818e5c2c6b7ed5873c0ce3597e Mon Sep 17 00:00:00 2001 From: uhi22 Date: Mon, 29 Apr 2024 18:59:27 +0200 Subject: [PATCH] feature: EvseMode: show EVTargetVoltage and EVTargetCurrent in the GUI --- fsmEvse.py | 5 +++++ pyPlc.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/fsmEvse.py b/fsmEvse.py index 7fd2a4c..7637849 100644 --- a/fsmEvse.py +++ b/fsmEvse.py @@ -267,11 +267,15 @@ class fsmEvse(): if (strConverterResult.find("CurrentDemandReq")>0): # check the request content, and fill response parameters uTarget = 220 # default in case we cannot decode the requested voltage + iTarget = 1 # default... try: jsondict = json.loads(strConverterResult) strEVTargetVoltageValue = jsondict["EVTargetVoltage.Value"] strEVTargetVoltageMultiplier = jsondict["EVTargetVoltage.Multiplier"] uTarget = combineValueAndMultiplier(strEVTargetVoltageValue, strEVTargetVoltageMultiplier) + strEVTargetCurrentValue = jsondict["EVTargetCurrent.Value"] + strEVTargetCurrentMultiplier = jsondict["EVTargetCurrent.Multiplier"] + iTarget = combineValueAndMultiplier(strEVTargetCurrentValue, strEVTargetCurrentMultiplier) self.addToTrace("EV wants EVTargetVoltage " + str(uTarget)) current_soc = int(jsondict.get("DC_EVStatus.EVRESSSOC", -1)) full_soc = int(jsondict.get("FullSOC", -1)) @@ -281,6 +285,7 @@ class fsmEvse(): self.publishSoCs(current_soc, full_soc, energy_capacity, energy_request, origin="CurrentDemandReq") self.callbackShowStatus(str(current_soc), "soc") + self.callbackShowStatus(str(uTarget) + "V, " + str(iTarget) + "A", "UandI") except: self.addToTrace("ERROR: Could not decode the CurrentDemandReq") diff --git a/pyPlc.py b/pyPlc.py index daff7ee..401cf20 100644 --- a/pyPlc.py +++ b/pyPlc.py @@ -57,6 +57,9 @@ def cbShowStatus(s, selection=""): if (selection == "soc"): lblSoc['text']= "SOC " + s + "%" s="" + if (selection == "UandI"): + lblRequestedUandI['text']= "Target " + s + "" + s="" if (len(s)>0): lblStatus['text']=s root.update() @@ -108,6 +111,8 @@ lblState.config(font=('Helvetica bold', 20)) lblState.pack() lblSoc = tk.Label(root, text="(soc)") lblSoc.pack() +lblRequestedUandI = tk.Label(root, text="(U and I)") +lblRequestedUandI.pack() lblUInlet = tk.Label(root, text="(U Inlet)") lblUInlet.config(font=('Helvetica bold', 26)) lblUInlet.pack()