NAV Navigation
Shell HTTP JavaScript Node.js Ruby Python Java Go PHP

Community PV v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

A simple representation of a typical community PV.

Base URLs:

License: MIT

Authentication

Default

get__measure

Code samples

# You can also use wget
curl -X GET https://cpv:8080/communitypv/measure \
  -H 'Accept: application/json'

GET https://cpv:8080/communitypv/measure HTTP/1.1
Host: cpv:8080
Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('https://cpv:8080/communitypv/measure',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('https://cpv:8080/communitypv/measure',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://cpv:8080/communitypv/measure',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://cpv:8080/communitypv/measure', headers = headers)

print(r.json())

URL obj = new URL("https://cpv:8080/communitypv/measure");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://cpv:8080/communitypv/measure", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://cpv:8080/communitypv/measure', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

GET /measure

Get operation for interface 'Measurements'

Provides measurements.

Example responses

200 Response

{
  "active_power": 1.3,
  "reactive_power": 0.1
}

Responses

Status Meaning Description Schema
200 OK Provides measurements. CommunityPV

Schemas

CommunityPV

{
  "active_power": 1.3,
  "reactive_power": 0.1
}

Properties

Name Type Required Restrictions Description
active_power number(double) true none Active power
reactive_power number(double) true none Reactive power