GithubHelp home page GithubHelp logo

oicp's Introduction

Open InterCharge Protocol (OICP)

Here you can find all documents and information about the open source OICP .

The OICP protocol, created in 2012, now connects more than 1000 companies in 52 countries in order to make EV charging easy and seamless for everyone.

Releases

Dear users and contributors,

We will be retiring the OICP version 2.1 on 13. April 2023. This decision will allow us to focus on improving and supporting the latest version. Please refer to our documentation for instructions on how to migrate, and we appreciate your continued support.

Thank you, Hubject Team

License

CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

Information regarding the Hubject implementation of the OICP

Hubject Acceptable Use Policy v1-0

oicp's People

Contributors

catoth avatar cluettig avatar dvs01berlin avatar firashubject avatar flauschzelle avatar forki avatar hansbischoff93 avatar hubjectmaster avatar marvinschramm avatar mhassan-hubject avatar moghaffari avatar namoshek avatar oicp-moderator avatar remuslazar avatar tonimarinova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oicp's Issues

Wrong Field name in API v2.3 docs for eRoamingDynamicPricing `OperatorPricingProducts` field

Hello,

In the documentation for eRoamingDynamicPricing here and the live API docs here The response for this endpoint in mentioned in the doc must have a root field names OperatorPricingProducts but I found that in the real object which Hubject returns in response the name of this field is PricingProductData !

The Problem:

  • The field name mentioned in API docs for eRoamingDynamicPricing endpoint response for OperatorPricingProducts is wrong!
  • The object returns from the endpoint the field name is : PricingProductData

Sample response from Hubject QA

image

API Docs

image

Roadmap?

Hi there

I'm interested in your roadmap.

When will you stop supporting OICP 2.2?

Are there plans for OICP 2.4?

@moghaffari

Property "unstructuredOpeningTime" in EVSEDataRecord

The EVSEDataRecord seems to have a property "unstructuredOpeningTime" in the Swagger definition https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#OpeningTimesType
, but this in not defined in the normal documentation https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#OpeningTimesType

{
    "Period": [
        {
            "begin": "string",
            "end":   "string"
        }
    ],
    "on":                      "enum",
    "unstructuredOpeningTime": "string"
}

GeoCoordinatesDegreeMinuteSecondsFormatType

In the 3.7 GeoCoordinatesDegreeMinuteSecondsFormatType paragraph of the documentation, there is a difference between the regular expression and the examples. It is the difference between a simple quote ' and an apostrophe โ€˜ .

Evse(Data|Status)Record in OperatorEvseStatusType vs OperatorEvseDataType

