Add new OCPP 2.0.1 request handlers and client-side message functions #746
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces several enhancements to the OCPP 2.0.1 implementation by adding
server-side handlers in
central_system.pyand new client-side request functionsin
charge_point.py. Additionally, a Dockerfile has been added to simplify deploymentand testing.
🚀 New Features Added
✅ Server (Central System)
Implemented new OCPP message handlers:
CancelReservationStatusNotificationSecurityEventNotificationAuthorizeMeterValuesReportChargingProfilesThese handlers return appropriate
call_result.*responses and include basic logging.✅ Charge Point (Client)
Added new asynchronous methods to simulate Charge Point messages:
send_boot_notification()send_heartbeat()send_cancel_reservation()send_status_notification()send_security_event_notification()send_meter_values()send_authorization()These functions generate valid OCPP 2.0.1 requests and send them to the central system.
Also added:
SampledValueandMeterValuedataclassesget_current_time()🐳 Docker Support
Added a
Dockerfileto run the server or charge point in a containerized environment.📌 Motivation
This contribution enhances the OCPP 2.0.1 example implementation, making it easier to:
✔️ Tests
Tested locally by:
🙏 Notes
I am open to feedback and happy to make improvements if requested.