Elements_V2

Get elements and id .

You can enter a group id or devices type.

/v2/elements?gid=XXX&type=XXX

Arguments

  • gid: (Optional) Groups ID.

  • type: (Optional) Devices type. (Valid types: tcp_meter, gsm_meter, inverter, sensor, string, tracker)

  • details: (Optional) 1 to return each device as an object with its name and, by type:
    inverter_id and have_battery (inverters), energy_management_id
    (energy managements), sensor_id (sensors), cil (meters).

Response

JSON object with the result. Each group includes its location (lat, lon, city, state,
country) and each facility its peak_power_kwp, nominal_power_kw (AC), owner_name and
cil (CUPS/CIL); any of these may be null if not set for the plant.

With details=1 each device is an object instead of just its name. Every device has name,
plus these fields depending on its type (null if not set for the device):

Device type Field Description
inverter inverter_id Inverter identifier in the plant (e.g. the one used by the datalogger)
inverter have_battery 1 if the inverter has a battery, 0 otherwise
energy_management energy_management_id Energy analyzer / manager identifier in the plant
sensor sensor_id Meteo sensor identifier in the plant
tcp_meter, gsm_meter cil CUPS/CIL of the facility the meter belongs to

Other device types only have name.

May return the following errors:

  • 404 Not found : No elements found or don't have rights to get data
  • 400 Wrong type or id: The id format is incorrect
  • 204 No data found: The data entered have not produced any results

Example

Get all elements

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

Response

{
    "Group 1": {
        "groups_name": "Group 1",
        "groups_id": 1,
        "lat": 37.123456,
        "lon": -1.123456,
        "city": "City",
        "state": "State",
        "country": "Spain",
        "facilities": {
            "Agrupación Group 1": {
                "insts_name": "Agrupación Group 1",
                "insts_id": 1,
                "peak_power_kwp": 900.0,
                "nominal_power_kw": 750.0,
                "owner_name": "Owner S.L.",
                "cil": null,
                "devices": {
                    "tcp_meter": {
                        "123": "Group 1 - Secundario"
                    }
                }
            },
            "Inst Group 1": {
                "insts_name": "Inst Group 1",
                "insts_id": 2,
                "peak_power_kwp": 900.0,
                "nominal_power_kw": 750.0,
                "owner_name": "Owner S.L.",
                "cil": "ES0021000000000000AA1F001",
                "devices": {
                    "tcp_meter": {
                        "124": "Group 1 - Principal"
                    },
                    "inverter": {
                        "217": "Inst Group 1 - inversor 1",
                        "218": "Inst Group 1 - inversor 2",
                        "219": "Inst Group 1 - inversor 3",
                        "220": "Inst Group 1 - inversor 4",
                        "221": "Inst Group 1 - inversor 5",
                        "222": "Inst Group 1 - inversor 6",
                        "223": "Inst Group 1 - inversor 7",
                        "224": "Inst Group 1 - inversor 8",
                        "225": "Inst Group 1 - inversor 9",
                        "226": "Inst Group 1 - inversor 10",
                        "227": "Inst Group 1 - inversor 11",
                        "228": "Inst Group 1 - inversor 12",
                        "229": "Inst Group 1 - inversor 13",
                        "230": "Inst Group 1 - inversor 14"
                    }
                }
            }
        }
    },
}

Other examples

Get all elements of specific group
    /v2/elements/?gid=123

Get all elements of tcp_meter type
    /v2/elements/?type=tcp_meter

Get all elements of tcp_meter type of specific group
    /v2/elements/?type=tcp_meter&gid=123

Get the inverters of a group with their identifiers and battery flag
    /v2/elements/?type=inverter&gid=123&details=1
{
    "Group 1": {
        "groups_name": "Group 1",
        "groups_id": 123,
        "lat": 37.123456,
        "lon": -1.123456,
        "city": "City",
        "state": "State",
        "country": "Spain",
        "facilities": {
            "Inst Group 1": {
                "insts_name": "Inst Group 1",
                "insts_id": 2,
                "peak_power_kwp": 900.0,
                "nominal_power_kw": 750.0,
                "owner_name": "Owner S.L.",
                "cil": "ES0021000000000000AA1F001",
                "devices": {
                    "inverter": {
                        "217": {"name": "Inst Group 1 - inversor 1", "inverter_id": "inv01", "have_battery": 0},
                        "218": {"name": "Inst Group 1 - inversor 2", "inverter_id": "inv02", "have_battery": 1}
                    }
                }
            }
        }
    }
}