Skip to content

Solves a timing problem when the vehicle is plugged in and the RFID tag has not yet been recognized. - #3229

Merged
benderl merged 5 commits into
openWB:masterfrom
dawys:master
Apr 7, 2026
Merged

benderl merged 5 commits into
openWB:masterfrom
dawys:master

Conversation

@dawys

@dawys dawys commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

More information is available here:

https://forum.openwb.de/viewtopic.php?t=11971

dawys added 2 commits March 22, 2026 10:12
the transaction remains traceable even after the websocket performs a reconnect
… set

check if the chargebox ID is set in the backend and if the rfid tag or the vehicle ID has been detected

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the OCPP flow to avoid starting/sending OCPP data too early (e.g., when a vehicle is plugged in but the RFID/vehicle ID is not yet available), and ensures MeterValues are associated with the active OCPP transaction.

Changes:

  • Pass transaction_id into OCPP MeterValues calls (transfer_values) so meter data is tied to the correct transaction.
  • Gate StartTransaction so it is only triggered once a chargebox ID and an RFID/vehicle ID are present (to address the timing issue described in the PR title).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/control/optional.py Updates OCPP meter value transfer call to include ocpp_transaction_id.
packages/control/ocpp.py Extends transfer_values to include and forward transaction_id into call.MeterValues.
packages/control/chargepoint/chargepoint.py Changes when start_transaction() is invoked, requiring chargebox ID and RFID/vehicle ID.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dawys

dawys commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

copilot suggestions gepushed

@benderl
benderl requested a review from LKuemmel April 1, 2026 06:12
@benderl benderl added the bug Something isn't working label Apr 1, 2026

@LKuemmel LKuemmel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte noch die Flake8 Meldung beseitigen, der Rest passt so.

@dawys

dawys commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

Danke, erledigt

@benderl
benderl merged commit ce0aaa4 into openWB:master Apr 7, 2026
1 check passed
@WinnyPuhTS

WinnyPuhTS commented May 6, 2026 •

Copy link
Copy Markdown

Haben wir jetzt noch eine Möglichkeit, OCPP-Transaktionen zu starten, wenn keine Identifikation möglich ist (kein RFID-Reader und kein Plug-and-Charge)?

Wir nutzen ein Selbstgebautes OCPP Backend für die Abrechnung von Wallboxen(openWB) der Mitarbeiter. Es ist kein Identifikationsmodul verbaut, heißt für mich aktuell: "Update auf die 2.2.0 darf nicht erfolgen"

@benderl

benderl commented May 6, 2026

Copy link
Copy Markdown
Contributor

Wie wurden denn bis jetzt die Fahrzeuge in eurem Backend identifiziert?

@WinnyPuhTS

Copy link
Copy Markdown

Bei den Mitarbeitern, die nur einen Elektro‑Dienstwagen besitzen, habe ich lediglich über die gelieferte Chargebox‑ID unterschieden. In den Fällen, in denen auch private Fahrzeuge an der Wallbox geladen werden, ist die Nutzung eines Tags erforderlich gewesen. Im Backend gibt es dann eine Whitelist von „erstattungsfähigen Tags“.

Dass jetzt ohne Tag keine OCPP‑Transaktion mehr gestartet wird und dies auch nirgends beschrieben ist, halte ich für sehr ungünstig. Wenn das nun als korrekt angesehen wird, sollten die OCPP‑Optionen in der GUI meiner Meinung nach ausgeblendet bzw. deaktiviert werden, wenn die openWB über kein Identifikationsmodul verfügt. Das wirkt sonst sehr „gebastelt“.

Mein Workaround für meine eigene Wallbox ist sehr unkonventionell: Ich frage den Plug‑State per MQTT als Trigger ab und setze ebenfalls per MQTT den Token. Nicht schön, aber so funktioniert es auch mit der Version 2.2.0.

@benderl

benderl commented May 11, 2026

Copy link
Copy Markdown
Contributor

Laut OCPP Spezifikation muss eine Ladestation immer ein Token/Tag an das Backend senden. Das Protokoll erfordert dies. Wir sollten die Abhängigkeit von OCPP und Identifikation vermutlich klarer dokumentieren.

ndrsnhs pushed a commit to ndrsnhs/core that referenced this pull request Aug 24, 2026
Solves a timing problem when the vehicle is plugged in and the RFID tag has not yet been recognized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants