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

💄 ⚡Add grid integration using node-red #91

Merged
merged 10 commits into from
Nov 18, 2024

Conversation

shankari
Copy link
Collaborator

Screenshot 2024-11-17 at 7 44 37 PM

shankari and others added 10 commits November 16, 2024 10:38
…nges

✨ 🩹⏱️ Migrate departure time patches to the main repo
Update the node-red UI to allow the user to specify start and
end time and max current, and then send that to the station
through the CSMS.

High level flow:
- Created UI for start/end time and max current
- When changed, store them in the context
- Use injection to initialize them to standard values
- When button clicked, read values from the context, assemble
  into message and send it off

Testing done:
- Value was originally set to 10

```
2024-11-17 06:47:01.046160 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"C21CF353E7BDD35F"},"Body":{"ChargingStatusRes":{"ResponseCode":"OK","EVSEID":"DE*PNX*00001","SAScheduleTupleID":1,"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":100},"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false}}}}}
```

- Profile was received

```
2024-11-17 06:47:01.604088 [ERRO] ocpp:OCPP201    void ocpp::v201::ChargePoint::handle_set_charging_profile_req(ocpp::Call<ocpp::v201::SetChargingProfileRequest>) :: Received SetChargingProfileRequest: {
    "chargingProfile": {
        "chargingProfileKind": "Absolute",
        "chargingProfilePurpose": "ChargingStationMaxProfile",
        "chargingSchedule": [
            {
                "chargingRateUnit": "A",
                "chargingSchedulePeriod": [
                    {
                        "limit": 20.0,
                        "numberPhases": 3,
                        "startPeriod": 0
                    }
                ],
                "duration": 3564,
                "id": 0,
                "minChargingRate": 0.0,
                "startSchedule": "2024-11-17T06:03:36.694Z"
            }
        ],
        "id": 2000,
        "stackLevel": 0
    },
    "evseId": 0
}
with messageId: 4ce9af96-74a2-495d-8d46-1da729625cfc
2024-11-17 06:47:01.608717 [ERRO] ocpp:OCPP201    void ocpp::v201::ChargePoint::handle_set_charging_profile_req(ocpp::Call<ocpp::v201::SetChargingProfileRequest>) :: Accepting SetChargingProfileRequest
```

- charge status messages now used the new value

```
2024-11-17 06:47:01.677162 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"C21CF353E7BDD35F"},"Body":{"ChargingStatusRes":{"ResponseCode":"OK","EVSEID":"DE*PNX*00001","SAScheduleTupleID":1,"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":100},"MeterInfo":{"MeterID":"YETI_POWERMETER","MeterReading":4984},"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false}}}}}

2024-11-17 06:47:02.369101 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"C21CF353E7BDD35F"},"Body":{"ChargingStatusRes":{"ResponseCode":"OK","EVSEID":"DE*PNX*00001","SAScheduleTupleID":1,"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":100},"MeterInfo":{"MeterID":"YETI_POWERMETER","MeterReading":4986},"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false}}}}}

2024-11-17 06:47:03.010898 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"C21CF353E7BDD35F"},"Body":{"ChargingStatusRes":{"ResponseCode":"OK","EVSEID":"DE*PNX*00001","SAScheduleTupleID":1,"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":100},"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false}}}}}

2024-11-17 06:47:03.664962 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"C21CF353E7BDD35F"},"Body":{"ChargingStatusRes":{"ResponseCode":"OK","EVSEID":"DE*PNX*00001","SAScheduleTupleID":1,"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":200},"MeterInfo":{"MeterID":"YETI_POWERMETER","MeterReading":4988},"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false}}}}}
```

Signed-off-by: Shankari <[email protected]>
- Login to MIDAS with username and password
- Get token
- Use token to retrive all rates
- Display the retrieved rates in a table

Related: EVerest#79 (comment)

Testing done:
- Ran flow and confirmed that the table showed data

Signed-off-by: Shankari <[email protected]>
- Move the table down so we can actually see it
- Add a chart to display the TOU

We may or may not want to keep all these elements,
but at least we know how to generate them now

Signed-off-by: Shankari <[email protected]>
There are still some hardcoded things, and the scale is way
off, but let's check this in so we don't lose the template.

Testing done:

