Energy Consumption Sensors
Reporting Accumulated Energy in Wh and VARh
The HTTP integration of energy sensors uses the following structure:
POST /services/gear/DeviceIntegrationService.svc/UpdateEnergySensorValueSummation HTTP/1.1
Host: gear.cloud.studio
Content-Type: application/json
{
"accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"endpointID": 1,
"activeEnergySummationWh": 112685.9,
"reactiveEnergySummationVARh": 18973.4,
"timestamp": "2021-02-23T14:55:03"
}Parameters
| Name | Description | Data Type |
|---|---|---|
| accessToken | Access token with permissions to update endpoint information. See this page for more information. | text |
| endpointID | Unique endpoint identifier or combination of device address and endpoint address in format [deviceAddress]:endpointAddress (e.g.: [device-1234]:1). These values can be found on the endpoint management page. | numeric |
| activeEnergySummationWh | Valor acumulado de energía activa informado por el sensor, expresado en watt-hora (Wh). | numeric |
| reactiveEnergySummationVARh | Valor acumulado de energía reactiva informado por el sensor, expresado en volt-ampere-reactivo-hora (VARh). | numeric |
| timestamp | Optional value indicating the UTC date and time corresponding to the measurement. The date format must match one of those specified in the date formats section. If the field is omitted, the platform will assume the measurement corresponds to the current date and time. | text |
Reporting Accumulated Energy in "raw" Format
Accumulated energy can be reported as a raw value using the expression converter. This option is convenient when the device is unable to perform conversions and emits values that need to be transformed before being injected into the platform.
Below is an example of a raw format request:
POST /services/gear/DeviceIntegrationService.svc/UpdateFlowSensorValueSummationRaw HTTP/1.1
Host: gear.cloud.studio
Content-Type: application/json
{
"accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"endpointID": 1,
"rawData": "112685.9,18973.4",
"timestamp": "2021-02-23T14:55:03"
}Como puede verse en este ejemplo, el campo RawData combina el acumulado de energía activa y el acumulado de energía reactiva en un único string, en el que ambos valores están separados por una coma.
Parameters
| Name | Description | Data Type |
|---|---|---|
| accessToken | Access token with permissions to update endpoint information. See this page for more information. | text |
| endpointID | Unique endpoint identifier, which can be found on the endpoint management page. | numeric |
| rawData | Valor reportado por el sensor, como texto. Deben indicarse dos expresiones en el conversor de expresiones. La primera expresión se utiliza para obtener la energía activa acumulada a partir de la variable rawData. La expresión debe devolver un valor numérico indicando expresado en expresado en watt-hora (Wh). En el ejemplo anterior, podría utilizarse la siguiente expresión:ToNumber(StringPart(rawData, 1, ','))La segunda expresión se utiliza para obtener la energía reactiva acumulada a partir de la variable rawData. La expresión debe devolver un valor numérico indicando expresado en expresado volt-ampere-reactivo-hora (VARh). En el ejemplo anterior, podría utilizarse la siguiente expresión:ToNumber(StringPart(rawData, 2, ',')) | text |
| timestamp | Optional value indicating the UTC date and time corresponding to the measurement. The date format must match one of those specified in the date formats section. If the field is omitted, the platform will assume the measurement corresponds to the current date and time. | text |