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

Feature/376 ocpp 201 california pricing requirements tariff and cost #707

Conversation

maaikez
Copy link
Contributor

@maaikez maaikez commented Jul 23, 2024

Describe your changes

Implement california pricing for 1.6.

Issue ticket number and link

#376

Checklist before requesting a review

maaikez added 15 commits July 8, 2024 18:29
…allbacks in 'common' so they can be used for both 1.6 and 2.01.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…onfig schemas.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…or CostAndPrice and multi language.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…get / set functions for configurations.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
… transition date / time.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…irements-tariff-and-cost

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
@maaikez maaikez linked an issue Jul 23, 2024 that may be closed by this pull request
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…iguration items in user config.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
… multiple statusses).

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Copy link
Contributor

@Pietfried Pietfried left a comment

Choose a reason for hiding this comment

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

See in line comments.

The handle_set_user_price and handle_set_session_cost became quite large and I think there is some room to restructure them and improve the readibility (some in line comments already address this)

config/v16/profile_schemas/CostAndPrice.json Outdated Show resolved Hide resolved
config/v16/profile_schemas/CostAndPrice.json Show resolved Hide resolved
include/ocpp/common/types.hpp Outdated Show resolved Hide resolved
include/ocpp/common/utils.hpp Show resolved Hide resolved
include/ocpp/v16/charge_point.hpp Outdated Show resolved Hide resolved
lib/ocpp/v16/charge_point_impl.cpp Outdated Show resolved Hide resolved
lib/ocpp/v16/charge_point_impl.cpp Outdated Show resolved Hide resolved
lib/ocpp/v16/charge_point_impl.cpp Show resolved Hide resolved

json data;
try {
data = json(msg.value());
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of operating on the raw json I think you could also define a SetUserPrice type like you have done it for RunningCost

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 'SetUserPrice' translates into display messages here. Because it is in the end a message that should be displayed for a specific transaction. So do you suggest a new type instead of DisplayMessage or a conversion function with the json as input and a vector of display messages as output?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean the EVerest DisplayMessage type? This should not be of interest in libocpp. My idea was to define a struct thats initialized by parsing the json instead of operating on the raw json

lib/ocpp/v16/charge_point_impl.cpp Outdated Show resolved Hide resolved
…x some issues. When session id is not found, return rejected and not send pricing messages.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
@maaikez maaikez marked this pull request as ready for review August 5, 2024 15:37
Copy link
Contributor

@Pietfried Pietfried left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@@ -57,6 +57,48 @@
"ISO15118PnCEnabled": true,
"ContractValidationOffline": true
},
"CostAndPrice": {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
Our examples configs are pretty minimal so far, so I would suggest to set CustomDisplayCostAndPrice to false and remove all other keys.

I opened an issue to also provide a fully featured config as part of v16: #736

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok! i also changed config.json.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
@Pietfried Pietfried self-assigned this Aug 12, 2024
@maaikez maaikez merged commit 4a2f7a5 into main Aug 13, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCPP 2.0.1 California Pricing Requirements: Tariff and Cost
2 participants