```
2024-11-17 22:32:51.269355 [INFO] ocpp:OCPP201     :: Received SetChargingProfileRequest: {
    "chargingProfile": {
        "chargingProfileKind": "Recurring",
        "chargingProfilePurpose": "TxDefaultProfile",
        "chargingSchedule": [
            {
                "chargingRateUnit": "A",
                "chargingSchedulePeriod": [
                    {
                        "limit": 0.2150000035762787,
                        "numberPhases": 3,
                        "startPeriod": 0
                    },
                    {
                        "limit": 0.10199999809265137,
                        "numberPhases": 3,
                        "startPeriod": 3600
                    },
                    {
                        "limit": 0.10300000011920929,
                        "numberPhases": 3,
                        "startPeriod": 7200
                    },
                    {
                        "limit": 0.10400000214576721,
                        "numberPhases": 3,
                        "startPeriod": 10800
                    },
                    {
                        "limit": 0.10499999672174454,
                        "numberPhases": 3,
                        "startPeriod": 14400
                    },
                    {
                        "limit": 0.10599999874830246,
                        "numberPhases": 3,
                        "startPeriod": 18000
                    },
                    {
                        "limit": 0.10700000077486038,
                        "numberPhases": 3,
                        "startPeriod": 21600
                    },
                    {
                        "limit": 0.1080000028014183,
                        "numberPhases": 3,
                        "startPeriod": 25200
                    },
                    {
                        "limit": 0.10899999737739563,
                        "numberPhases": 3,
                        "startPeriod": 28800
                    },
                    {
                        "limit": 0.10999999940395355,
                        "numberPhases": 3,
                        "startPeriod": 32400
                    },
                    {
                        "limit": 0.11100000143051147,
                        "numberPhases": 3,
                        "startPeriod": 36000
                    },
                    {
                        "limit": 0.1120000034570694,
                        "numberPhases": 3,
                        "startPeriod": 39600
                    },
                    {
                        "limit": 0.11299999803304672,
                        "numberPhases": 3,
                        "startPeriod": 43200
                    },
                    {
                        "limit": 0.11400000005960464,
                        "numberPhases": 3,
                        "startPeriod": 46800
                    },
                    {
                        "limit": 0.11500000208616257,
                        "numberPhases": 3,
                        "startPeriod": 50400
                    },
                    {
                        "limit": 0.11599999666213989,
                        "numberPhases": 3,
                        "startPeriod": 54000
                    },
                    {
                        "limit": 0.11699999868869781,
                        "numberPhases": 3,
                        "startPeriod": 57600
                    },
                    {
                        "limit": 0.11800000071525574,
                        "numberPhases": 3,
                        "startPeriod": 61200
                    },
                    {
                        "limit": 0.11900000274181366,
                        "numberPhases": 3,
                        "startPeriod": 64800
                    },
                    {
                        "limit": 0.11999999731779099,
                        "numberPhases": 3,
                        "startPeriod": 68400
                    },
                    {
                        "limit": 0.12099999934434891,
                        "numberPhases": 3,
                        "startPeriod": 72000
                    },
                    {
                        "limit": 0.12200000137090683,
                        "numberPhases": 3,
                        "startPeriod": 75600
                    },
                    {
                        "limit": 0.12300000339746475,
                        "numberPhases": 3,
                        "startPeriod": 79200
                    },
                    {
                        "limit": 0.12399999797344208,
                        "numberPhases": 3,
                        "startPeriod": 82800
                    }
                ],
                "duration": 86400,
                "id": 0,
                "minChargingRate": 0.0,
                "startSchedule": "2022-01-01T00:00:00.000Z"
            }
        ],
        "id": 100,
        "recurrencyKind": "Daily",
        "stackLevel": 0
    },
    "evseId": 0
}

2024-11-17 22:32:51.288371 [INFO] ocpp:OCPP201     :: About to publish composite charging schedules:
2024-11-17 22:32:51.288458 [INFO] ocpp:OCPP201     :: {
    "chargingRateUnit": "A",
    "chargingSchedulePeriod": [
        {
            "limit": 0.12300000339746475,
            "numberPhases": 3,
            "startPeriod": 0
        }
    ],
    "duration": 600,
    "evseId": 0,
    "scheduleStart": "2024-11-17T22:32:51.000Z"
}
2024-11-17 22:32:51.288612 [INFO] ocpp:OCPP201     :: {
    "chargingRateUnit": "A",
    "chargingSchedulePeriod": [
        {
            "limit": 0.12300000339746475,
            "numberPhases": 3,
            "startPeriod": 0
        }
    ],
    "duration": 600,
    "evseId": 1,
    "scheduleStart": "2024-11-17T22:32:51.000Z"
}
```

Signed-off-by: Shankari <[email protected]>
Changes:
- We now create "pseudo-real" aka believable schedules from
  the MIDAS tariff data by applying the rate of change, and
  flipping it, to support curtailment.
- We display the configured and maximum current limits as
  timeseries

Testing done:
- Validated that the charging profiles are sent to the
  station
- Validated that the currents are shown properly
- Plugged in a car and validated that it charges properly

TODO: Why is the "configured current limit" chart only
displayed for an hour instead of the specified 3 hours?

```
+        "removeOlder": "3",
+        "removeOlderPoints": "",
+        "removeOlderUnit": "3600",
+        "cutout": 0,
```

Signed-off-by: Shankari <[email protected]>
Before this, the maeve MQTT server was exposed as localhost
1883. The EVerest MQTT server was not exposed. This made it
hard for us to use MQTT Explorer to view and experiment with EVerest MQTT messages.

Exposing it at a different port (CSCS, 2727), and remapping
the Maeve port to be CSMS (2767) to leave localhost:1883 open
for any other MQTT servers that people may be running.

Signed-off-by: Shankari <[email protected]>
Now that we have made all the changes to the checked-in flow,
we don't need to copy it over any more. Hopefully, this will
also encourage us to commit code to main more often and not
work for too long off branches on forks.

Testing done: None, but it is a pretty obvious change

Signed-off-by: Shankari <[email protected]>
@shankari shankari merged commit 8a74df7 into EVerest:main Nov 18, 2024
6 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.

Integrate with an ISO to receive grid signals
1 participant