|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$id": "urn:OCMF:1.0.1-DRAFT:OCMF", |
| 4 | + "title": "Open Charge Metering Format (OCMF)", |
| 5 | + "comment": "Based on SAFE-eV/OCMF-Open-Charge-Metering-Format, Datenformat_OCMF_v1.0.1-DRAFT. ", |
| 6 | + "type": "object", |
| 7 | + "additionalProperties": false, |
| 8 | + "properties": { |
| 9 | + "header": { |
| 10 | + "description": "Header identifying the transfer format. Always the literal string 'OCMF'.", |
| 11 | + "type": "string", |
| 12 | + "const": "OCMF" |
| 13 | + }, |
| 14 | + "payload": { |
| 15 | + "$ref": "#/definitions/PayloadType" |
| 16 | + }, |
| 17 | + "signature": { |
| 18 | + "$ref": "#/definitions/SignatureType" |
| 19 | + } |
| 20 | + }, |
| 21 | + "required": [ |
| 22 | + "header", |
| 23 | + "payload", |
| 24 | + "signature" |
| 25 | + ], |
| 26 | + "definitions": { |
| 27 | + "PayloadType": { |
| 28 | + "description": "the signed payload data (section 4.2). Top-level property names starting with U, V, W, X, Y or Z are reserved for vendor-specific extensions.", |
| 29 | + "type": "object", |
| 30 | + "patternProperties": { |
| 31 | + "^[UVWXYZ]": {} |
| 32 | + }, |
| 33 | + "properties": { |
| 34 | + "FV": { |
| 35 | + "description": "Format-Version: version of this data format as <major>.<minor>.", |
| 36 | + "type": "string", |
| 37 | + "examples": [ |
| 38 | + "1.0" |
| 39 | + ] |
| 40 | + }, |
| 41 | + "GI": { |
| 42 | + "description": "Gateway-Identification: identifier of the manufacturer for the signature-generating system (manufacturer, model, variant, etc.).", |
| 43 | + "type": "string" |
| 44 | + }, |
| 45 | + "GS": { |
| 46 | + "description": "Gateway-Serial: serial number of the signature-generating system. Conditionally mandatory - required if the signing component is not otherwise uniquely identified (see section 4.4).", |
| 47 | + "type": "string" |
| 48 | + }, |
| 49 | + "GV": { |
| 50 | + "description": "Gateway-Version: version designation of the manufacturer for the software of the signature-generating system.", |
| 51 | + "type": "string" |
| 52 | + }, |
| 53 | + "PG": { |
| 54 | + "description": "Pagination: reference of the whole record within a stream of readings sharing one signature. Format <context><number>, without leading zeros. Context 'T' (Transaction) is mandatory to support; 'F' (Fiscal) is optional.", |
| 55 | + "type": "string", |
| 56 | + "pattern": "^[FT](0|[1-9][0-9]*)$", |
| 57 | + "examples": [ |
| 58 | + "T12345" |
| 59 | + ] |
| 60 | + }, |
| 61 | + "MV": { |
| 62 | + "description": "Meter-Vendor: manufacturer identification of the meter.", |
| 63 | + "type": "string" |
| 64 | + }, |
| 65 | + "MM": { |
| 66 | + "description": "Meter-Model: model identification of the meter.", |
| 67 | + "type": "string" |
| 68 | + }, |
| 69 | + "MS": { |
| 70 | + "description": "Meter-Serial: serial number of the meter. Mandatory whenever the meter-identification field group (MV/MM/MS/MF) is used.", |
| 71 | + "type": "string" |
| 72 | + }, |
| 73 | + "MF": { |
| 74 | + "description": "Meter-Firmware: firmware version of the meter.", |
| 75 | + "type": "string" |
| 76 | + }, |
| 77 | + "IS": { |
| 78 | + "description": "Identification-Status: whether a user could be assigned to the reading (true) or not (false). Present if, and only if, there is a transaction reference.", |
| 79 | + "type": "boolean" |
| 80 | + }, |
| 81 | + "IL": { |
| 82 | + "description": "Identification-Level: overall status of the user assignment.", |
| 83 | + "type": "string", |
| 84 | + "enum": [ |
| 85 | + "NONE", |
| 86 | + "HEARSAY", |
| 87 | + "TRUSTED", |
| 88 | + "VERIFIED", |
| 89 | + "CERTIFIED", |
| 90 | + "SECURE", |
| 91 | + "MISMATCH", |
| 92 | + "INVALID", |
| 93 | + "OUTDATED", |
| 94 | + "UNKNOWN" |
| 95 | + ] |
| 96 | + }, |
| 97 | + "IF": { |
| 98 | + "description": "Identification-Flags: detail information about the user assignment.", |
| 99 | + "type": "array", |
| 100 | + "maxItems": 4, |
| 101 | + "items": { |
| 102 | + "type": "string", |
| 103 | + "enum": [ |
| 104 | + "RFID_NONE", |
| 105 | + "RFID_PLAIN", |
| 106 | + "RFID_RELATED", |
| 107 | + "RFID_PSK", |
| 108 | + "OCPP_NONE", |
| 109 | + "OCPP_RS", |
| 110 | + "OCPP_AUTH", |
| 111 | + "OCPP_RS_TLS", |
| 112 | + "OCPP_AUTH_TLS", |
| 113 | + "OCPP_CACHE", |
| 114 | + "OCPP_WHITELIST", |
| 115 | + "OCPP_CERTIFIED", |
| 116 | + "ISO15118_NONE", |
| 117 | + "ISO15118_PNC", |
| 118 | + "PLMN_NONE", |
| 119 | + "PLMN_RING", |
| 120 | + "PLMN_SMS" |
| 121 | + ] |
| 122 | + } |
| 123 | + }, |
| 124 | + "IT": { |
| 125 | + "description": "Identification-Type: type of the identification data carried in ID.", |
| 126 | + "type": "string", |
| 127 | + "enum": [ |
| 128 | + "NONE", |
| 129 | + "DENIED", |
| 130 | + "UNDEFINED", |
| 131 | + "ISO14443", |
| 132 | + "ISO15693", |
| 133 | + "EMAID", |
| 134 | + "EVCCID", |
| 135 | + "EVCOID", |
| 136 | + "ISO7812", |
| 137 | + "CARD_TXN_NR", |
| 138 | + "CENTRAL", |
| 139 | + "CENTRAL_1", |
| 140 | + "CENTRAL_2", |
| 141 | + "LOCAL", |
| 142 | + "LOCAL_1", |
| 143 | + "LOCAL_2", |
| 144 | + "PHONE_NUMBER", |
| 145 | + "KEY_CODE" |
| 146 | + ] |
| 147 | + }, |
| 148 | + "ID": { |
| 149 | + "description": "Identification-Data: the actual identification data, formatted according to IT, e.g. a hex-encoded UID per ISO 14443.", |
| 150 | + "type": "string", |
| 151 | + "maxLength": 40 |
| 152 | + }, |
| 153 | + "CT": { |
| 154 | + "description": "Charge-Point-Identification-Type: type of the charge point identification carried in CI.", |
| 155 | + "type": "string", |
| 156 | + "enum": [ |
| 157 | + "EVSEID", |
| 158 | + "CBIDC" |
| 159 | + ] |
| 160 | + }, |
| 161 | + "CI": { |
| 162 | + "description": "Charge-Point-Identification: identification of the charge point, formatted according to CT.", |
| 163 | + "type": "string" |
| 164 | + }, |
| 165 | + "RD": { |
| 166 | + "description": "Readings: one or more meter readings.", |
| 167 | + "type": "array", |
| 168 | + "minItems": 1, |
| 169 | + "items": { |
| 170 | + "$ref": "#/definitions/ReadingType" |
| 171 | + } |
| 172 | + } |
| 173 | + }, |
| 174 | + "required": [ |
| 175 | + "FV", |
| 176 | + "PG", |
| 177 | + "RD" |
| 178 | + ], |
| 179 | + "dependencies": { |
| 180 | + "MV": [ |
| 181 | + "MS" |
| 182 | + ], |
| 183 | + "MM": [ |
| 184 | + "MS" |
| 185 | + ], |
| 186 | + "MF": [ |
| 187 | + "MS" |
| 188 | + ], |
| 189 | + "IS": [ |
| 190 | + "IT" |
| 191 | + ], |
| 192 | + "IT": [ |
| 193 | + "IS" |
| 194 | + ], |
| 195 | + "IL": [ |
| 196 | + "IS", |
| 197 | + "IT" |
| 198 | + ], |
| 199 | + "IF": [ |
| 200 | + "IS", |
| 201 | + "IT" |
| 202 | + ], |
| 203 | + "ID": [ |
| 204 | + "IS", |
| 205 | + "IT" |
| 206 | + ] |
| 207 | + } |
| 208 | + }, |
| 209 | + "ReadingType": { |
| 210 | + "description": "A single reading entry within the RD array (section 4.2.6). Fields with a value identical to the previous reading in the array may be omitted.", |
| 211 | + "type": "object", |
| 212 | + "additionalProperties": false, |
| 213 | + "properties": { |
| 214 | + "TM": { |
| 215 | + "description": "Time: system time of the reading and its synchronization status, ISO 8601 with millisecond resolution followed by a single-letter time-status code.", |
| 216 | + "type": "string", |
| 217 | + "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2},\\d{3}[+-]\\d{4} [UISR]$", |
| 218 | + "examples": [ |
| 219 | + "2018-07-24T13:22:04,000+0200 S" |
| 220 | + ] |
| 221 | + }, |
| 222 | + "TX": { |
| 223 | + "description": "Transaction: reason for the reading in relation to a transaction. B=Begin, C=Charging, X=Exception, E=End, L=Ended locally, R=Ended remotely, A=Aborted, P=Ended by power outage, S=Suspended, T=Tariff change. Absent if there is no transaction reference (Fiscal metering).", |
| 224 | + "type": "string", |
| 225 | + "enum": [ |
| 226 | + "B", |
| 227 | + "C", |
| 228 | + "X", |
| 229 | + "E", |
| 230 | + "L", |
| 231 | + "R", |
| 232 | + "A", |
| 233 | + "P", |
| 234 | + "S", |
| 235 | + "T" |
| 236 | + ] |
| 237 | + }, |
| 238 | + "RV": { |
| 239 | + "description": "Reading-Value: the measured value. May be omitted together with RI, RU and RT if the reading only signals a meter error/event.", |
| 240 | + "type": "number" |
| 241 | + }, |
| 242 | + "RI": { |
| 243 | + "description": "Reading-Identification: designation of the measurand, as an OBIS code (IEC 62056-6-1/-2). Forms a group with RU: both present or both absent.", |
| 244 | + "type": "string" |
| 245 | + }, |
| 246 | + "RU": { |
| 247 | + "description": "Reading-Unit: unit of the reading. Forms a group with RI: both present or both absent.", |
| 248 | + "type": "string", |
| 249 | + "enum": [ |
| 250 | + "kWh", |
| 251 | + "Wh" |
| 252 | + ] |
| 253 | + }, |
| 254 | + "RT": { |
| 255 | + "description": "Reading-Current-Type: type of current measured by the meter.", |
| 256 | + "type": "string", |
| 257 | + "enum": [ |
| 258 | + "AC", |
| 259 | + "DC" |
| 260 | + ] |
| 261 | + }, |
| 262 | + "EF": { |
| 263 | + "description": "Error-Flags: which quantities are no longer usable for billing due to an error. 'E' = Energy, 't' = Time.", |
| 264 | + "type": "string", |
| 265 | + "pattern": "^[Et]*$" |
| 266 | + }, |
| 267 | + "ST": { |
| 268 | + "description": "Status: state of the meter at the time of the reading.", |
| 269 | + "type": "string", |
| 270 | + "enum": [ |
| 271 | + "N", |
| 272 | + "G", |
| 273 | + "T", |
| 274 | + "D", |
| 275 | + "R", |
| 276 | + "M", |
| 277 | + "X", |
| 278 | + "I", |
| 279 | + "O", |
| 280 | + "S", |
| 281 | + "E", |
| 282 | + "F" |
| 283 | + ] |
| 284 | + } |
| 285 | + }, |
| 286 | + "required": [ |
| 287 | + "TM", |
| 288 | + "ST" |
| 289 | + ], |
| 290 | + "dependencies": { |
| 291 | + "RI": [ |
| 292 | + "RU" |
| 293 | + ], |
| 294 | + "RU": [ |
| 295 | + "RI" |
| 296 | + ] |
| 297 | + } |
| 298 | + }, |
| 299 | + "SignatureType": { |
| 300 | + "description": "Signatursektion: the signature over the payload data (section 4.3).", |
| 301 | + "type": "object", |
| 302 | + "patternProperties": { |
| 303 | + "^[UVWXYZABCDEF]": {} |
| 304 | + }, |
| 305 | + "properties": { |
| 306 | + "SA": { |
| 307 | + "description": "Signature-Algorithm: algorithm (including curve and hash) used to create the signature. Defaults to ECDSA-secp256r1-SHA256 if omitted.", |
| 308 | + "type": "string", |
| 309 | + "enum": [ |
| 310 | + "ECDSA-secp192k1-SHA256", |
| 311 | + "ECDSA-secp256k1-SHA256", |
| 312 | + "ECDSA-secp192r1-SHA256", |
| 313 | + "ECDSA-secp256r1-SHA256", |
| 314 | + "ECDSA-brainpool256r1-SHA256", |
| 315 | + "ECDSA-secp384r1-SHA256", |
| 316 | + "ECDSA-brainpool384r1-SHA256" |
| 317 | + ] |
| 318 | + }, |
| 319 | + "SE": { |
| 320 | + "description": "Signature-Encoding: encoding of SD. Defaults to 'hex' if omitted.", |
| 321 | + "type": "string", |
| 322 | + "enum": [ |
| 323 | + "hex", |
| 324 | + "base64" |
| 325 | + ] |
| 326 | + }, |
| 327 | + "SM": { |
| 328 | + "description": "Signature-Mime-Type: how to interpret the signature data. Defaults to 'application/x-der' if omitted.", |
| 329 | + "type": "string", |
| 330 | + "enum": [ |
| 331 | + "application/x-der" |
| 332 | + ] |
| 333 | + }, |
| 334 | + "SD": { |
| 335 | + "description": "Signature-Data: the actual signature data, encoded per SE and formatted per SM.", |
| 336 | + "type": "string" |
| 337 | + } |
| 338 | + }, |
| 339 | + "required": [ |
| 340 | + "SD" |
| 341 | + ] |
| 342 | + } |
| 343 | + } |
| 344 | +} |
0 commit comments