Indice dei contenuti

API locale del Gateway

L'API locale della passerella è utilizzata da un livello di sistema per leggere i dati di tutti i computer Modbus o MBus configurati e collegati a Gateway Climkit.

Le richieste devono essere effettuate localmente sulla stessa rete (LAN).

Punto di arrivo dell'API: http://<IP-ADDRESS-OF-THE-GATEWAY:8080/api/v1 (es: http://192.168.2.10:8080/api/v1)

1. Valori istantanei del contatore elettrico

URL : /meter/<prim_ad>/

Metodo : GET

Autenticazione richiesta : No

 Parameters (URL)
----------
prim_ad: int
The bus address of the electricity meter

Returns
-------
A dictionnary structured as

{
'L1_a': last_reading['L1_a'],
'L2_a': last_reading['L2_a'],
'L3_a': last_reading['L3_a'],
'total_W': last_reading['total_W'],
'ts': last_reading['ts'],
'valid': last_reading['connect'],
}

where last_reading is the last record of the meter reading (The frequency depends on the meter configuration, either 1 second or 15 minutes)

2. Valori del registro del contatore

URL : /meter/<meter_type>/<meter_ad>/

Metodo : GET

Autenticazione richiesta : No

 Parameters (URL)
----------
meter_type: str
The meter type in ['electricity', 'hot_water', 'cold_water', 'heating']
meter_ad: int
The bus address of the meter

Returns
-------
A dictionnary structured as
{
'L1_a': last_reading['L1_a'],
'L2_a': last_reading['L2_a'],
'L3_a': last_reading['L3_a'],
'total_W': last_reading['total_W'],
'ts': last_reading['ts'],
'valid': last_reading['connect']
}

where last_reading is the last record of the meter reading (The frequency depends on the meter type and configuration, either 1 second or 15 minutes).

The mapping meter-type -> registers is as follows:
{
'electricity': ['en_im', 'en_ex', 'L1_a', 'L2_a', 'L3_a', 'total_W'],
'hot_water': ['vol_m3'],
'cold_water': ['vol_m3'],
'heating': ['heat_energy_kwh', 'power_kw', 'diff_temp', 'flow_temp', 'vol_flow_m3_h'],
}

How did we do?

API Climkit

Contatto