OCPP-Proxy verhindert RFID-Übermittlung an EVCC / forwarder.go
Describe the bug
Wie in Discussions #35093 beschrieben, habe ich bei Anbindung eines Abrechnungsbackends (hier: ladecloud.io) über EVCC nicht mehr die Möglichkeit die aktuelle RFID meiner über OCPP angeschlossenen Alfen Pro Wallbox anzuzeigen. Damit klappt leider die automatische Zuordnung von Fahrzeugprofilen nicht mehr.
Notiz: Wichtig ist, dass natürlich alles zum Thema Abrechnung so bleibt wie es ist, es geht nur darum, dass EVCC auf die Kommunikation "hört" und die RFID ausliest. EVCC soll keine Freigaben an die Wallbox senden: Das soll Aufgabe des Backends bleiben.
Aufgrund des Bypasses sind die entsprechenden Botschaften auch nicht im OCPP-Log von EVCC enthalten, sondern nur im Wallbox-Log (siehe unten).
// actionsRelayedToUpstream lists actions for which upstream is the authoritative // Central System: evcc's handler is bypassed and upstream's reply relayed back. var actionsRelayedToUpstream = map[string]bool{ "Authorize": true, "StartTransaction": true, "StopTransaction": true, "DataTransfer": true, }
PS: Da die obige Zeile noch im letzten Nighly enthalten ist, habe ich auf einen expliziten Test verzichtet.
Steps to reproduce
Dauerhaft reproduzierbar bei meiner Konfiguration:
- Wallbox über OCPP anbinden
- Ladevorgang starten --> RFID ist in EVCC verfügbar
- Backend über OCPP-Proxy anbinden
- Ladevorgang starten --> RFID wird weggefiltert und nicht in EVCC angezeigt
Configuration details
"charger": [
(...)
{"id":15,"name":"db:15","type":"template","config":{"template":"ocpp-alfen","chargingprofile":"TxDefaultProfile","connector":"1","connecttimeout":"5m","meterinterval":"10s","remotestart":false,"stationid":"***"},"deviceProduct":"Alfen Eve (OCPP)"}
],
(...)
"loadpoints": [
(...)
{"id":16,"name":"db:16","alwaysCharge":"off","batteryBoostLimit":100,"charger":"db:15","defaultMode":"smart","limitEnergy":0,"limitSoc":0,"maxCurrent":16,"minCurrent":6,"minSoc":0,"phasesConfigured":3,"planEnergy":0,"planPrecondition":0,"planStrategy":{"continuous":false,"precondition":0},"planTime":"0001-01-01T00:00:00Z","priority":0,"smartCostLimit":null,"smartFeedInPriorityLimit":null,"soc":{"estimate":true,"poll":{"interval":3600000000000,"mode":"charging"}},"solarShare":1,"thresholds":{"disable":{"delay":180000000000,"threshold":0},"enable":{"delay":60000000000,"threshold":0}},"title":"Alf","ui":{"maxTemp":100,"minTemp":0}}
],
(...)
"ocpp": {"config":{"port":8887},"status":{"stations":[{"id":"Alfen_01","status":"configured"}]}},
"ocppforwarder": {"config":[{"caCert":"***","password":"***","stationId":"Alfen_01","upstreamStationId":"***1","upstreamUrl":"wss://ocpp.chargeiq.de","username":"***"}],"status":[{"chargerId":"Alfen_01","upstreamConnected":true,"upstreamUrl":"wss://ocpp.chargeiq.de"}]},
Log details
----> Verhalten nach Reboot der Station, Anstecken eines EV und Autorisierung mit RFID
[ocpp ] TRACE 2026/10/20 19:36:57 send Alfen_01: [3,"31",{}]
[ocpp-forwarder] DEBUG 2026/10/20 19:36:57 forwarder: upstream disconnected for Alfen_01: failed to get reader: use of closed network connection
[ocpp-forwarder] DEBUG 2026/10/20 19:36:57 forwarder: Alfen_01 upstream connection closed
[ocpp-forwarder] DEBUG 2026/10/20 19:36:57 forwarder: notifyUpdated sessions=1
[ocpp-forwarder] DEBUG 2026/10/20 19:36:57 forwarder: notifyUpdated sessions=1
[ocpp ] DEBUG 2026/10/20 19:36:57 charge point disconnected: Alfen_01
[ocpp ] DEBUG 2026/10/20 19:37:15 charge point connected: Alfen_01
[ocpp-forwarder] DEBUG 2026/10/20 19:37:15 forwarder: notifyUpdated sessions=1
[ocpp-forwarder] INFO 2026/10/20 19:37:15 forwarder: Alfen_01 → wss://ocpp.chargeiq.de/?????
[ocpp ] TRACE 2026/10/20 19:37:20 recv Alfen_01: [2,"1","BootNotification",{"chargePointVendor":"Alfen BV","chargePointModel":"NG910-60123","chargePointSerialNumber":"ACE?????","chargeBoxSerialNumber":"Alfen_01","firmwareVersion":"7.4.6-4416"}]
[Alfen_01-1] INFO 2026/10/20 19:37:20 reboot detected (model: NG910-60123, vendor: Alfen BV), re-initializing
(...)
[ocpp ] TRACE 2026/10/20 19:39:47 send Alfen_01: [3,"17",{}]
[ocpp ] TRACE 2026/10/20 19:39:48 recv Alfen_01: [2,"18","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Preparing"}]
[Alfen_01-1] DEBUG 2026/10/20 19:39:48 waiting for local authentication
[ocpp ] TRACE 2026/10/20 19:39:48 send Alfen_01: [3,"18",{}]
[ocpp ] TRACE 2026/10/20 19:39:54 recv Alfen_01: [2,"21","MeterValues",{"connectorId":1,"transactionId":6,"meterValue":[{"timestamp":"2026-10-20T17:39:50Z","sampledValue":[{"value":"17.964","context":"Transaction.Begin","unit":"kWh"},{"value":"AP;0;3;AIIXS44SLUH2NYNXW7IS7GKHIQLYXQ57HCHFKZKJ;BIHEIWSHAAA2YGZBOYZDCOOWIQFACRC2I4ADGBSJIUAAQABAGEPBYADHU7LWUAIAAEEAB7Y6AAWEMAAAAAAAAABQGQZTOM2CGFATORRWIY4DAAAAAAAAAAALAAAAAFAAAAAA====;MAGTRMRDRLHIOZ6UNWOGPUYR2Y6VK7J3TRU2AXYUWMWZJM7S4LCN33WQJHOQGT3SRZQR276YCVAOK===;","context":"Transaction.Begin","format":"SignedData","measurand":"Energy.Active.Import.Register","unit":"Wh"}]}]}]
[ocpp ] TRACE 2026/10/20 19:39:54 send Alfen_01: [3,"21",{}]
[ocpp ] TRACE 2026/10/20 19:39:55 recv Alfen_01: [2,"22","MeterValues",{"connectorId":1,"transactionId":6,"meterValue":[{"timestamp":"2026-10-20T17:39:53Z","sampledValue":[{"value":"0.000","context":"Sample.Periodic","measurand":"Power.Active.Import","location":"Outlet","unit":"W"},{"value":"17964.000","context":"Sample.Periodic","measurand":"Energy.Active.Import.Register","location":"Outlet","unit":"Wh"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L1"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L2"},{"value":"0.000","context":"Sample.Periodic","measurand":"Current.Import","location":"Outlet","unit":"A","phase":"L3"},{"value":"229.270","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L1-N"},{"value":"224.600","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L2-N"},{"value":"218.890","context":"Sample.Periodic","measurand":"Voltage","location":"Outlet","unit":"V","phase":"L3-N"},{"value":"6.000","context":"Sample.Periodic","measurand":"Current.Offered","location":"Outlet","unit":"A"}]}]}]
[ocpp ] TRACE 2026/10/20 19:39:55 send Alfen_01: [3,"22",{}]
[ocpp ] TRACE 2026/10/20 19:39:55 recv Alfen_01: [2,"23","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"SuspendedEVSE"}]
[ocpp ] TRACE 2026/10/20 19:39:55 send Alfen_01: [3,"23",{}]
Hier noch deutlicher: Ohne Backend
[Alfen_01-1] DEBUG 2026/10/20 22:32:21 waiting for local authentication
[ocpp ] TRACE 2026/10/20 22:32:21 send Alfen_01: [3,"23",{}]
[ocpp ] TRACE 2026/10/20 22:32:21 recv Alfen_01: [2,"24","Authorize",**{"idTag":"04373B1A7F6F80"}**]
[ocpp ] TRACE 2026/10/20 22:32:21 send Alfen_01: [3,"24",{"idTagInfo":{"status":"Accepted"}}]
[ocpp ] TRACE 2026/10/20 22:32:22 send Alfen_01: [2,"1601921598","TriggerMessage",{"requestedMessage":"MeterValues","connectorId":1}]
[ocpp ] TRACE 2026/10/20 22:32:22 recv Alfen_01: [3,"1601921598",{"status":"Accepted"}]
Hier mit Backend:
[ocpp ] TRACE 2026/10/20 22:42:45 send Alfen_01: [3,"82",{}]
[ocpp ] TRACE 2026/10/20 22:42:47 recv Alfen_01: [2,"83","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Available"}]
[ocpp ] TRACE 2026/10/20 22:42:47 send Alfen_01: [3,"83",{}]
[ocpp ] TRACE 2026/10/20 22:42:50 recv Alfen_01: [2,"84","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Preparing"}]
[ocpp ] TRACE 2026/10/20 22:42:50 send Alfen_01: [3,"84",{}]
[ocpp ] TRACE 2026/10/20 22:42:52 recv Alfen_01: [2,"86","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":"Available"}]
[ocpp ] TRACE 2026/10/20 22:42:52 send Alfen_01: [3,"86",{}]
[ocpp ] TRACE 2026/10/20 22:42:57 send Alfen_01: [2,"1219671456","TriggerMessage",{"requestedMessage":"MeterValues","connectorId":1}]
[ocpp ] TRACE 2026/10/20 22:42:57 recv Alfen_01: [3,"1219671456",{"status":"Accepted"}]
Und hier das Log der Wallbox:
2026-10-20T20:42:47.457Z:COM:ocpp_rpc.c:1301:<- [3,"83",{}]
2026-10-20T20:42:48.441Z:INFO:taskMain.c:1454:Socket #1: main state: AVAILABLE, CP: 0.2/0.2, tag: none
2026-10-20T20:42:50.109Z:USER:tag.c:1623:Reader 0 Got NFC tag: 04373B1A7F6F80
2026-10-20T20:42:50.308Z:USER:taskMaster.c:6966:Socket #1: has reliable metervalue
2026-10-20T20:42:50.316Z:INFO:taskMaster.c:1607:0 cables attached
2026-10-20T20:42:50.359Z:INFO:taskMaster.c:4973:Socket #1: state main : NFC_AVAILABLE
2026-10-20T20:42:50.367Z:INFO:taskMaster.c:4995:Socket #1: state led : AUTHORISING
2026-10-20T20:42:50.375Z:COM:ocpp_rpc.c:702:-> [2,"84","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":
2026-10-20T20:42:50.375Z:COM:ocpp_rpc.c:702:"Preparing"}]
2026-10-20T20:42:50.394Z:COM:ocpp_rpc.c:1301:<- [3,"84",{}]
2026-10-20T20:42:50.402Z:COM:ocpp_rpc.c:702:-> [2,"85","Authorize",{"idTag":"04373B1A7F6F80"}]
2026-10-20T20:42:50.449Z:COM:ocpp_rpc.c:1301:<- [3,"85",{"idTagInfo":{"expiryDate":"2026-10-21T08:42:50.544588Z","status":"Ac
2026-10-20T20:42:50.449Z:COM:ocpp_rpc.c:1301:cepted"}}]
2026-10-20T20:42:50.484Z:USER:tag.c:1830:Tag 04373B1A7F6F80 is authorised by server, white list updated
2026-10-20T20:42:50.507Z:USER:tag.c:639:Tag 04373B1A7F6F80 is authorised by server
2026-10-20T20:42:50.609Z:INFO:taskMaster.c:4973:Socket #1: state main : AUTHORISED
2026-10-20T20:42:50.617Z:INFO:taskMaster.c:4995:Socket #1: state led : AUTHORISED
2026-10-20T20:42:51.632Z:INFO:taskMain.c:1454:Socket #1: main state: AUTHORISED, CP: 0.2/0.2, tag: 04373B1A7F6F80
2026-10-20T20:42:52.257Z:USER:tag.c:1623:Reader 0 Got NFC tag: 04373B1A7F6F80
2026-10-20T20:42:52.355Z:USER:tag.c:1118:Socket #1: de-authorise on tagId
2026-10-20T20:42:52.371Z:INFO:taskMain.c:6523:Socket #1: active tag cleared
2026-10-20T20:42:52.406Z:INFO:taskMaster.c:4973:Socket #1: state main : AVAILABLE
2026-10-20T20:42:52.417Z:COM:ocpp_rpc.c:702:-> [2,"86","StatusNotification",{"connectorId":1,"errorCode":"NoError","status":
2026-10-20T20:42:52.417Z:COM:ocpp_rpc.c:702:"Available"}]
2026-10-20T20:42:52.437Z:INFO:taskMain.c:6523:Socket #1: active tag cleared
2026-10-20T20:42:52.445Z:INFO:taskMaster.c:4995:Socket #1: state led : AVAILABLE
2026-10-20T20:42:52.453Z:COM:ocpp_rpc.c:1301:<- [3,"86",{}]
Da scheint ziemlich sicher die Botschaft "85" zu fehlen.
What type of operating system or environment does evcc run on?
Home Assistant app
External automation
- [x] I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.
Nightly build
- [x] I have verified that the issue is reproducible with the latest nightly build
Version
0.317.2
Die Ursache liegt im OCPP-Forwarder und ist dort so umgesetzt: In charger/ocpp/forwarder.go listet actionsRelayedToUpstream die Aktionen Authorize, StartTransaction, StopTransaction und DataTransfer. Für diese Aktionen ruft onChargerMessage den Handler von evcc nicht auf (return relay). Die Nachricht geht nur an das Backend, und dessen Antwort wird zurückgereicht. Dadurch sieht evcc die idTag nicht, und die RFID-basierte Fahrzeugzuordnung bekommt keine Daten.
Das ist also derzeit kein Zufallsfehler, sondern eine Lücke im Design: evcc müsste die idTag aus diesen Nachrichten mitlesen, ohne selbst zu antworten oder die Freigabe zu beeinflussen. Das ist machbar, braucht aber eine Designentscheidung (Seiteneffekte auf Transaktions-ID und Session-Zustand in evcc, da das Backend die Transaktion vergibt). Daher ist es als Bug-Fix nicht trivial und als Feature-Wunsch einzuordnen.
Verwandt: #33939 (RFID-Autorisierung und Fahrzeugerkennung mit OCPP-Backend, geschlossen).
🤖 Generated with Claude Code
Ich habe mir #33939 durchgelesen und aus meiner Sicht würde ein reines "Sniffing" der übermittelten RFID schon ausreichen, um die wesentlichen Features wieder zu gewährleisten.
Da es ja bei abrechnungsrelevanten Themen rund um Freischaltung um sensible Daten geht (Eichrecht), würde ich bei Einbindung eines externen Backends keine Logik wie in #33939 einprogrammieren.
@webalexeu afaiu the problem here is that the backend is not only forwarded to but actually authorative for starting the charging session an doesn't return the id? Sounds like this would need something like:
- When a relayed
StartTransactionreaches the forwarder, also pass the idTag to the connector without replying. - Better still, read the upstream's
StartTransactionConfirmationand copy itstransactionIdintoconn.txnId. Then laterTxProfileand remote-stop calls use the ID the charger actually knows. - On a relayed
StopTransaction, clearidTagandtxnId. Wdyt?
Heute mit Nightly getestet: funktioniert! Danke! Im aktuellen Stable 0.318.2 noch nicht umgesetzt.
Version [v0.319.0-dev.1793499129]