The Evse(Data|Status)Record is mandatory within OperatorEvseDataType ( https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#OperatorEvseDataType ) and OperatorEvseStatusType ( https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#118-operatorevsestatustype ), but the size of those array can be zero.

That is not really usefull for anyone. Both should require an array of at least one Evse(Data|Status)Record.

.

Checkdigit in ISO-format EvcoID is optional.

https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20EMP/03_EMP_Data_Types.asciidoc#31-evcoidtype

Current regex:
([A-Za-z]{2}-?[A-Za-z0-9]{3}-?C[A-Za-z0-9]{8}-?[\d|A-Za-z])
Proper regex:
([A-Za-z]{2}-?[A-Za-z0-9]{3}-?C[A-Za-z0-9]{8}-?[\d|A-Za-z]?)

The regex in this section is incorrect, as it does not allow omittance of the optional check digit in an ISO-formatted EvcoID.

Official emi3 standard: https://emi3group.com/wp-content/uploads/sites/5/2018/12/eMI3-standard-v1.0-Part-2.pdf
(image)

Time Zones: UTC offset vs. named time zones

Currently, the time zone of an EVSE can be given in the address object in form of a UTC offset, e.g. UTC+02:00. Especially in Central Europe, where most countries are using a different UTC offset for summer time, this comes with the drawback that published data becomes inaccurate the moment we change our clocks.

I therefore suggest switching to named time zones as they can be found in the list of tz database time zones which is published by IANA.

Such an API change could in theory be (mostly) backwards and forwards compatible, since for most countries there is only one timezone and a simple mapping from country to time zone and vice versa is already sufficient.

eRoamingAuthorizeStart Message Properties

With the eRoamingAuthorizeStart message I found the following issues:

  1. The given SessionID of the AuthorizeStart request is ignored on the portal. A SessionID is generated within the portal, but the SessionID within the response is empty (at least when there is not valid contract).
  2. Why is there an EMPPartnerSessionID property within the request?
  3. The PartnerProductID property within the request is not shown within the portal.

https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/02_CPO_Services_and_Operations.asciidoc#eRoamingAuthorizeStartmessage

I managed to run a little test on QA. When I send as CPO:

{
  "OperatorID": "DE*XXX",
  "Identification": {
    "RFIDMifareFamilyIdentification": "11223344"
  },
  "EvseID": "DE*XXX*E*TEST*1",
  "PartnerProductID": "ATOMSTROM",
  "SessionID": "c60beed2-e2c5-46dd-b7de-d8183902c90e",
  "CPOPartnerSessionID": "81660034-a500-4988-a92a-3539d6758acd",
  "EMPPartnerSessionID": "75752da2-a79c-480b-ac73-c50f598eb885"
}

I will receive as EMP the following:

{
	"SessionID": "597cc8c8-d493-42b0-9680-28c6f0e270af",
	"CPOPartnerSessionID": "81660034-a500-4988-a92a-3539d6758acd",
	"EMPPartnerSessionID": "75752da2-a79c-480b-ac73-c50f598eb885",
	"OperatorID": "DE*XXX",
	"EvseID": "DE*XXX*E*TEST*1",
	"Identification": {
		"RFIDMifareFamilyIdentification": {
			"UID": "11223344"
		}
	},
	"PartnerProductID": "ATOMSTROM"
}

So you let the CPO set the EMPPartnerSessionID, which is a bit confusing, but you overwrite the normal SessionID.

As the SessionID and the EMPPartnerSessionID are "reserved property keys" within this process, I would suggest to return an error (Bad request) when those properties are sent by a CPO.

AuthenticationModeType vs. PaymentOptionType

I still do not see in which way AuthenticationModeType and PaymentOptionType are well defined. More or less they are the same concept and duplication of concepts can lead to confused EMPs that then refuse to pay a CPO... as we all know.

  • PaymentOptionType.No Payment is more or less AuthenticationModeType.No Authentication Required
  • PaymentOptionType.Direct Payment is more or less AuthenticationModeType.Direct
  • PaymentOptionType.Contract has many AuthenticationModeTypes

When PaymentOptionType.No Payment can not be combined with any other payment option, then the same should be true for AuthenticationModeType.No Authentication Required, or? But when you feel the need to write this note it is a clear indication, that your data model has a flaw. If an EV driver has something to pay and in which way he/she can authenticate is part of the CPO-EMP-business relation and thus can not be part of the EVSEData as this data is shared with all EMPs in the same way.

And you should explicitly forbit any EMP to make financial decisions based on EVSEData. For this there are pricing data structures or B2B contracts.

Therefore: Please remove PaymetOptionType, rename AuthenticationModeType to SupportedPaymentMethods (or similar) and extend this which more details about payment methods, e.g. explicit SMS, MasterCard, VISA Card, EC Card, Cash, BitCoins, Sanifair Coupons...

Is XML still supported in OICP 2.3 ?

Good afternoon,

We're currently updating our OICP stack, and we are still currently supporting SOAP xml payloads (we have operators using them over OICP 2.2). In your documentation (https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20EMP/01_EMP_Communication_Paradigms.asciidoc#rest) you state that all queries should be done using REST.
Since we're trying to follow the specifications as closely as we can, the question is simple: does the hubject REST API support XML payloads, or is this an old format that you no longer use.

Hope I've not bothered you too much, and I wish you an excellent day.

OICP-2.3 eRoamingPullEvseData: "delta pull" / "LastCall" - Documentation Incomplete and Inconsistent

Problem Description:

When trying to implement eRoamingPullEvseData with "delta pull", i.e. with request-body "LastCall" specified, the documentation is only marginally helpful and the information is actually incomplete and inconsistent.

Sources:
Code Snippets
Old / Deprecated Swagger Spec
OICP-2.3 Documentation

Expected Behavior: Regular eRoamPullEvseData Call

A regular eRoamPullEvseData call can be tested with curl as follows:

curl -X POST 'https://service-qa.hubject.com/api/oicp/evsepull/v23/providers/ProviderID/data-records' \
     -H 'Content-Type: application/json' \
     -d \
'{
  "GeoCoordinatesResponseFormat": "Google",
  "IsHubjectCompatible": true,
  "ProviderID": "ProviderID"
}' \
     --cert    ./hubject-client-cert.pem \
     --key     ./hubject-client-key.pem \
     --verbose --insecure

