SAFE-eV / OCMF-Open-Charge-Metering-Format

24 stars 13 forks source link

OCMF payload without an IF array & vendor extentions within RDs... #31

Open ahzf opened 5 months ago

ahzf commented 5 months ago

Within the documentation of DZG meters https://www.dzg.de/fileadmin/dzg/content/downloads/produkte-zaehler/gsh/DZG_GSH01_product_manual_2022_12_08.pdf there is following example of OCMF v1.0 without an IF property. Also real-life OCMFs seem not to have this property. Nevertheless under https://github.com/SAFE-eV/OCMF-Open-Charge-Metering-Format/blob/master/OCMF-en.md is says "Also one or no element must be noted as an array.", while the cardinality is defined as 0..4. It seems that manufacturers get this wrong as they might not read the entire text, or so.

OCMF|
{
    "FV": "1.0",
    "GI": "DZG-GSH01.1K2L.B",
    "GS": "1DZG0022222222",
    "GV": "231b",
    "PG": "T2",
    "MV": "DZG",
    "MM": "GSH01.1K2L.B",
    "MS": "1DZG0022222222",
    "MF": "231b",
    "IS": true,
    "IT": "ISO14443",
    "ID": "TestUser",
    "CT": "EVSEID",
    "CI": "",
    "RD": [
        {
            "TM": "2022-01-28T15:33:09,000+0100 I",
            "TX": "B",
            "RV": "0.000",
            "RI": "01-00:98.08.00.FF",
            "RU": "kWh",
            "RT": "DC",
            "EF": "",
            "ST": "G"
        },
        {
            "TM": "2022-01-28T15:38:56,000+0100 I",
            "TX": "E",
            "RV": "0.000",
            "RI": "01-00:98.08.00.FF",
            "RU": "kWh",
            "RT": "DC",
            "EF": "",
            "ST": "G"
        }
    ],
    "U": [
        {
            "TM": "2022-01-28T15:33:09,000+0100 I",
            "TX": "B",
            "RV": "0.000",
            "RI": "01-00:9C.08.00.FF",
            "RU": "kWh",
            "RT": "DC",
            "EF": "",
            "ST": "G"
        },
        {
            "TM": "2022-01-28T15:38:56,000+0100 I",
            "TX": "E",
            "RV": "0.000",
            "RI": "01-00:9C.08.00.FF",
            "RU": "kWh",
            "RT": "DC",
            "EF": "",
            "ST": "G"
        },
        {
            "TM": "2022-01-28T15:33:09,000+0100 I",
            "TX": "B",
            "RV": "0.1000",
            "RI": "01-00:8C.07.00.FF",
            "RU": "Ohm",
            "RT": "DC",
            "EF": "",
            "ST": "G"
        },
        {
            "TM": "2022-01-28T15:38:56,000+0100 I",
            "TX": "E",
            "RV": "347",
            "RI": "01-00:00.08.06.FF",
            "RU": "s",
            "RT": "DC",
            "EF": "",
            "ST": "G"
        }
    ]
}|
{
    "SA": "ECDSA-secp256k1-SHA256",
    "SD": "3046022100E90CA19D0006214B8AD91F212A2E3404010B37731A0DD1F3AF97683E38AD770F022100DF5F492B405A0C707CD48203010180B9218D23C9D91292471857F0ED049369AC"
}

Also BAUER does not use IF...

{
    "FV": "1.0",
    "GI": "BAUER Electronic BSM-WS36A-H01-1311-0000",
    "GS": "001BZR1521070003",
    "GV": "1.8:33C4:DB63, 08d1aa3",
    "PG": "T22107",
    "MV": "BAUER Electronic",
    "MM": "BSM-WS36A-H01-1311-0000",
    "MS": "001BZR1521070003",
    "IS": true,
    "IT": "UNDEFINED",
    "ID": "chargeIT up 12*4, id: 12345678abcdef",
    "RD": [
        {
            "TM": "2020-10-08T10:22:39,000+0200 S",
            "TX": "B",
            "RV": 0,
            "RI": "1-0:1.8.0*198",
            "RU": "Wh",
            "XV": 88200,
            "XI": "1-0:1.8.0*255",
            "XU": "Wh",
            "XT": 1,
            "RT": "AC",
            "EF": "",
            "ST": "G"
        }
    ]
}

On the other hand, they are right. There is no real reason to add this property when it is an empty array [].

The SAFE transparency software seems to handle null values for IF in a special way. So the written code also differs from the format documentation.

BTW. BAUER also has XV, XU, XT extensions for the meter readings. The documentation only defines extensions for "top-level names in the JSON object". Perhaps an update to this section of the documentation would also useful.