Retrieve the list of variables of a site and their metadata

Presentation

Description Authorization Method Query
This query allows to retrieve the list of variables of a site and their metadata recorded on the platform OpeNRJ. Public GET /v1/sites/:siteID/variables

URL parameter

Parameter Type Description
:siteID String Unique site identifier.

Query parameter

Required

None.

Optional

None.

Successful message

Sample Query

            $ curl -i -X GET 'https://api.openrj.eu/v1/sites/test_site/variables'
            
            HTTP/1.1 200 OK

            {
              "variables": [
                {
                  "extID": "energy_aircond_3",
                  "label": "aircond_3",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c2491c"
                },
                {
                  "extID": "energy_aircond_1",
                  "label": "aircond_1",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c2491d"
                },
                {
                  "extID": "energy_aircond_2",
                  "label": "aircond_2",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c2491e"
                },
                {
                  "extID": "energy_plugs_2",
                  "label": "plugs_2",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c2491f"
                },
                {
                  "extID": "energy_plugs_3",
                  "label": "plugs_3",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24920"
                },
                {
                  "extID": "energy_lights_3",
                  "label": "lights_3",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24921"
                },
                {
                  "extID": "energy_plugs_1",
                  "label": "plugs_1",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24922"
                },
                {
                  "extID": "energy_lights_1",
                  "label": "lights_1",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24923"
                },
                {
                  "extID": "energy_lights_2",
                  "label": "lights_2",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24924"
                },
                {
                  "extID": "test1",
                  "label": "test1",
                  "type": "energy",
                  "valueType": "N",
                  "unit": "kWh",
                  "lowerBound": 14,
                  "upperBound": 1100000000,
                  "deltaMin": 1,
                  "deltaMax": 100,
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24925"
                },
                {
                  "extID": "test2",
                  "label": "test2",
                  "type": "energy",
                  "valueType": "L",
                  "unit": "boolean",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24926"
                },
                {
                  "extID": "test3",
                  "label": "test3",
                  "type": "energy",
                  "valueType": "T",
                  "unit": "text",
                  "public": true,
                  "id": "53bc1a1faa0f163d46c24927"
                }
              ]
            }
            

Details

Paramètre Type Description
variables Array List of site variables.
variables[i].id String Variable identifier
variables[i].extID String Variable identifier
variables[i].label String Name of the variable.
variables[i].type String Type of value returned by variable.
variables[i].valueType String The value of the type returned by the variable :
  • N : digital
  • L : logical (true or false)
  • T : api_getvariables_tex
variables[i].unit String Unit of the value returned by the variable.
variables[i].public String Visibility of the variable If public is true, anyone can see the values ​​collected by the variable.
(Optional) variables[i].lowerBound Number Limite inférieure inclusive des valeurs admissibles.textual (string)
(Optional) variables[i].upperBound Number Upper limit inclusive of allowable values.
(Optional) variables[i].deltaMin Number Minimum differential inclusive with previous value.
(Optional) variables[i].deltaMax Number Maximum differential inclusive with previous value.

Error Message "Site not found"

Sample Query

            curl -i -X GET 'https://api.openrj.eu/v1/sites/test_site2/variables'
            
            HTTP/1.1 404 Not Found

            {
              "error": "Site not found."
            }
            

Causes

This site does not exist.