evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Ocpp: en+ hijacking logic

Open andig opened this issue 2 weeks ago • 2 comments

Discussed in https://github.com/evcc-io/evcc/discussions/14602

Originally posted by jeffborg June 28, 2024 Hi

I have a en+ wallbox and it is sending the transactionId on metervalues even though the transaction has stopped

[2,"134","MeterValues",{"connectorId":1,"meterValue":[{"timestamp":"2024-06-28T01:47:54Z","sampledValue":[{"measurand":"Current.Offered","unit":"A","value":"32.0","context":"Sample.Periodic"},{"measurand":"Current.Import","unit":"A","phase":"L1","value":"0"},{"measurand":"Voltage","unit":"V","phase":"L1","value":"234.4","context":"Sample.Periodic"},{"measurand":"Energy.Active.Import.Register","unit":"Wh","value":"1100.0","context":"Sample.Periodic"},{"measurand":"Power.Active.Import","unit":"W","value":"0","context":"Sample.Periodic"}]}],"transactionId":1}]

The problem is here https://github.com/evcc-io/evcc/blob/c04f52f8518e0ef8e5edf8bbaa8fc518da68c706/charger/ocpp/connector_core.go#L56-L57 is assuming this is a live working transaction.

The only way to remove this transactionid from the wallbox is to turn it on and off again, then you get the MeterValues without it.

I can get more reliable operation by simply turning off meter values for the box, but I'm thinking this hijacking should only occur if evcc thinks the charger is enabled and if the import W value is > 0

At least then if evcc get's it wrong you can stop and start in evcc and it will work. Once the transaction id is set internally the only way to get charging working again is to power cycle the wallbox and restart evcc at the same time.

andig avatar Jul 02 '24 18:07 andig