Meter_V2

Get data from a single device meter.

You can enter a range of dates to get the data for that period.

/v2/meters/<dev-id>/?start=XXX&end=XXX

Arguments

  • dev_id [*]: Device id number

  • start: (Optional) (yyyy-mm-dd hh:ii:ss) Start date of search interval.
    If you only enter the start date it will show the reading of that moment.

  • end: (Optional) (yyyy-mm-dd hh:ii:ss) End date of search interval.
    Can not be greater than the current date or the difference
    between dates can not be greater than 32 days
  • fields: (Optional) Comma-separated list of variables to return, with or
    without the table prefix (e.g. Pact_ac,energy). Datetime and
    devices_id are always returned. Unknown fields return 400.

Response

JSON object with the result. May return the following errors:

  • 404 Not found : No device found or don't have rights to get data
  • 400 Wrong plant or meter id: The id format is incorrect
  • 400 Bad Dates: Dates entered are incorrect
  • 204 No data found: The data entered have not produced any results

Example

Get all meters data (last quarter) in for device_id 5

GET /v2/meters/5 HTTP/1.1
Host: apiexternal.mvscada.com
MV-API-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Content-Type: application/json

Response

{
    "plant": "XXXXXXXX",
    "start": "2017-04-10 17:30:00",
    "end": "",
    "meters": [
        {
            "inst_id": "XXXXXXX_01",
            "reactivaq1": 5814,
            "reactivaq2": 1857,
            "reactivaq3": 107887,
            "reactivaq4": 40606,
            "datetime": "2017-04-10 17:30:00",
            "activa_consumida": 7604,
            "activa_generada": 1999475
        },
        {
            "inst_id": "XXXXXXX_01",
            "reactivaq1": 5814,
            "reactivaq2": 1857,
            "reactivaq3": 107887,
            "reactivaq4": 40606,
            "datetime": "2017-04-10 17:45:00",
            "activa_consumida": 7604,
            "activa_generada": 1999485
        },
        {...}
    ]
}

Other examples

Get all datas of all meters between requested dates

/v2/meters/<dev-id>/?start=2017-03-30 08:00:00&end=2017-03-31 08:00:00