-
Notifications
You must be signed in to change notification settings - Fork 26
Beschrijving Get API's
- Device Information
- Device Time
- Device Settings
- Smart Meter Information
- Smart Meter Actual
- Smart Meter Telegram
- History
/api/v1/dev/info
Geeft een json string terug in de volgende vorm:
{"devinfo":[
{"name": "author", "value": "Willem Aandewiel (www.aandewiel.nl)"},
{"name": "hostname", "value": "DSMR-108"},
{"name": "fwversion", "value": "v0.2.9 (31-01-2020)"},
{"name": "compiled", "value": "Jan 31 2020 12:22:10"},
{"name": "freeheap", "value": 16224, "unit": "bytes"},
{"name": "maxfreeblock", "value": 15400, "unit": "bytes"},
{"name": "chipid", "value": "cc6156"},
{"name": "coreversion", "value": "2_6_3"},
{"name": "sdkversion", "value": "2.2.1(cfd48f3)"},
{"name": "cpufreq", "value": 80, "unit": "MHz"},
{"name": "sketchsize", "value": 521.953, "unit": "kB"},
{"name": "freesketchSpace", "value": 1524.000, "unit": "kB"},
{"name": "flashchipid", "value": "00164020"},
{"name": "flashchipsize", "value": 4.000, "unit": "MB"},
{"name": "flashchiprealsize", "value": 4.000, "unit": "MB"},
{"name": "flashchipspeed", "value": 80.000, "unit": "MHz"},
{"name": "flashchipmode", "value": "DOUT"},
{"name": "boardtype", "value": "ESP8266_GENERIC"},
{"name": "ssid", "value": "YourWiFi"},
{"name": "ipaddress", "value": "192.168.1.106"},
{"name": "wifirssi", "value": -52},
{"name": "hostname", "value": "DSMR-API"},
{"name": "uptime", "value": "0(d):00(h):10"},
{"name": "telegramcount", "value": 56},
{"name": "telegramerrors", "value": 0},
{"name": "mqttbroker", "value": "mosqitto.org:1883"},
{"name": "mqttinterval", "value": 120},
{"name": "mqttbroker_connected", "value": "yes"},
{"name": "mindergas_response", "value": "countdown for sending"},
{"name": "mindergas_status", "value": "@31|12:28 -> :0"},
{"name": "reboots", "value": 6},
{"name": "lastreset", "value": "Software/System restart"}
]}
/api/v1/dev/time
Geeft een json string terug in de volgende vorm:
{"devtime":[
{"name": "time", "value": "2021-03-09 12:15:01"},
{"name": "epoch", "value": 1615292111}
]}
/api/v1/dev/settings
Geeft een json string terug in de volgende vorm:
{"settings":[
{"name": "hostname", "value":"DSMR-API", "type": "s", "maxlen": 29},
{"name": "ed_tariff1", "value": 0.15123, "type": "f", "min": 0, "max": 10},
{"name": "ed_tariff2", "value": 0.17092, "type": "f", "min": 0, "max": 10},
{"name": "er_tariff1", "value": 0.13087, "type": "f", "min": 0, "max": 10},
{"name": "er_tariff2", "value": 0.14567, "type": "f", "min": 0, "max": 10},
{"name": "gd_tariff", "value": 0.23456, "type": "f", "min": 0, "max": 10},
{"name": "electr_netw_costs", "value": 24.00, "type": "f", "min": 0, "max": 100},
{"name": "gas_netw_costs", "value": 12.00, "type": "f", "min": 0, "max": 100},
{"name": "tlgrm_interval", "value": 10, "type": "i", "min": 1, "max": 60},
{"name": "oled_screen_time", "value": 10, "type": "i", "min": 1, "max": 300},
{"name": "index_page", "value":"DSMRindex.html", "type": "s", "maxlen": 49},
{"name": "mqtt_broker", "value":"hassio.local", "type": "s", "maxlen": 101},
{"name": "mqtt_broker_port", "value": 1883, "type": "i", "min": 1, "max": 9999},
{"name": "mqtt_user", "value":"user", "type": "s", "maxlen": 40},
{"name": "mqtt_passwd", "value":"password", "type": "s", "maxlen": 30},
{"name": "mqtt_topTopic", "value":"DSMR-API", "type": "s", "maxlen": 21},
{"name": "mqtt_interval", "value": 60, "type": "i", "min": 0, "max": 600},
{"name": "mindergastoken", "value":"Mg6543token", "type": "s", "maxlen": 21}
]}
/api/v1/sm/info
Geeft een json string terug in de volgende vorm:
{"info":[
{"name": "identification", "value": "XMX5LGBBLB123456789"},
{"name": "p1_version", "value": "50"},
{"name": "equipment_id", "value": "1234563336303000000000000000000040"},
{"name": "electricity_tariff", "value": "0002"},
{"name": "gas_device_type", "value": 3},
{"name": "gas_equipment_id", "value": "4730303339303031312345603530323136"}
]}
/api/v1/sm/actual
Geeft een json string terug in de volgende vorm:
{"actual":[
{"name": "timestamp", "value": "210419050001S"},
{"name": "energy_delivered_tariff1", "value": 2332.511, "unit": "kWh"},
{"name": "energy_delivered_tariff2", "value": 8514.767, "unit": "kWh"},
{"name": "energy_returned_tariff1", "value": 353.841, "unit": "kWh"},
{"name": "energy_returned_tariff2", "value": 196.645, "unit": "kWh"},
{"name": "power_delivered", "value": 1.880, "unit": "kW"},
{"name": "power_returned", "value": 0.000, "unit": "kW"},
{"name": "voltage_l1", "value": 239.000, "unit": "V"},
{"name": "voltage_l2", "value": 236.000, "unit": "V"},
{"name": "voltage_l3", "value": 237.000, "unit": "V"},
{"name": "current_l1", "value": 3, "unit": "A"},
{"name": "current_l2", "value": 0, "unit": "A"},
{"name": "current_l3", "value": 0, "unit": "A"},
{"name": "power_delivered_l1", "value": 0.500, "unit": "kW"},
{"name": "power_delivered_l2", "value": 0.899, "unit": "kW"},
{"name": "power_delivered_l3", "value": 0.480, "unit": "kW"},
{"name": "power_returned_l1", "value": 0.000, "unit": "kW"},
{"name": "power_returned_l2", "value": 0.000, "unit": "kW"},
{"name": "power_returned_l3", "value": 0.000, "unit": "kW"},
{"name": "gas_delivered", "value": 2963.380, "unit": "m3"}
]}
/api/v1/sm/fields
Deze API geeft alle velden terug die door de Smart Meter verstuurd kunnen worden. Velden die niet door de Smart Meter verstuurd zijn hebben als value
"-".
De api geeft een json string terug in de volgende vorm:
{"fields":[
{"name": "identification", "value": "XMX5LGBB123456065887"},
{"name": "p1_version", "value": "50"},
{"name": "timestamp", "value": "210313113001S"},
{"name": "equipment_id", "value": "1234563336303000000000000000000040"},
{"name": "energy_delivered_tariff1", "value": 2329.048, "unit": "kWh"},
{"name": "energy_delivered_tariff2", "value": 8501.762, "unit": "kWh"},
{"name": "energy_returned_tariff1", "value": 353.536, "unit": "kWh"},
{"name": "energy_returned_tariff2", "value": 196.494, "unit": "kWh"},
{"name": "electricity_tariff", "value": "0001"},
{"name": "power_delivered", "value": 2.280, "unit": "kW"},
{"name": "power_returned", "value": 0.830, "unit": "kW"},
{"name": "electricity_threshold", "value": "-"},
{"name": "electricity_switch_position", "value": "-"},
{"name": "electricity_failures", "value": 10},
{"name": "electricity_long_failures", "value": 0},
{"name": "electricity_failure_log", "value": "(0)(0-0:96.7.19)"},
{"name": "electricity_sags_l1", "value": 2},
{"name": "electricity_sags_l2", "value": 3},
{"name": "electricity_sags_l3", "value": 3},
{"name": "electricity_swells_l1", "value": 0},
{"name": "electricity_swells_l2", "value": 0},
{"name": "electricity_swells_l3", "value": 0},
{"name": "message_short", "value": "-"},
{"name": "message_long", "value": ""},
{"name": "voltage_l1", "value": 238.000, "unit": "V"},
{"name": "voltage_l2", "value": 235.000, "unit": "V"},
{"name": "voltage_l3", "value": 233.000, "unit": "V"},
{"name": "current_l1", "value": 0, "unit": "A"},
{"name": "current_l2", "value": 2, "unit": "A"},
{"name": "current_l3", "value": 0, "unit": "A"},
{"name": "power_delivered_l1", "value": 0.566, "unit": "kW"},
{"name": "power_delivered_l2", "value": 0.896, "unit": "kW"},
{"name": "power_delivered_l3", "value": 0.819, "unit": "kW"},
{"name": "power_returned_l1", "value": 0.002, "unit": "kW"},
{"name": "power_returned_l2", "value": 0.421, "unit": "kW"},
{"name": "power_returned_l3", "value": 0.405, "unit": "kW"},
{"name": "gas_device_type", "value": 3},
{"name": "gas_equipment_id", "value": "4730303339301234563532303530323136"},
{"name": "gas_valve_position", "value": "-"},
{"name": "gas_delivered", "value": 2958.920, "unit": "m3"},
{"name": "thermal_device_type", "value": "-"},
{"name": "thermal_equipment_id", "value": "-"},
{"name": "thermal_valve_position", "value": "-"},
{"name": "thermal_delivered", "value": "-"},
{"name": "water_device_type", "value": "-"},
{"name": "water_equipment_id", "value": "-"},
{"name": "water_valve_position", "value": "-"},
{"name": "water_delivered", "value": "-"},
{"name": "slave_device_type", "value": "-"},
{"name": "slave_equipment_id", "value": "-"},
{"name": "slave_valve_position", "value": "-"},
{"name": "slave_delivered", "value": "-"}
]}
Om de waarde van één specifiek veld op te vragen kan de volgende API gebruikt worden:
/api/v1/sm/fields/{veld-naam}
Bijvoorbeeld onderstaande API call:
/api/v1/sm/fields/current_l2
.. zal de volgende json string terug geven:
{"fields":[
{"name": "timestamp", "value": "210315080001S"},
{"name": "current_l2", "value": 1, "unit": "A"}
]}
/api/v1/sm/telegram
Geeft het volgende terug:
/XMX5LGBBLB2410065887
1-3:0.2.8(50)
0-0:1.0.0(210313180001S)
0-0:96.1.1(4530303336303000000000000000000040)
1-0:1.8.1(002329.072*kWh)
1-0:1.8.2(008501.837*kWh)
1-0:2.8.1(000353.541*kWh)
1-0:2.8.2(000196.496*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(001.66*kW)
1-0:2.7.0(001.34*kW)
0-0:96.7.21(00010)
0-0:96.7.9(00000)
1-0:99.97.0(0)(0-0:96.7.19)
1-0:32.32.0(00002)
1-0:52.32.0(00003)
1-0:72.32.0(00003)
1-0:32.36.0(00000)
1-0:52.36.0(00000)
1-0:72.36.0(00000)
0-0:96.13.0()
1-0:32.7.0(241.0*V)
1-0:52.7.0(240.0*V)
1-0:72.7.0(236.0*V)
1-0:31.7.0(003*A)
1-0:51.7.0(002*A)
1-0:71.7.0(000*A)
1-0:21.7.0(00.990*kW)
1-0:41.7.0(00.548*kW)
1-0:61.7.0(00.123*kW)
1-0:22.7.0(00.018*kW)
1-0:42.7.0(00.695*kW)
1-0:62.7.0(00.625*kW)
0-1:24.1.0(003)
0-1:96.1.0(4730303339303031363532303530323136)
0-1:24.2.1(210313180001S)(02958.951*m3)
!DF78
Dit is het volledige telegram zoals die door de Smart Meter wordt verstuurd, inclusief "\r\n" line endings en CRC Checksum.
Het algemene formaat van deze API is:
/api/v1/hist/{hours|days|months}
of
/api/v1/hist/{hours|days|months}/{asc|desc}
Default sortering is ascending (nieuwste gegevens éérst, oudste laatst).
/api/v1/hist/hours
Geeft een json string terug in de volgende vorm:
{"hours":[
{"recnr": 0, "recid": "21031006", "slot": 17,"edt1": 2328.742, "edt2": 8500.609,"ert1": 353.507, "ert2": 196.479,"gdt": 2958.498},
{"recnr": 1, "recid": "21031005", "slot": 16,"edt1": 2328.739, "edt2": 8500.598,"ert1": 353.506, "ert2": 196.479,"gdt": 2958.495},
{"recnr": 2, "recid": "21031004", "slot": 15,"edt1": 2328.735, "edt2": 8500.588,"ert1": 353.506, "ert2": 196.479,"gdt": 2958.488},
{"recnr": 3, "recid": "21031003", "slot": 14,"edt1": 2328.729, "edt2": 8500.563,"ert1": 353.506, "ert2": 196.479,"gdt": 2958.481},
{"recnr": 4, "recid": "21031002", "slot": 13,"edt1": 2328.725, "edt2": 8500.551,"ert1": 353.506, "ert2": 196.479,"gdt": 2958.478},
{"recnr": 5, "recid": "21031001", "slot": 12,"edt1": 2328.721, "edt2": 8500.539,"ert1": 353.506, "ert2": 196.479,"gdt": 2958.474},
.
.
.
{"recnr": 43, "recid": "21030811", "slot": 23,"edt1": 2328.563, "edt2": 8499.973,"ert1": 353.492, "ert2": 196.472,"gdt": 2958.277},
{"recnr": 44, "recid": "21030810", "slot": 22,"edt1": 2328.558, "edt2": 8499.949,"ert1": 353.491, "ert2": 196.471,"gdt": 2958.272},
{"recnr": 45, "recid": "21030809", "slot": 21,"edt1": 2328.555, "edt2": 8499.940,"ert1": 353.490, "ert2": 196.471,"gdt": 2958.270},
{"recnr": 46, "recid": "21030808", "slot": 20,"edt1": 2328.550, "edt2": 8499.921,"ert1": 353.489, "ert2": 196.471,"gdt": 2958.260},
{"recnr": 47, "recid": "21030807", "slot": 19,"edt1": 2328.546, "edt2": 8499.904,"ert1": 353.488, "ert2": 196.470,"gdt": 2958.255},
{"recnr": 48, "recid": "21030806", "slot": 18,"edt1": 2328.543, "edt2": 8499.895,"ert1": 353.488, "ert2": 196.470,"gdt": 2958.250}
]}
/api/v1/hist/days
Geeft een json string terug in de volgende vorm:
{"days":[
{"recnr": 0, "recid": "21031104", "slot": 7,"edt1": 2328.828, "edt2": 8500.923,"ert1": 353.516, "ert2": 196.483,"gdt": 2958.626},
{"recnr": 1, "recid": "21031023", "slot": 6,"edt1": 2328.810, "edt2": 8500.861,"ert1": 353.516, "ert2": 196.483,"gdt": 2958.598},
{"recnr": 2, "recid": "21030923", "slot": 5,"edt1": 2328.712, "edt2": 8500.511,"ert1": 353.506, "ert2": 196.479,"gdt": 2958.463},
{"recnr": 3, "recid": "21030823", "slot": 4,"edt1": 2328.616, "edt2": 8500.146,"ert1": 353.497, "ert2": 196.475,"gdt": 2958.338},
{"recnr": 4, "recid": "21030723", "slot": 3,"edt1": 2328.513, "edt2": 8499.809,"ert1": 353.488, "ert2": 196.470,"gdt": 2958.209},
.
.
.
{"recnr": 9, "recid": "21030223", "slot": 13,"edt1": 2328.028, "edt2": 8498.042,"ert1": 353.444, "ert2": 196.446,"gdt": 2957.589},
{"recnr": 10, "recid": "21030123", "slot": 12,"edt1": 2327.934, "edt2": 8497.677,"ert1": 353.435, "ert2": 196.441,"gdt": 2957.457},
{"recnr": 11, "recid": "21022823", "slot": 11,"edt1": 2327.651, "edt2": 8496.564,"ert1": 353.407, "ert2": 196.428,"gdt": 2957.076},
{"recnr": 12, "recid": "21022723", "slot": 10,"edt1": 2327.560, "edt2": 8496.223,"ert1": 353.400, "ert2": 196.424,"gdt": 2956.947},
{"recnr": 13, "recid": "21022623", "slot": 9,"edt1": 2327.472, "edt2": 8495.822,"ert1": 353.391, "ert2": 196.419,"gdt": 2956.831},
{"recnr": 14, "recid": "21022523", "slot": 8,"edt1": 2327.383, "edt2": 8495.460,"ert1": 353.383, "ert2": 196.415,"gdt": 2956.704}
]}
/api/v1/hist/months
Geeft een json string terug in de volgende vorm:
{"months":[
{"recnr": 0, "recid": "21031106", "slot": 18,"edt1": 2328.836, "edt2": 8500.952,"ert1": 353.517, "ert2": 196.484,"gdt": 2958.637},
{"recnr": 1, "recid": "21022823", "slot": 17,"edt1": 2327.651, "edt2": 8496.564,"ert1": 353.407, "ert2": 196.428,"gdt": 2957.076},
{"recnr": 2, "recid": "21013023", "slot": 16,"edt1": 2324.980, "edt2": 8486.277,"ert1": 353.170, "ert2": 196.306,"gdt": 2953.531},
{"recnr": 3, "recid": "20123023", "slot": 15,"edt1": 2322.095, "edt2": 8475.463,"ert1": 352.912, "ert2": 196.175,"gdt": 2949.813},
{"recnr": 4, "recid": "20113023", "slot": 14,"edt1": 2319.278, "edt2": 8464.555,"ert1": 352.654, "ert2": 196.047,"gdt": 2946.054},
{"recnr": 5, "recid": "20103023", "slot": 13,"edt1": 2316.394, "edt2": 8453.577,"ert1": 352.392, "ert2": 195.919,"gdt": 2942.263},
.
.
.
{"recnr": 19, "recid": "19083023", "slot": 24,"edt1": 2276.118, "edt2": 8300.609,"ert1": 348.744, "ert2": 194.109,"gdt": 2889.412},
{"recnr": 20, "recid": "19073023", "slot": 23,"edt1": 2273.252, "edt2": 8289.574,"ert1": 348.484, "ert2": 193.979,"gdt": 2885.693},
{"recnr": 21, "recid": "19063023", "slot": 22,"edt1": 2270.319, "edt2": 8278.475,"ert1": 348.228, "ert2": 193.847,"gdt": 2881.936},
{"recnr": 22, "recid": "19053023", "slot": 21,"edt1": 2267.456, "edt2": 8267.560,"ert1": 347.971, "ert2": 193.718,"gdt": 2878.164},
{"recnr": 23, "recid": "19042918", "slot": 20,"edt1": 2264.495, "edt2": 8256.316,"ert1": 347.702, "ert2": 193.585,"gdt": 2874.242},
{"recnr": 24, "recid": "19033023", "slot": 19,"edt1": 2261.732, "edt2": 8245.799,"ert1": 347.443, "ert2": 193.461,"gdt": 2870.651}
]}
Default is ascending sortering (nieuwste gegevens éérst, oudste laatst). Om de historie in omgekeerde volgorde te krijgen (oudste gegevens eerst) moet de API als volgt worden aangeroepen:
/api/v1/hist/months/desc
Geeft een json string terug in de volgende vorm:
{"months":[
{"recnr": 0, "recid": "19033023", "slot": 19,"edt1": 2261.732, "edt2": 8245.799,"ert1": 347.443, "ert2": 193.461,"gdt": 2870.651},
{"recnr": 1, "recid": "19042918", "slot": 20,"edt1": 2264.495, "edt2": 8256.316,"ert1": 347.702, "ert2": 193.585,"gdt": 2874.242},
{"recnr": 2, "recid": "19053023", "slot": 21,"edt1": 2267.456, "edt2": 8267.560,"ert1": 347.971, "ert2": 193.718,"gdt": 2878.164},
{"recnr": 3, "recid": "19063023", "slot": 22,"edt1": 2270.319, "edt2": 8278.475,"ert1": 348.228, "ert2": 193.847,"gdt": 2881.936},
{"recnr": 4, "recid": "19073023", "slot": 23,"edt1": 2273.252, "edt2": 8289.574,"ert1": 348.484, "ert2": 193.979,"gdt": 2885.693},
.
.
.
{"recnr": 21, "recid": "20123023", "slot": 15,"edt1": 2322.095, "edt2": 8475.463,"ert1": 352.912, "ert2": 196.175,"gdt": 2949.813},
{"recnr": 22, "recid": "21013023", "slot": 16,"edt1": 2324.980, "edt2": 8486.277,"ert1": 353.170, "ert2": 196.306,"gdt": 2953.531},
{"recnr": 23, "recid": "21022823", "slot": 17,"edt1": 2327.651, "edt2": 8496.564,"ert1": 353.407, "ert2": 196.428,"gdt": 2957.076},
{"recnr": 24, "recid": "21031116", "slot": 18,"edt1": 2328.870, "edt2": 8501.095,"ert1": 353.522, "ert2": 196.487,"gdt": 2958.687}
]}