Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding of Meter Values #638

Closed
Pietfried opened this issue May 27, 2024 · 1 comment · Fixed by #646
Closed

Rounding of Meter Values #638

Pietfried opened this issue May 27, 2024 · 1 comment · Fixed by #646
Assignees
Labels

Comments

@Pietfried
Copy link
Contributor

OCPP Version

OCPP1.6

Describe the bug

ocpp's 1.6 start and stop transaction messages transmit the imported energy as integers. The current chargepoint implementation truncates the value from float to int32 in case of start_transaction, but does a rounding in case of stop_transaction. So in case no energy would be transfered with an initial value of 133.7, start_transaction would transfer 133 and stop_transaction would transfer 134.

Related zulip discussion: https://lfenergy.zulipchat.com/#narrow/stream/417676-EVerest.3A-Cloud-communication/topic/ocpp.20start.2Fstop_transaction

To Reproduce

Execute a charging session where no energy in transferred an check start and stop meter value.

Anything else?

A way to solve the issue described above is to add consistent rounding to start and stop meter values (e.g. use std::round for both start and stop meter values) that are transmitted as part of a StartTransaction.req and StopTransaction.req.

We can then make the rounding configurable in a next step.

@Pietfried Pietfried linked a pull request Jun 17, 2024 that will close this issue
4 tasks
@Pietfried
Copy link
Contributor Author

Fixed with #646

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants