feature: EvseMode: show EVTargetVoltage and EVTargetCurrent in the GUI

This commit is contained in:
uhi22 2024-04-29 18:59:27 +02:00
parent b74521d8e0
commit 701ab1b492
2 changed files with 10 additions and 0 deletions

View file

@ -267,11 +267,15 @@ class fsmEvse():
if (strConverterResult.find("CurrentDemandReq")>0): if (strConverterResult.find("CurrentDemandReq")>0):
# check the request content, and fill response parameters # check the request content, and fill response parameters
uTarget = 220 # default in case we cannot decode the requested voltage uTarget = 220 # default in case we cannot decode the requested voltage
iTarget = 1 # default...
try: try:
jsondict = json.loads(strConverterResult) jsondict = json.loads(strConverterResult)
strEVTargetVoltageValue = jsondict["EVTargetVoltage.Value"] strEVTargetVoltageValue = jsondict["EVTargetVoltage.Value"]
strEVTargetVoltageMultiplier = jsondict["EVTargetVoltage.Multiplier"] strEVTargetVoltageMultiplier = jsondict["EVTargetVoltage.Multiplier"]
uTarget = combineValueAndMultiplier(strEVTargetVoltageValue, strEVTargetVoltageMultiplier) uTarget = combineValueAndMultiplier(strEVTargetVoltageValue, strEVTargetVoltageMultiplier)
strEVTargetCurrentValue = jsondict["EVTargetCurrent.Value"]
strEVTargetCurrentMultiplier = jsondict["EVTargetCurrent.Multiplier"]
iTarget = combineValueAndMultiplier(strEVTargetCurrentValue, strEVTargetCurrentMultiplier)
self.addToTrace("EV wants EVTargetVoltage " + str(uTarget)) self.addToTrace("EV wants EVTargetVoltage " + str(uTarget))
current_soc = int(jsondict.get("DC_EVStatus.EVRESSSOC", -1)) current_soc = int(jsondict.get("DC_EVStatus.EVRESSSOC", -1))
full_soc = int(jsondict.get("FullSOC", -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.publishSoCs(current_soc, full_soc, energy_capacity, energy_request, origin="CurrentDemandReq")
self.callbackShowStatus(str(current_soc), "soc") self.callbackShowStatus(str(current_soc), "soc")
self.callbackShowStatus(str(uTarget) + "V, " + str(iTarget) + "A", "UandI")
except: except:
self.addToTrace("ERROR: Could not decode the CurrentDemandReq") self.addToTrace("ERROR: Could not decode the CurrentDemandReq")

View file

@ -57,6 +57,9 @@ def cbShowStatus(s, selection=""):
if (selection == "soc"): if (selection == "soc"):
lblSoc['text']= "SOC " + s + "%" lblSoc['text']= "SOC " + s + "%"
s="" s=""
if (selection == "UandI"):
lblRequestedUandI['text']= "Target " + s + ""
s=""
if (len(s)>0): if (len(s)>0):
lblStatus['text']=s lblStatus['text']=s
root.update() root.update()
@ -108,6 +111,8 @@ lblState.config(font=('Helvetica bold', 20))
lblState.pack() lblState.pack()
lblSoc = tk.Label(root, text="(soc)") lblSoc = tk.Label(root, text="(soc)")
lblSoc.pack() lblSoc.pack()
lblRequestedUandI = tk.Label(root, text="(U and I)")
lblRequestedUandI.pack()
lblUInlet = tk.Label(root, text="(U Inlet)") lblUInlet = tk.Label(root, text="(U Inlet)")
lblUInlet.config(font=('Helvetica bold', 26)) lblUInlet.config(font=('Helvetica bold', 26))
lblUInlet.pack() lblUInlet.pack()