Meters_Groups_V2

Get the summed data (active imported/exported, reactive Q1-Q4) of every
meter belonging to a meters_group, per timestamp.

A meters_group has no data of its own - it's just a list of member
devices_id (devices_extra.meters_group_meters). This endpoint is the
only place that computes a real total across the group; nothing in the
web does this today (it plots each member as a separate series instead).

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

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

Arguments

  • dev_id [*]: Device id number of the meters_group itself.

  • 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

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 meters_group id: The id format is incorrect, or the
    device is not a meters_group
  • 400 Bad Dates: Dates entered are incorrect
  • 204 No data found: The data entered have not produced any results

Example

Get the group total (last quarter) for device_id 5

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

Response

{
    "plant": "XXXXXXXX",
    "devices_id": 5,
    "members": [101, 102, 103],
    "start": "2025-04-25 11:15:00",
    "end": "",
    "meters_group": [
        {
            "data_meters_datetime": "2025-04-25 11:15:00",
            "data_meters_active_imported": 1234.5,
            "data_meters_active_exported": 0.0,
            "data_meters_reactive_Q1": 12.1,
            "data_meters_reactive_Q2": 0.0,
            "data_meters_reactive_Q3": 0.0,
            "data_meters_reactive_Q4": 3.4,
            "devices_count": 3
        }
    ]
}

devices_count is how many of the group's members actually reported data
at that timestamp - if it's lower than members, the sum for that row is
partial (some meter didn't report).

Other examples

Get the group total between requested dates

/v2/meters_groups/<dev-id>/?start=2025-04-25 00:00:00&end=2025-04-25 11:15:00