Phase detection on OCPP with only 1 phase details in json, but current is actually the same for all 3 in 3 phase mode. #16629
Unanswered
franzongit
asked this question in
Allgemein
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an e208 which supports single and 3 phase loading and a charger which does the same (or less).
The enercab smart charger (EVCC01) always reports only 1 current, whether 2nd and 3rd phase are used is only shown via their voltage. So while there is some code to use the voltage do dedect the phases, this code is not being called by loadpoint if there is phase switching. Since the autodetection of available metervalues was introduced, Current.Import was detected but always reported just one phase, leading to constant changing of current during misdetection and not being able to track available power. Workaround was to specify "metervalues: Power.Active.Import,Energy.Active.Import.Register,Voltage" in charger options, but not knowing the phases is bad for following the pv power - chargingrateunit: W was deprecated, so it has to be done via phases and current.
for example:
2024-10-05T08:20:24.292451+02:00 raspberrypi evcc[79122]: [ocpp ] TRACE 2024/10/05 08:20:24 received JSON message from 30J-HZH-5R4: [2,"1050410","MeterValues",{"connectorId":1,"transactionId":1728041608,"meterValue":[{"timestamp":"2024-10-05T06:20:23.610Z","sampledValue":[{"value":" 9.6","context":"Sample.Periodic","measurand":"Current.Import","phase":"L1","unit":"A"},{"value":"233.1","context":"Sample.Periodic","measurand":"Voltage","phase":"L1","unit":"V"},{"value":"233.1","context":"Sample.Periodic","measurand":"Voltage","phase":"L2","unit":"V"},{"value":"230.6","context":"Sample.Periodic","measurand":"Voltage","phase":"L3","unit":"V"},{"value":"10.0","context":"Sample.Periodic","measurand":"Current.Offered","phase":"L1","unit":"A"},{"value":"2005228.0","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","unit":"Wh"},{"value":"6687.0","context":"Sample.Periodic","measurand":"Power.Active.Import","unit":"W"}]}]}]
So there are 3 Voltages/Phase combinations, but only 1 Current .
The charger reports on initialization: {"key":"MeterValuesSampledData","readonly":false,"value":"Power.Active.Import,Energy.Active.Import.Register,Current.Import,Voltage,Current.Offered"}
So EVCC thinks that it can read the Phases via Currents and ignore the Phases via Voltages (even when instructed to do so via metervalues, because phase switching implies using current in loadpoint, and phaseswitching I cannot disable for obvious reasons in the morning and evening. Determining the phases via the charge power is not reliable, because close to 100% the car pulls down to currents less then 6A (no matter if 3 or 1 phase)
1629W/2.3A/3=236.08V, offered is 13A.
2024-10-06T13:56:43.456563+02:00 raspberrypi evcc[92396]: [ocpp ] TRACE 2024/10/06 13:56:43 received JSON message from 30J-HZH-5R4: [2,"1010337","MeterValues",{"connectorId":1,"transactionId":1728048946,"meterValue":[{"timestamp":"2024-10-06T11:56:42.687Z","sampledValue":[{"value":" 2.3","context":"Trigger","measurand":"Current.Import","phase":"L1","unit":"A"},
{"value":"239.8","context":"Trigger","measurand":"Voltage","phase":"L1","unit":"V"},{"value":"237.3","context":"Trigger","measurand":"Voltage","phase":"L2","unit":"V"},{"value":"240.6","context":"Trigger","measurand":"Voltage","phase":"L3","unit":"V"},
{"value":"13.0","context":"Trigger","measurand":"Current.Offered","phase":"L1","unit":"A"},{"value":"2042336.0","context":"Trigger","measurand":"Energy.Active.Import.Register","unit":"Wh"},{"value":"1629.0","context":"Trigger","measurand":"Power.Active.Import","unit":"W"}]}]}]
2024-10-06T13:56:46.065812+02:00 raspberrypi evcc[92396]: [lp-1 ] DEBUG 2024/10/06 13:56:46 charge power: 1629W
In single phase mode, 2nd and 3rd voltage are a few volts:
2024-10-05T15:08:48.106856+02:00 raspberrypi evcc[85989]: [ocpp ] TRACE 2024/10/05 15:08:48 received JSON message from 30J-HZH-5R4: [2,"1000170","MeterValues",{"connectorId":1,"transactionId":1728048946,"meterValue":[{"timestamp":"2024-10-05T13:08:47.834Z","sampledValue":[{"value":" 6.0","context":"Trigger","measurand":"Current.Import","phase":"L1","unit":"A"},{"value":"233.1","context":"Trigger","measurand":"Voltage","phase":"L1","unit":"V"},{"value":"24.2","context":"Trigger","measurand":"Voltage","phase":"L2","unit":"V"},{"value":"13.4","context":"Trigger","measurand":"Voltage","phase":"L3","unit":"V"},{"value":" 6.0","context":"Trigger","measurand":"Current.Offered","phase":"L1","unit":"A"},{"value":"2022650.0","context":"Trigger","measurand":"Energy.Active.Import.Register","unit":"Wh"},{"value":"1398.0","context":"Trigger","measurand":"Power.Active.Import","unit":"W"}]}]}]
which is in line with 1393.20
To fix this I modified connector.go/phaseMeasurements (#16523), I did to put it into Currents because the handling of not existing values is all in phaseMeasuremens. If the 2nd phase for current is not detected, the code now chages if there is a second phase for voltage and above 100v if yes, copies the the previous current value.
There is an additional problem with wrongly detecting 1 phase while loading with 3, the current switches between the actual one, the min (which wastes pv) and the max current (which costs), which leads to
2024-10-07T12:45:11.942226+02:00 raspberrypi evcc[118285]: [site ] DEBUG 2024/10/07 12:45:11 pv power: 8539W
2024-10-07T12:45:25.872979+02:00 raspberrypi evcc[118285]: [lp-1 ] DEBUG 2024/10/07 12:45:25 charge power: 6991W
2024-10-07T12:45:25.932397+02:00 raspberrypi evcc[118285]: [site ] DEBUG 2024/10/07 12:45:25 pv power: 8372W
2024-10-07T12:45:55.872287+02:00 raspberrypi evcc[118285]: [lp-1 ] DEBUG 2024/10/07 12:45:55 charge power: 11088W
2024-10-07T12:46:11.945078+02:00 raspberrypi evcc[118285]: [site ] DEBUG 2024/10/07 12:46:11 pv power: 6202W
2024-10-07T12:46:25.873140+02:00 raspberrypi evcc[118285]: [lp-1 ] DEBUG 2024/10/07 12:46:25 charge power: 4290W
2024-10-07T12:46:41.950573+02:00 raspberrypi evcc[118285]: [site ] DEBUG 2024/10/07 12:46:41 pv power: 6350W
2024-10-07T12:46:55.872051+02:00 raspberrypi evcc[118285]: [lp-1 ] DEBUG 2024/10/07 12:46:55 charge power: 11165W
2024-10-07T12:46:55.922770+02:00 raspberrypi evcc[118285]: [site ] DEBUG 2024/10/07 12:46:55 pv power: 5456W
2024-10-07T12:47:25.872141+02:00 raspberrypi evcc[118285]: [lp-1 ] DEBUG 2024/10/07 12:47:25 charge power: 4260W
(find this full log attached badlog_3phase.txt
I was told the pull request is not viable, because it is unclear what my patch does to 1 phase cars on a 3 phase charger - however, since I dont have such a car I cannot prove it. Supposedly api.ErrNotAvailable should help, but it does not, because even if it rejects the currents (which I can do already by excluding it in metervalues), the phase detection via voltages does not work because it is not even called because of an if statement check for phaseswitching in loadpoint.go. The patch only is active if there is ONLY 1 phase REPORTED, but 3 Phases are REPORTED and larger than 100V.
So if anybody has a 1 phase car on a 3 phase OCPP loader, could you give the pull request a try?
kind regards,
Franz
Beta Was this translation helpful? Give feedback.
All reactions