thoughtworks / maeve-csms

MaEVe is an experimental EV Charge Station Management System (CSMS)
Apache License 2.0
86 stars 22 forks source link

Implemented Set Charging Profile API #44

Open louisg1337 opened 5 months ago

louisg1337 commented 5 months ago

Context

Hello! I am on a team that is working on setting up software simulated demos for the charging software EVerest. These demos showcase how EVerest interacts with different CSMSs, especially using the latest protocols. One of the CSMSs that we really enjoy using is MaEVe, but we noticed that there wasn't any support for setting charging profiles just yet. This was one feature that we wanted to use to demonstrate EVerest's capabilities at the CharIn Testival, which just passed a few days ago, so we decided to implement it ourselves.

Implementation

For our use case, all we wanted was an API endpoint that, when called, would send a charging profile to EVerest. We made the API call accessible via POST /cs/{csId}/setchargingprofile, and the ChargingProfileType object would be provided in the body of the call.

Testing Done

To test this new feature out, I used one of the software simulations demos that was setup to showcase EVerest during CharIn, which can be found here. These demos are meant to be plug and play as long as you have Docker and docker-compose installed. I'll walk through the steps here on how to run the demos and observe the setChargingProfile API request working.

  1. Clone repo and check out branch.
    git clone https://github.com/US-JOET/everest-demo.git
    git checkout -b test-demo origin/charin-e2e-demo  
  2. Run the software simulation demo.
    bash demo-iso15118-2-ac-plus-ocpp.sh -r $(pwd) -b test-demo -3   
  3. Sit back and wait until the EVerest software boots up and you see the following (may take a few minutes).
    2024-06-18 18:23:22.836788 [INFO] ocpp:OCPP201     :: Received BootNotificationResponse: {
        "currentTime": "2024-06-18T18:23:22.000Z",
        "interval": 300,
        "status": "Accepted"
    }
  4. In a different terminal, navigate back to the everest-demo repo and run this script to call the new setChargingProfile API.
    bash demo-scripts/maeve-set-charging-profile.sh cp001 TXProfile_1.json    
  5. Go back to the terminal with the EVerest software running and observe EVerest receiving the charging profile and accepting it.

    2024-06-14 04:30:42.750178 [ERRO] ocpp:OCPP201    void 
    ocpp::v201::ChargePoint::handle_set_charging_profile_req(ocpp::Call) :: Received profile validity: Validsetting response to {
        "status": "Accepted"
    }
    

    We would love to integrate these changes into maeve-csms for future use and availability for anyone else whom may need it. Please let me know any changes that may need to be made to integrate this, thank you!