{"_id":"@aqara-claw/aqara-open-api","_rev":"2-ac930fb64fd4b2fa6cbad72bfd20707b","name":"@aqara-claw/aqara-open-api","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@aqara-claw/aqara-open-api","version":"0.1.0","keywords":["openclaw","绿米","aqara","aqara-open-api","smart-home","iot","device-control","json-rpc","mcp"],"license":"MIT","_id":"@aqara-claw/aqara-open-api@0.1.0","maintainers":[{"name":"lumi-root","email":"chao.xu@aqara.com"}],"dist":{"shasum":"25feea9f79b91072a5ea9747c4258b832aed9529","tarball":"https://registry.npmjs.org/@aqara-claw/aqara-open-api/-/aqara-open-api-0.1.0.tgz","fileCount":13,"integrity":"sha512-fPetnFuoJ90FG7r3Bje5UbQsJg27RMthhruDzF8MgqjsA7pGSKoCHY208u35YZJ9Qjxrs06jA/LspBP8MrIEHg==","signatures":[{"sig":"MEUCIQCBFqVAwNw0Z32qs2MP3ZdK8le0lbzt9BLZCSSZwciOWwIgZjvc5t0/ln2QYM2GrVfBKzYtyPVs5A2Nyh/VllP5Aos=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53505},"type":"module","gitHead":"9c892e2ebb9e7372797389b7afc5724efa060847","_npmUser":{"name":"lumi-root","email":"chao.xu@aqara.com"},"openclaw":{"install":{"npmSpec":"@aqara-claw/aqara-open-api","localPath":".","defaultChoice":"npm"},"extensions":["./index.ts"]},"_npmVersion":"10.9.2","description":"OpenClaw plugin for Aqara Open Platform API — device query, device status query, and device control via JSON-RPC MCP endpoint","directories":{},"_nodeVersion":"22.14.0","dependencies":{"zod":"^4.3.6","undici":"^7.0.0","@sinclair/typebox":"0.34.48"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","openclaw":"2026.2.13","typescript":"^5.7.0","@types/node":"^25.0.10"},"peerDependencies":{"openclaw":">=2026.2.13"},"_npmOperationalInternal":{"tmp":"tmp/aqara-open-api_0.1.0_1772260669843_0.7018259255235961","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aqara-claw/aqara-open-api","version":"0.2.0","type":"module","description":"OpenClaw plugin for Aqara Open Platform API support — device query, device status query, space management, and device control via HTTP API endpoint","license":"MIT","keywords":["openclaw","绿米","aqara","aqara-open-api","smart-home","iot","device-control","http-api"],"openclaw":{"extensions":["./index.ts"],"install":{"npmSpec":"@aqara-claw/aqara-open-api","localPath":"extensions/aqara-open-api","defaultChoice":"npm"}},"dependencies":{"@sinclair/typebox":"0.34.48","undici":"^7.0.0","zod":"^4.3.6"},"devDependencies":{"@types/node":"^25.0.10","openclaw":"2026.3.2","tsx":"^4.21.0","typescript":"^5.7.0"},"peerDependencies":{"openclaw":">=2026.3.2"},"_id":"@aqara-claw/aqara-open-api@0.2.0","gitHead":"27002c0c46e62ebbe2a456ebe02f8c2e17b38f8d","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-9XUBdtHAZ0LG032eKocK1g4pX16yDWd5xle/jmc5U4vq82NWctKoeVV0XppOhmUgVYYgoesANtmVu3566bFIQA==","shasum":"18d4b2b674642a09ea9fb3432812e113d4c7aad5","tarball":"https://registry.npmjs.org/@aqara-claw/aqara-open-api/-/aqara-open-api-0.2.0.tgz","fileCount":13,"unpackedSize":71785,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCqmjHo6GdjUORLt4SuqE6oboF+BWHWFsZV9IjZ3CnahQIhAMEID7GFPRv7w6sKAoBofDW+DttCmo+ao3M8JS0QbKuJ"}]},"_npmUser":{"name":"lumi-root","email":"chao.xu@aqara.com"},"directories":{},"maintainers":[{"name":"lumi-root","email":"chao.xu@aqara.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aqara-open-api_0.2.0_1773059074020_0.5501043147669447"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-28T06:37:49.754Z","modified":"2026-03-09T12:24:34.294Z","0.1.0":"2026-02-28T06:37:50.001Z","0.2.0":"2026-03-09T12:24:34.160Z"},"license":"MIT","keywords":["openclaw","绿米","aqara","aqara-open-api","smart-home","iot","device-control","http-api"],"description":"OpenClaw plugin for Aqara Open Platform API support — device query, device status query, space management, and device control via HTTP API endpoint","maintainers":[{"name":"lumi-root","email":"chao.xu@aqara.com"}],"readme":"# @aqara-claw/aqara-open-api\n\nOpenClaw plugin for **Aqara Studio Open Platform** APIs.\n\nThis plugin supports device discovery, status query, device control, and space management via the Aqara Studio Open API.\n\n## Features\n\n- **Unified API transport**: all requests go through `POST /open/api/v1` with `type` routing.\n- **Proxy bypass**: uses a direct-connect HTTP agent so requests do not route through `HTTP_PROXY` or `HTTPS_PROXY`.\n- **IPv4 priority**: forces `dns.setDefaultResultOrder(\"ipv4first\")` to reduce DNS-related connection issues.\n- **Unified device cache**: `aqara_load_all_devices` fetches devices, endpoints, traits, current values, and spaces in one call and reuses the cached result.\n- **Environment variable fallback**: `access_token` can be provided via `AQARA_OPEN_API_TOKEN`.\n\n## Install\n\n```bash\nopenclaw plugins install @aqara-claw/aqara-open-api\n```\n\n## Upgrade\n\n```bash\nopenclaw plugins update aqara-open-api\n```\n\n## Example config\n\nIn `~/.openclaw/openclaw.json`:\n\n```jsonc\n{\n  \"tools\": {\n    \"profile\": \"full\",\n    \"allow\": [\"*\"]\n  },\n  \"plugins\": {\n    \"allow\": [\"aqara-open-api\"],\n    \"entries\": {\n      \"aqara-open-api\": {\n        \"enabled\": true,\n        \"config\": {\n          \"endpoint_url\": \"https://xxx.aqara.cn\",\n          \"access_token\": \"<YOUR_AQARA_OPEN_API_TOKEN>\"\n        }\n      }\n    }\n  }\n}\n```\n\n## Configuration\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `endpoint_url` | `string` | — | Aqara Open Platform base URL. Requests go to `{endpoint_url}/open/api/v1` |\n| `access_token` | `string` | — | Bearer token, or set `AQARA_OPEN_API_TOKEN` in env |\n| `timeoutMs` | `number` | `15000` | HTTP request timeout in milliseconds |\n\n## Request data specification\n\nFor tools that accept `endpointId` such as `aqara_control_device`:\n\n- `endpointId` must be taken from the device info returned by `aqara_load_all_devices`.\n- Do not create, invent, or guess an `endpointId`.\n- `deviceId`, `functionCode`, and `traitCode` must also come from `aqara_load_all_devices`.\n\n## Agent Tools (7)\n\n| Tool | Purpose | API Type |\n| --- | --- | --- |\n| `aqara_load_all_devices` | Load all devices with endpoints, traits, current values, and space info; cached after first call | `GetAllDevicesWithSpaceRequest` |\n| `aqara_load_device_type_infos` | Load all device types in the project with code and display name; cached after first call | `GetDeviceTypeInfosRequest` |\n| `aqara_control_device` | Control one or more device functions | `ExecuteTraitRequest` |\n| `aqara_list_spaces` | Query the full space tree | `GetSpacesRequest` |\n| `aqara_create_space` | Create a space | `CreateSpaceRequest` |\n| `aqara_update_space` | Update space name or spatial marking | `UpdateSpaceRequest` |\n| `aqara-assign_devices_to_space` | Associate devices to a space in batch | `AssociateDevicesToSpaceRequest` |\n\n## Typical workflow\n\n```text\n1. aqara_load_all_devices         → Load device + endpoint + trait + space data into cache\n2. aqara_control_device           → Control using IDs/codes from cache\n3. aqara_list_spaces              → View full space hierarchy\n4. aqara-assign_devices_to_space  → Associate devices to a space\n```\n\n## Conversation examples\n\n| User says | Tool to call | Notes |\n| --- | --- | --- |\n| \"What devices do I have?\" | `aqara_load_all_devices` | Returns all devices with full config and current values |\n| \"Turn on the living room light\" | `aqara_control_device` | Call `aqara_load_all_devices` first to get `endpointId` and trait info |\n| \"What's the bedroom temperature?\" | `aqara_load_all_devices` | Read the trait value directly from cached device data |\n| \"Turn off all lights\" | `aqara_control_device` | Batch control multiple devices using cached IDs and codes |\n| \"Show my home space structure\" | `aqara_list_spaces` | Returns the space tree |\n| \"Put this device in the living room\" | `aqara-assign_devices_to_space` | Associate a device to a space |\n\n## Skills\n\nThe plugin ships with a built-in skill at `skills/aqara-open-api/SKILL.md` that constrains the agent to:\n\n- never guess `deviceId`, `endpointId`, `functionCode`, or `traitCode`\n- always load real device data before control or state interpretation\n- prefer filtering by `deviceTypesList` when the user asks by device type\n\n## Project structure\n\n```text\naqara-open-api/\n├── index.ts\n├── openclaw.plugin.json\n├── package.json\n├── tsconfig.json\n├── skills/\n│   └── aqara-open-api/\n│       └── SKILL.md\n└── src/\n    ├── types.ts\n    ├── config-schema.ts\n    ├── runtime.ts\n    ├── api-client.ts\n    ├── store.ts\n    └── tools/\n        ├── schemas.ts\n        ├── actions.ts\n        └── index.ts\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}