mirror of
https://github.com/uhi22/pyPLC.git
synced 2024-11-20 01:13:58 +00:00
feature: reaction to more EVSE status codes
This commit is contained in:
parent
46654d73f0
commit
164b40f16e
1 changed files with 35 additions and 12 deletions
47
fsmPev.py
47
fsmPev.py
|
@ -113,7 +113,39 @@ class fsmPev():
|
||||||
if (statenumber == stateEnd):
|
if (statenumber == stateEnd):
|
||||||
s = "End"
|
s = "End"
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
def isErrorEvseStatusCode(self, strEvseStatusCode):
|
||||||
|
# 0 is EVSE_NotReady. This may be normal, no error, just wait.
|
||||||
|
# 1 is EVSE_Ready: The normal case.
|
||||||
|
if (strEvseStatusCode == "2"): # EVSE_Shutdown: The user stopped the charging normally on charger.
|
||||||
|
self.addToTrace("EVSE_Shutdown. Seems the user canceled the charging on the charger.")
|
||||||
|
self.publishStatus("EVSE_Shutdown")
|
||||||
|
return True
|
||||||
|
if (strEvseStatusCode == "3"): # EVSE_UtilityInterruptEvent: Stopped or power reduction
|
||||||
|
self.addToTrace("EVSE_UtilityInterruptEvent.")
|
||||||
|
self.publishStatus("EVSE_UtilityInterruptEvent")
|
||||||
|
return True
|
||||||
|
# 4 is EVSE_IsolationMonitoringActive. This is normal, no error.
|
||||||
|
if (strEvseStatusCode == "5"): # EVSE_EmergencyShutdown: Error or Notaus button
|
||||||
|
self.addToTrace("EVSE_EmergencyShutdown.")
|
||||||
|
self.publishStatus("EVSE_EmergencyShutdown")
|
||||||
|
return True
|
||||||
|
if (strEvseStatusCode == "6"): # EVSE_Malfunction: Error
|
||||||
|
self.addToTrace("EVSE_Malfunction.")
|
||||||
|
self.publishStatus("EVSE_Malfunction")
|
||||||
|
return True
|
||||||
|
if (strEvseStatusCode == "7"): # Reserved, Error
|
||||||
|
return True
|
||||||
|
if (strEvseStatusCode == "8"): # Reserved, Error
|
||||||
|
return True
|
||||||
|
if (strEvseStatusCode == "9"): # Reserved, Error
|
||||||
|
return True
|
||||||
|
if (strEvseStatusCode == "10"): # Reserved, Error
|
||||||
|
return True
|
||||||
|
if (strEvseStatusCode == "11"): # Reserved, Error
|
||||||
|
return True
|
||||||
|
return False # no critical error detected
|
||||||
|
|
||||||
def sendChargeParameterDiscoveryReq(self):
|
def sendChargeParameterDiscoveryReq(self):
|
||||||
soc = str(self.hardwareInterface.getSoc())
|
soc = str(self.hardwareInterface.getSoc())
|
||||||
msg = addV2GTPHeader(self.exiEncode("EDE_"+self.sessionId + "_" + soc)) # EDE for Encode, Din, ChargeParameterDiscovery.
|
msg = addV2GTPHeader(self.exiEncode("EDE_"+self.sessionId + "_" + soc)) # EDE for Encode, Din, ChargeParameterDiscovery.
|
||||||
|
@ -428,9 +460,7 @@ class fsmPev():
|
||||||
except:
|
except:
|
||||||
self.addToTrace("ERROR: Could not decode the PreChargeResponse")
|
self.addToTrace("ERROR: Could not decode the PreChargeResponse")
|
||||||
self.addToTrace("PreChargeResponse received.")
|
self.addToTrace("PreChargeResponse received.")
|
||||||
if (strEVSEStatusCode=="2"):
|
if (self.isErrorEvseStatusCode(strEVSEStatusCode)):
|
||||||
self.addToTrace("EVSE_Shutdown. Seems the user canceled the charging on the charger.")
|
|
||||||
self.publishStatus("EVSE_Shutdown")
|
|
||||||
self.enterState(stateUnrecoverableError)
|
self.enterState(stateUnrecoverableError)
|
||||||
return
|
return
|
||||||
if (getConfigValueBool("use_evsepresentvoltage_for_precharge_end")):
|
if (getConfigValueBool("use_evsepresentvoltage_for_precharge_end")):
|
||||||
|
@ -536,14 +566,7 @@ class fsmPev():
|
||||||
strEVSEStatusCode = y["DC_EVSEStatus.EVSEStatusCode"]
|
strEVSEStatusCode = y["DC_EVSEStatus.EVSEStatusCode"]
|
||||||
except:
|
except:
|
||||||
self.addToTrace("ERROR: Could not decode the PreChargeResponse")
|
self.addToTrace("ERROR: Could not decode the PreChargeResponse")
|
||||||
if (strEVSEStatusCode=="2"):
|
if (self.isErrorEvseStatusCode(strEVSEStatusCode)):
|
||||||
self.addToTrace("EVSE_Shutdown. Seems the user canceled the charging on the charger.")
|
|
||||||
self.publishStatus("EVSE_Shutdown")
|
|
||||||
self.enterState(stateUnrecoverableError)
|
|
||||||
return
|
|
||||||
if (strEVSEStatusCode=="6"):
|
|
||||||
self.addToTrace("EVSE_Malfunction. Seems the charger detected a problem.")
|
|
||||||
self.publishStatus("EVSE_Malfunction")
|
|
||||||
self.enterState(stateUnrecoverableError)
|
self.enterState(stateUnrecoverableError)
|
||||||
return
|
return
|
||||||
if (getConfigValueBool("use_physical_inlet_voltage_during_chargeloop")):
|
if (getConfigValueBool("use_physical_inlet_voltage_during_chargeloop")):
|
||||||
|
|
Loading…
Reference in a new issue