This call succeeds as expected and returns a full EvseDataPull with no issues. Pagination functions as expected and other parameters can be passed.

Unexpected Behavior: eRoamPullEvseData Delta Pull Call

Next, we wish to implement a "delta pull" by adding the LastCall property to our JSON request body (we can generate an ISO-8601 timestamp using e.g. date -Iseconds on MacOS). According to the documentation, we expect the following call to succeed:

curl -X POST 'https://service-qa.hubject.com/api/oicp/evsepull/v23/providers/ProviderID/data-records' \
     -H 'Content-Type: application/json' \
     -d \
'{
  "GeoCoordinatesResponseFormat": "Google",
  "IsHubjectCompatible": true,
  "LastCall": "2021-10-10T10:00:00.000Z",
  "ProviderID": "ProviderID"
}' \
     --cert    ./hubject-client-cert.pem \
     --key     ./hubject-client-key.pem \
     --verbose --insecure

but executing this call will return the following error message:

{"message":"Error parsing/validating JSON. Object errors: ERoamingPullEvseData23: LastCall and other AuthenticationModes, OperatorIDs, CountryCodes, Accessibility, RenewableEnergy, IsHubjectCompatible, IsOpen24Hours, RenewableEnergy, CalibrationLawDataAvailability fields can not be provided"}

This error message states that LastCall is incompatible with a large number of fields. These incompatibilities are NOT described in the OICP-2.3 documentation. In the particular curl above, the property IsHubjectCompatible must be removed in order for the call to succeed.

Additionally, the code-snippets provided are not useful for actual functioning calls and instead only help give a precise definition of data formats.

In effect, the intended implementation is hidden from the API implementer unless they figure out what the error message is trying to say. This is inconsistent with the documentation all across this OICP-2.3 repository.

The provided error message is uninformative because of English grammar. Reading it regularly implies that none of the listed fields (from LastCall to CalibrationLawDataAvailability) are allowed in the call, especially because of no indication in the documentation about what it is actually trying to say (that LastCall is incompatible with more fields than indicated).

What the error message intends to say is:

"Error validating JSON. Object errors: ERoamingPullEvseData23: LastCall can not be provided with fields AuthenticationModes, OperatorIDs, CountryCodes, Accessibility, RenewableEnergy, IsHubjectCompatible, IsOpen24Hours, RenewableEnergy, CalibrationLawDataAvailability - incompatible.

Finally, the old swagger documentation is also incorrect because it states that a large number of fields are required, whereas they are not.

The Correct Call

For anybody reading this issue in the future, here is a functioning test curl delta pull for eRoamingEvseDataPull:

curl -X POST 'https://service-qa.hubject.com/api/oicp/evsepull/v23/providers/ProviderID/data-records' \
     -H 'Content-Type: application/json' \
     -d \
'{
  "GeoCoordinatesResponseFormat": "Google",
  "LastCall": "2021-10-10T10:00:00.000Z",
  "ProviderID": "ProviderID"
}' \
     --cert    ./hubject-client-cert.pem \
     --key     ./hubject-client-key.pem \
     --verbose --insecure

