npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aqara-claw/aqara-open-api

v0.2.0

Published

OpenClaw plugin for Aqara Open Platform API support — device query, device status query, space management, and device control via HTTP API endpoint

Readme

@aqara-claw/aqara-open-api

OpenClaw plugin for Aqara Studio Open Platform APIs.

This plugin supports device discovery, status query, device control, and space management via the Aqara Studio Open API.

Features

  • Unified API transport: all requests go through POST /open/api/v1 with type routing.
  • Proxy bypass: uses a direct-connect HTTP agent so requests do not route through HTTP_PROXY or HTTPS_PROXY.
  • IPv4 priority: forces dns.setDefaultResultOrder("ipv4first") to reduce DNS-related connection issues.
  • Unified device cache: aqara_load_all_devices fetches devices, endpoints, traits, current values, and spaces in one call and reuses the cached result.
  • Environment variable fallback: access_token can be provided via AQARA_OPEN_API_TOKEN.

Install

openclaw plugins install @aqara-claw/aqara-open-api

Upgrade

openclaw plugins update aqara-open-api

Example config

In ~/.openclaw/openclaw.json:

{
  "tools": {
    "profile": "full",
    "allow": ["*"]
  },
  "plugins": {
    "allow": ["aqara-open-api"],
    "entries": {
      "aqara-open-api": {
        "enabled": true,
        "config": {
          "endpoint_url": "https://xxx.aqara.cn",
          "access_token": "<YOUR_AQARA_OPEN_API_TOKEN>"
        }
      }
    }
  }
}

Configuration

| Option | Type | Default | Description | | --- | --- | --- | --- | | endpoint_url | string | — | Aqara Open Platform base URL. Requests go to {endpoint_url}/open/api/v1 | | access_token | string | — | Bearer token, or set AQARA_OPEN_API_TOKEN in env | | timeoutMs | number | 15000 | HTTP request timeout in milliseconds |

Request data specification

For tools that accept endpointId such as aqara_control_device:

  • endpointId must be taken from the device info returned by aqara_load_all_devices.
  • Do not create, invent, or guess an endpointId.
  • deviceId, functionCode, and traitCode must also come from aqara_load_all_devices.

Agent Tools (7)

| Tool | Purpose | API Type | | --- | --- | --- | | aqara_load_all_devices | Load all devices with endpoints, traits, current values, and space info; cached after first call | GetAllDevicesWithSpaceRequest | | aqara_load_device_type_infos | Load all device types in the project with code and display name; cached after first call | GetDeviceTypeInfosRequest | | aqara_control_device | Control one or more device functions | ExecuteTraitRequest | | aqara_list_spaces | Query the full space tree | GetSpacesRequest | | aqara_create_space | Create a space | CreateSpaceRequest | | aqara_update_space | Update space name or spatial marking | UpdateSpaceRequest | | aqara-assign_devices_to_space | Associate devices to a space in batch | AssociateDevicesToSpaceRequest |

Typical workflow

1. aqara_load_all_devices         → Load device + endpoint + trait + space data into cache
2. aqara_control_device           → Control using IDs/codes from cache
3. aqara_list_spaces              → View full space hierarchy
4. aqara-assign_devices_to_space  → Associate devices to a space

Conversation examples

| User says | Tool to call | Notes | | --- | --- | --- | | "What devices do I have?" | aqara_load_all_devices | Returns all devices with full config and current values | | "Turn on the living room light" | aqara_control_device | Call aqara_load_all_devices first to get endpointId and trait info | | "What's the bedroom temperature?" | aqara_load_all_devices | Read the trait value directly from cached device data | | "Turn off all lights" | aqara_control_device | Batch control multiple devices using cached IDs and codes | | "Show my home space structure" | aqara_list_spaces | Returns the space tree | | "Put this device in the living room" | aqara-assign_devices_to_space | Associate a device to a space |

Skills

The plugin ships with a built-in skill at skills/aqara-open-api/SKILL.md that constrains the agent to:

  • never guess deviceId, endpointId, functionCode, or traitCode
  • always load real device data before control or state interpretation
  • prefer filtering by deviceTypesList when the user asks by device type

Project structure

aqara-open-api/
├── index.ts
├── openclaw.plugin.json
├── package.json
├── tsconfig.json
├── skills/
│   └── aqara-open-api/
│       └── SKILL.md
└── src/
    ├── types.ts
    ├── config-schema.ts
    ├── runtime.ts
    ├── api-client.ts
    ├── store.ts
    └── tools/
        ├── schemas.ts
        ├── actions.ts
        └── index.ts

License

MIT