Local Open API

The Local Open API makes it possible to extract data from the CEMM to be used in different applications. This version of the Open API is only accessible in the same network as the CEMM. When you need to access the CEMM from outside the network, please use the Remote Open API. Use the discovery broadcast to find a CEMM in the local network.

API Endpoints

The API currently supports several HTTP endpoints to extract data from the CEMM. These Each request will respond with JSON. All available endpoints are described below.

CEMM information

GET /open-api/v1/

This is the root of the Open API. The response body will contain basic information about the CEMM. Most useful is the mac property, which contains the unique MAC address of the CEMM. See the example below:

GET /open-api/v1/

{
  "data": {
    "mac": "00:1E:C0:85:96:CC",
    "name": "CEMM Basic",
    "type": "E5AD649292BBBB51060F",
    "version": "2.18.1.0",
    "core": "1.24"
  }
}

 

Realtime data

GET /open-api/v1/<alias>/realtime/

The realtime endpoint will return the most recent timestamp (in ms) and value for each channel of the specified alias. Which channels are returned, depends on the type of alias. See Common channels.

GET /open-api/v1/p1/realtime/

{
  "data": {
    "t1": [
      1587565238000,
      78659.671875
    ],
    "t2": [
      1587565238000,
      114467.5703125
    ],
    "t3": [
      1587565238000,
      28713.73828125
    ],
    "t4": [
      1587565238000,
      33709.36328125
    ],
    "electric_power": [
      1587565238000,
      -8840
    ],
    "rate": [
      1587565238000,
      2
    ],
    "gas": [
      0,
      0
    ]
  }
}

 

Historical data

GET /open-api/v1/<alias>/data/day/
Returns one value per minute for the current day. The current and future minutes are not included, except the last minute of the day, which will be null.

GET /open-api/v1/<alias>/data/month/
Returns one value per day for the current month. Days in the future will have value 0.

GET /open-api/v1/<alias>/data/year/
Returns one value per month of the current year. Months in the future will have value 0.

Specify the GET parameter time to set the start timestamp (in Unix epoch seconds) of the requested period.

The response will contain datasets for one or more channels depending on the selected alias. Each dataset is a list of samples where each sample is a list of two items: the timestamp in milliseconds and the value.

 

GET /open-api/v1/p1/data/day/?time=1587420000

{
  "io_id": "88",
  "time": 1587420000,
  "data": {
    "electric_power": [
      [
        1587506399000,
        null
      ],
      [
        1587506340000,
        1030
      ],
      [
        1587506280000,
        1033
      ],
      [
        1587506220000,
        1030
      ],
      
      ........

      [
        1587420120000,
        1006
      ],
      [
        1587420060000,
        1008
      ],
      [
        1587420000000,
        1000
      ]
    ]
  }
}

 

Available Aliases

Smart meters

The -usb variant should be used when the meter is connected to the USB port of the CEMM.

p1, p1-usb
emucs, emucs-usb
han
dlms-usb
p1-gas

 

Pulse meters

Alias (electricity) Alias (water, gas) Physical connection
s01 pulse-1 connection 2
s02 pulse-2 connection 1.1
s03 pulse-3 connection 1.2

 

Modbus electricity meters

These meters have a dynamic alias, which is based on the Modbus address of the meter. The alias is mbX where X is the Modbus address. A meter with address 5 will use alias mb5.

 

Common channels

Name Unit Description
t1 kWh Meter reading: usage (low tariff, or single counter)
t2 kWh Meter reading: usage (high tariff)
t3 kWh Meter reading: feed-in (low tariff, or single counter)
t4 kWh Meter reading: feed-in (high tariff)
electric_power Watt
rate The tariff index
gas Meter reading of the gas meter
volume Meter reading of the water or gas meter
flow L/min Flow rate of water or gas