Proposed Fixes

  1. Improve the error message for grammatical unambiguity.
  2. Update your eRoamingEvseDataPull documentation to specify the actual fields which are incompatible with LastCall.
  3. Update your code snippets to include a request body that won't fail by default
  4. Update your swagger docs to have a correct spec

I acknowledge that you have deprecated the swagger documentation - nevertheless this or a correctly defined code snippets doc would be a useful resource for developers trying to implement this.

inconsistency between github documentation and Swagger documentation

Hi
I found some inconsistency in the types:

ProductAvailabilityTimesType

  • Period field:
  1. it is singular but in github documentation but it is plural (Periods) in Swagger documentation.
  2. it is PeriodType type but in Swagger documentation it is a list of Period

OpeningTimesType

  • Period field: it is PeriodType type but in Swagger documentation it is a list of Period

Links to Standarts

It would be nice to add Links to the Standarts mentioned this is partly done, but not for every standart

Missing JSON property "OperatorID" in eRoamingChargingNotifications Error documentation

The example of the eRoamingChargingNotificationError at https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/06_CPO_Code_Snippets.asciidoc#15-eroamingchargingnotificationerror has an OperatorID property, but the documentation at In https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/02_CPO_Services_and_Operations.asciidoc#64-eroamingchargingnotifications-error is missing this information. This will result in the following not very helpful HTTP error message:

HTTP/1.1 500
Server:          nginx/1.18.0 (Ubuntu)
Date:            Sat, 06 Aug 2022 06:33:53 GMT
Content-Type:    application/json;charset=ISO-8859-1
Content-Length:  108
Connection:      close
Process-ID:      90163b8e-3301-4538-a7d9-82d7734879b4

{
  "StatusCode": {
    "Code":            "001",
    "Description":     "Unexpected error checking partners: null",
    "AdditionalInfo":   null
  }
}

Also in all other charging notifications the OperatorID is optional, but here it seems to be mandatory. Was this intended?

Feature Request: Documentation in PDF format

It would be good to have generated PDF of the current OICP Documentation in order exchange it locally within a Product or Development Team.

This would be beneficial for exchanging information's within the Team or also across Teams in one Company, througthComments in the PDF File.

It should be fairly easy to create it based on the ASCIIDoc files and could be possibel to generate automatically on creating a new Release within Github

Restrictions of periods

In Periode time, a regex for start and end is defined [0-9]{2}:[0-9]{2} but not a range 00:00 -> 24:00, even 99:00 or 0:0 would be acceptable values according to the specification.

I would propose to adjust the regex to ^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$.
This would ensure that all Partners have a common understanding of the raging and would prevent the 24:00/00:00 issue that could occure for the 24h format.
It would also enforce the common usage of the 24h format.

GeoCoordinates within EVSEDataRecord mandatory or optional?

GeoCoordinates within EVSEDataRecord seems to be optional within the documentation https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#EvseDataRecordType

GeoCoordinates | GeoCoordinatesType | Geolocation of the charging station. | O | 100

but mandatory within the swagger file https://github.com/hubject/oicp/blob/master/OICP-2.3/SWAGGER%20DOCUMENTATION/evse-api-docs-2.3.json

