Add Monitoring Metrics

Last Updated on : 2023-06-15 06:01:46

Add a monitoring metric for a specified device.

API address

POST: /v1.0/iot-03/si/products/{tuya_product_id}/monitor-indicator

Request parameter

Parameter nameTypeINRequiredDescription
tuya_product_idStringuritrueThe ID of a Tuya product.

Description of body

Parameter nameTypeINRequiredDescription
indicator_codeString trueThe code of a specified metric.
monitor_typeString trueThe type of a specified metric.
  • core_monitor: general industrial metric.
  • energy_collect: industrial energy consumption metric.
  • environment: industrial environment metric.
  • other: others.

Return parameter

Parameter nameTypeDescription
resultBooleanIndicates whether the operation is successful.

Request example

POST: /v1.0/iot-03/si/products/pn****/monitor-indicator
{
  "indicator_code": "swtich****",
  "monitor_type": "core_monitor"
}

Return example

{
    "result": true,
    "t": 1635498361848,
    "success": true
}

Error code

For more information, see error code.