Query Total Energy Consumption of Node

Last Updated on : 2023-06-15 05:53:24

Query the total energy consumption of a specified node under the asset.

API address

GET: /v1.0/iot-03/energy/{energy_type}/space/nodes/statistics-sum

Request parameter

Parameter nameTypeINRequiredDescription
energy_typeStringuritrueThe energy type. Set the value to electricity.
energy_actionStringquerytrueThe energy behavior. Set the value to consume, representing energy consumption.
statistics_typeStringquerytrueThe statistical type. Valid values:
  • month: by month, in the format of yyyyMM. The maximum span is 12 months, and you can only query the data of the last 12 months.
  • day: by day, in the format of yyyyMMdd. The maximum span is 7 days, and you can only query the data of the last 90 days.
  • hour: by hour, in the format of yyyyMMddHH. The maximum span is 24 hours, and you can only query the data of the last 7 days.
start_timeStringquerytrueThe start time.
end_timeStringquerytrueThe end time.
space_idsStringquerytrueA collection of nodes.
contain_childsBooleanquerytrueIndicates whether to contain the data of the child nodes. Default value: true.

Return parameter

Parameter nameTypeDescription
resultFloatThe returned result.

Request example

GET: /v1.0/iot-03/energy/electricity/space/nodes/statistics-sum?energy_action=consume&statisticsType=day&startTime=20210925&endTime=20210926&containChilds=false&space_ids=147355207358382****,147355203680817****

Return example

{
    "result": 50,
    "t": 1641378388380,
    "success": true
}

Error code

For more information, see error code.