steve icon indicating copy to clipboard operation
steve copied to clipboard

ChargingProfilePurpose missing parameter for TxProfile

Open whichnick opened this issue 5 years ago • 5 comments

In a request from SetChargingProfile.req, when the field is set to chargeProfilePurpose TxProfile, we should have the transactionId parameter. regarding the specification Open Charge Point Protocol 1.6, edition 2 FINAL, 2017-09-28, we can see that this parameter is optional, but we must define it when a transaction is already in progress

[2,"8effebba-c4d6-4b43-96a1-eb16a7be3d9b","SetChargingProfile",{"connectorId":1,"csChargingProfiles":{"chargingProfileId":3,"stackLevel":0,"chargingProfilePurpose":"TxProfile","chargingProfileKind":"Absolute", "chargingSchedule":{"duration":160,"startSchedule":"2020-07-02T12:01:00.000Z","chargingRateUnit":"A","chargingSchedulePeriod":[{"startPeriod":0,"limit":8,"numberPhases":1},{"startPeriod":50,"limit":11,"numberPhases":1},{"startPeriod":140,"limit":16,"numberPhases":1},{"startPeriod":200,"limit":6,"numberPhases":1},{"startPeriod":240,"limit":12,"numberPhases":1}],"minChargingRate":10}}}]

[4, "8effebba-c4d6-4b43-96a1-eb16a7be3d9b", "PropertyConstraintViolation", "Validation failed: Transaction Id is empty for TxProfile", {}]

whichnick avatar Jul 08 '20 15:07 whichnick

sorry, this was indeed a mistake. but the mistake is not that transaction id cannot be set for TxProfile.

TxProfile should not be there at all (in the possible values for selection), because in the current charging profile implementation we do not support setting it for a transaction. since this is a quite specific case, i could not figure out what the process and flow should be. and i had a lot of open questions. therefore, i left it out. maybe we can use this issue to talk about it.

one of the things i was not sure about is the list of sanity checks we might do. is this overengineering:

  • transaction should be at the same connector id as the charging profile definition
  • transaction should be ongoing (no transaction-stop yet)
  • transaction's time period should overlap with transaction (startSchedule does not necessarily have to be before or after transaction-start)

or should steve allow any input and hope that the charging station handles these cases?

additional question is whether we should store this in a database table. current db schema allows to assign a profile to a connector. we probably need another table for profile->transaction mappings. but.. is this too much complexity? maybe we need to define a charging profile in a fire-and-forget fashion, since transactions a short-lived. in this case, current profile management flow is not fitting.

the list goes on and on :)

goekay avatar Jul 09 '20 18:07 goekay

one of the things i was not sure about is the list of sanity checks we might do. is this overengineering:

* transaction should be at the same connector id as the charging profile definition

Maybe we should look at the user perspective. The charging profile purpose defines different use cases (transaction related or not). So it might be better to select this at first. Based on this we can filter for the suitable charge profile IDs. In case of ChargePointMaxProfile and TxDefaultProfile the interface offer the connector ID as an input field (as before). But in case of TxProfile only the ongoing transactions ID as a select field. So Steve could retrieve the connector ID from the transaction data.

* transaction should be ongoing (no transaction-stop yet)

OCPP 1.6 has a hint about this:

It is RECOMMENDED to check the timestamp in the StartTransaction.req PDU prior to sending a charging profile to check if the transaction is likely to be still ongoing. The StartTransaction.req might have been cached during an offline period.

* transaction's time period should overlap with transaction (startSchedule does not necessarily have to be before or after transaction-start)

Personally i would leave out such checks.

or should steve allow any input and hope that the charging station handles these cases?

lategoodbye avatar Jul 12 '20 08:07 lategoodbye

Hi @goekay, I am using Steve as a test Central System to validate our Charge Point software and I need to send a TxProfile. Would it be possible to simply add a transactionId field for charging profiles? As @whichnick pointed out, that field is optional, but required when TxProfile is used. Currently I am unable to test TxProfiles...

gianmarcoodorizzi avatar Dec 30 '21 15:12 gianmarcoodorizzi

@gianmarcoodorizzi Please take a look at the hack above.

lategoodbye avatar Nov 05 '22 16:11 lategoodbye

Thanks for this!

gianmarcoodorizzi avatar Nov 05 '22 17:11 gianmarcoodorizzi