Aqara · Schema

TraitValueResponse

Smart HomeIoTConsumer ElectronicsHome AutomationSecurity

Properties

Name Type Description
type string 消息类型。
version string 接口版本。
msgId string 消息 ID。
code integer 业务状态码,0 表示成功。
message string 提示信息。
data array
View JSON Schema on GitHub

JSON Schema

aqara-trait-value-response-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aqara/json-schema/aqara-trait-value-response-schema.json",
  "title": "TraitValueResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiot-api-zh.yaml#/components/schemas/TraitValueResponse",
  "allOf": [
    {
      "$ref": "#/$defs/BaseResponse"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TraitValueResult"
          }
        }
      }
    }
  ],
  "$defs": {
    "BaseResponse": {
      "type": "object",
      "required": [
        "type",
        "version",
        "msgId",
        "code"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "消息类型。"
        },
        "version": {
          "type": "string",
          "description": "接口版本。"
        },
        "msgId": {
          "type": "string",
          "description": "消息 ID。"
        },
        "code": {
          "type": "integer",
          "description": "业务状态码,0 表示成功。"
        },
        "message": {
          "type": "string",
          "description": "提示信息。"
        }
      }
    },
    "FlexibleValue": {
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "integer"
        },
        {
          "type": "number",
          "format": "double"
        },
        {
          "type": "string"
        }
      ],
      "description": "动态值,具体类型取决于 trait/command 定义。\n推荐值类型来源规则:\n1) trait 场景优先读取同级 parameter.type;\n2) command 场景优先读取对应 field 的 parameter.type;\n3) 当 parameter.type=Enum 时,值类型是string;\n4) 若缺少 parameter 或类型未识别,按 string 兜底并保留原始值。\n"
    },
    "TraitValueResult": {
      "type": "object",
      "required": [
        "deviceId",
        "endpointId",
        "functionCode",
        "traitCode",
        "value",
        "time"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "description": "设备 ID。"
        },
        "endpointId": {
          "type": "integer",
          "description": "端点 ID。"
        },
        "functionCode": {
          "type": "string",
          "description": "功能编码。"
        },
        "traitCode": {
          "type": "string",
          "description": "功能点代码。"
        },
        "value": {
          "$ref": "#/$defs/FlexibleValue",
          "description": "当前值。类型与 trait 的 parameter.type 的值保持一致。"
        },
        "time": {
          "type": "integer",
          "format": "int64",
          "description": "值更新时间(毫秒级 UTC 时间戳)。"
        }
      }
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/aqara-trait-value-response"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.