Inhaltsübersicht
Climkit API
Aktualisiert
von Nicolas Vodoz
Die Developer API von Climkit ermöglicht registrierten und autorisierten Entwicklern den Abruf von Zähl- und Energiedaten von autorisierten Climkit-Standorten.
Um sich zu registrieren, müssen Entwickler die Datenzugriffsrechte beim Anlagenbesitzer und bei Climkit SA einholen.
Anfragen für den API-Zugriff sind an service@climkit.io zu richten.
Die API-Zugriffsinformationen unterscheiden sich von den Login-Informationen für das persönliche Konto im Climkit-Portal.
Die Zugriffsinformationen dürfen nur vom registrierten Entwickler verwendet werden. Kollegen und Mitarbeiter müssen einen individuellen Antrag stellen, um ihre eigenen Zugriffsrechte zu erhalten.
API Endpoint: https://api.climkit.io/api/v1
1. Authentifizierung
Die Climkit API verwendet JSON Web Tokens (https://jwt.io/introduction/), um die Informationsübermittlung zu sichern.
Nachdem sich der Benutzer mit seinen Anmeldeinformationen (Benutzername und Passwort) angemeldet hat, erhält er einen 15 Minuten gültigen Token, der ihm den Zugriff auf die autorisierten Ressourcen ermöglicht.
URL: /auth
Methode: POST
Auth erforderlich: NEIN
Authentication through username-password to get an access token
Parameters (POST)
----------
username: str
The API username
password: str
The API password
Returns
-------
{
'access_token': <str: your-access-token>,
'valid_until': {'$date': <int: epoch-time-in-milliseconds>},
}
2. Standorte
Alle Standorte
Die Liste aller Standorte.
URL: /all_installations
Methode: GET
Auth erforderlich: JA mit einem gültigen Token
Anfragelimite: 1/Sekunde
Parameters (GET)
----------
No parameter
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
-------
The list of all the sites, presented as a list of objects.
Informationen zu einem Standort
Die Parameter eines spezifischen Standorts.
URL: /installation_infos/<site_id>
Methode: GET
Auth erforderlich: JA mit einem gültigen Token
Anfragelimite: 1/Sekunde
Parameters (GET)
----------
site_id: str
The object ID of the installation site
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
-------
The parameters of the site:
{
'site_ref': <str>,
'name': <str>,
'address': {
'street_name': <str>,
'street_number': <str>,
'city': <str>,
'postal_code': <int>
},
'creation_date': <datetime isoformat str>,
'latitude': <float>,
'longitude': <float>,
'timezone': <str>,
}
3. Zähler
Alle Zähler eines Standorts
Die Liste aller Zähler eines Standorts.
URL: /meter_info/<site_id>
Methode: GET
Auth erforderlich: JA mit einem gültigen Token
Anfragelimite: 1/Sekunde
Parameters (GET)
----------
site_id: str
The object ID of the site
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
----------
The list of meters presented as a list of objects:
[
{
'id': <str representing the meter's id>
'type': {'electricity', 'heating', 'cold_water', 'hot_water'},
'name': <str>,
'mode': {'consumption', 'production', 'introduction', 'battery'},
'prim_ad': <int>,
'is_rule_meter': <boolean>
},
...
]
Die validierten Daten des Standorts für einen Zählertyp
Die validierten Zeitreihendaten des Standorts für einen spezifischen Zählertyp, z.B. den gesamten Stromverbrauch oder die PV-Produktion des Standorts.
URL: /site_data/<site_id>/<meter_type>
Methode: POST
Auth erforderlich: JA mit einem gültigen Token
Anfragelimite: 1/Sekunde
Parameters (GET)
----------
site_id: str
The object ID of the site
meter_type: str
The type of meter data:
'electricity', 'heating', 'cooling', 'cold_water', 'hot_water' or 'charge_point'
Parameters (POST)
----------
t_s: str, optional
The isoformatted datetime, representing the start instant of timeseries, tz-naive in UTC
t_e: str, optional
The isoformatted datetime, representing the stop instant of timeseries, tz-naive in UTC
*sampling_frequency: {'15T', 'H', 'D', 'M', 'Y'}, optional
The sampling frequency of the returned data list
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
-------
The validated time series data from the site for a specific type of metering, presented as a list of objects:
[
{
'conso_total': <total site consumption>,
'prod_total': <total site electricity (PV) production if type is electricity>,
'from_ext': <total site consumption from the grid if type is electricity>,
'self': <total site consumption from solar PV if type is electricity>,
'to_ext': <total site electricity exported to the grid if type is electricity>,
'timestamp': <timestamp at the end of the measured period if sampling_frequency is 15T, otherwise start of the period>
},
...
]
Die validierten Daten eines spezifischen Zählers
Die validierten Zeitreihendaten eines Zählers für den ausgewählten Zeitraum. Verfügbar für alle Zählertypen.
URL: /meter_data/<site_id>/<meter_id>
Methode: POST
Auth erforderlich: JA mit einem gültigen Token
Anfragelimite: 1/Sekunde
Parameters (GET)
----------
site_id: str
The ID of the site
meter_id: str
The ID of the meter
Parameters (POST)
----------
t_s: str, optional
The isoformatted datetime, representing the start instant of timeseries, tz-naive in UTC
t_e: str, optional
The isoformatted datetime, representing the stop instant of timeseries, tz-naive in UTC
sampling_frequency: {'15T', 'H', 'D', 'M', 'Y'}, optional
The sampling frequency of the returned data list
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
-------
The validated time series meter data for the selected period, presented as a list of objects:
[
{
'total': <total consumption. If type is electricity, total = self + ext>,
'self': <total consumption from solar PV if type is electricity>,
'ext': <total consumption from grid if type is electricity>,
'timestamp': <timestamp at the end of the measured period if sampling_frequency is 15T, otherwise start of the period>
},
...
]
Die Rohdaten eines spezifischen Zählers
Die Rohdaten, inkrementell (Zählerstand) oder differentiell (Intervall einer Lastkurve), in Zeitreihenform eines Zählers für den ausgewählten Zeitraum, direkt vom Zähler ohne Validierung. Nur verfügbar für physische Zähler und nicht für Regelzähler.
URL: /meter_data_raw/<site_id>/<meter_id>
Methode: POST
Auth erforderlich: JA mit einem gültigen Token
Anfragelimite: 1/Sekunde
Parameters (GET)
----------
site_id: str
The ID of the site
meter_id: str
The ID of the meter
Parameters (POST)
----------
t_s: str, optional
The isoformatted datetime, representing the start instant of timeseries, tz-naive in UTC
t_e: str, optional
The isoformatted datetime, representing the stop instant of timeseries, tz-naive in UTC
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
-------
The raw time series meter data for the selected period, presented as a list of objects:
[
{
'en_im': <electricity imported meter index if type is electricity>,
'en_ex': <electricity exported meter index if type is electricity>,
'heat_energy_kwh': <thermal energy index if type is heating or cooling>,
'vol_m3': <water volume index if type is cold_water or hot_water>,
'timestamp': <timestamp at the end of the measured period>
},
...
]
4. Sensoren
Alle Sensoren eines Standorts abrufen
URL: /<site_id>/sensors_list
Methode: GET
Auth erforderlich: JA mit einem gültigen Token
Parameters (URL)
----------
site_id: str
The ID of the installation site
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
-------
array_like
The list of sensors info formatted as follow:
[
{
'id': <str representing an ObjectID>
'name': <str>,
'type': <str describing the type of measured quantity>,
'unit': <str describing the unit of the measured quantity>,
'model': <str describing the model of the sensor>
},
...
]
Zeitreihendaten für einen spezifischen Sensor abrufen
Ruft die Zeitreihen eines Sensors für einen angegebenen Zeitraum ab. Wenn kein Zeitraum angegeben ist, werden die neuesten Daten zurückgegeben. t_s ist abhängig vom Benutzer/Standort begrenzt.
URL: /<site_id>/sensor_data/<sensor_id>
Methode: GET
Auth erforderlich: JA mit einem gültigen Token
Anfragelimite: 1/Sekunde
Parameters (URL)
----------
site_id: str
The ID of the installation site
sensor_id: str
The ID of the sensor object
Parameters (GET)
----------
t_s: str, optional
The isoformatted datetime, representing the start instant of the requested timeseries, tz-naive in UTC
t_e: str, optional
The isoformatted datetime, representing the end instant of the requested timeseries, tz-naive in UTC
Headers
----------
Content-Type: 'application/json'
Authorization: 'Bearer {your-access-token}'
Returns
-------
array_like
The timeseries sensor data of the selected period as a list of objects:
[
{
'timestamp': <int timestamp>,
'value': <float, int>
},
...
]