"EvseDataRecord": {
      "type": "object",
      "required": [
        "Accessibility",
        "Address",
        "AuthenticationModes",
        "ChargingStationNames",
        "DynamicInfoAvailable",
        "EvseID",
        "GeoCoordinates",
        "IsHubjectCompatible",
        "IsOpen24Hours",
        "OperatorID",
        "RenewableEnergy"
      ],

...and within your implementation:

HTTP/1.1 400 
Server: nginx/1.18.0
Date: Fri, 08 Jan 2021 14:19:25 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Process-ID: b87fd67b-2d74-4318-86cf-0d2c2c50cabb

{
	"message": "Error parsing/validating JSON.",
	"validationErrors": [
		{
			"fieldReference": "operatorEvseData.evseDataRecord[0].geoCoordinates",
			"errorMessage": "may not be null"
		}
	]
}

Also it is a bit confusing, that all propery keys start with an upper case character within the normal protocol, but when you send this error message the first character is always lower case, e.g. "GeoCoordinates" vs. "operatorEvseData.evseDataRecord[0].geoCoordinates".

Charging Notifications properties...

I wonder why the identification/authentication data is only optional within the charging notifications.
The most valueable use case for this is informing the end customer about the charging process, or?
Therefore it should be mandatory in my eyes.

Is the OperatorID within a charging notifications the same as a HubOperatorID within a charge detail record?

SessionStart is mandatory for charge detail record since OICP v2.3, but (still) optional within charging notifications. Perhaps it would be useful to make it also mandatory in charging notifications.

The ChargingStart property of the eRoamingChargingNotifications End message is optional, while it is mandatory within all other eRoamingChargingNotifications messages.

For the German Eichrecht we have some energy meters which will always output a signed meter value if the start value was a signed meter value. When we use signed meter values we also have to include ALL signed meter values into the later CDR, otherwise the CDR is not legally valid. Therefore it would be usefull if we could also send signed meter values within charging notifications... we have all the data anyway.

Wrong response types in eRoamingPullEvseStatus_V2.1 (EMP)

Hi,

the eRoamingPullEvseStatus_V2.1 has two different response types, which are currently not reflected in the documentation.

Currently you only find the eRoamingEVSEStatus which is:

{
    "EvseStatuses": {
        "OperatorEvseStatus": [...],
    },
    "StatusCode": { ... },
}

This will be the response for eRoamingPullEvseStatus and eRoamingPullEVSEStatusByOperatorID requests.

But for eRoamingPullEVSEStatusByID requests, the following response will be returned (currently missing in the documentationa):

{
    "EVSEStatusRecords": {
        "EvseStatusRecord": [ ... ],
    },
    "StatusCode": { ... },
}

I have created #118 to fix the issue. Please let me know, if I can help you any further! ๐Ÿ™‚

Unclear reference to "8.1" in the specification for PullEvseDataRecordType

Below the specification for 1.16. PullEvseDataRecordType, the following hint is given:

Best Practices:
For recommendations regarding specific usage of fields, please consider 8.1.

The only section 8.1 that I could find in the whole documentation is a code snippet for a different part of the service that has no obvious connection to the PullEvseDataRecordType.

Where can the Best Practices (that this hint was supposed to refer to) actually be found?

Broken links...

Somehow all links within the documents are broken...

e.g. in 03_CPO_Data_Types.asciidoc there is section "1.16. OperatorEvseDataType" which has a table with a the EvseDataRecordType:
https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#EvseDataRecordType

When you click on it you will not end up at the correct section of the document!


But the correct link rendered within the HTML is:
https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#117-evsedatarecordtype

So, the old link together with the section number.
When you click on it you will end up at the correct section of the document!


This could be related to this very old GitHub bug: github/markup#596

Consistency problems between docs and samples [eRoamingPullEVSEData ]

Hi,
I've found this problems with the provided response.json sample.

"Address": "TimeZone": "UTC+01:00" in docs, "Address": "TimeZone": "string",
"OpeningTimesType": "Periods" in docs, "OpeningTimesType": "Period" in the example
"OpeningTimesType": "On" in docs, "OpeningTimesType":"on" in the example

Correct time zone in EVSE data records regarding day light saving?

In OICP v2.3 there is a mandatory property "timezone" of EVSE data records having a format like "UTC+01:00". But for EVSEs in Germany what is the correct time zone regarding day light saving? Because half a year it is "UTC+01:00" and the other half "UTC+02:00", or?

GetChargeDetailRecords Message OperatorId or List<OperatorId>?

While https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20EMP/02_EMP_Services_and_Operations.asciidoc#eRoamingGetChargeDetailRecordsmessage is talking about a single OperatorId within the request, the swagger file is talking about a list of OperatorIds. Which one is correct? Or do you support both?

{
  "CDRForwarded": false,
  "From": "2021-04-23T02:18:52.478Z",
  "OperatorID": [
    "string"
  ],
  "ProviderID": "string",
  "SessionID": [
    "string"
  ],
  "To": "2021-04-23T02:18:52.478Z"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.