I’m building a personal self-hosted dashboard using the Aqara Open API to monitor and control my own home devices. Read/write works for many models, but my E1 wall switches have no open resources for my project.
query.resource.info for both models returns 0 resources.
query.resource.value and write.resource.device on these devices (resources 4.1.85 / 4.2.85) fail with:
{ “code”: 302, “msgDetails”: “all resource not open” }
Authentication is correct — the doorbell (lumi.camera.agl002) and battery resources (8.0.2001) work fine on this same project. These switch models are simply not opened for Open API access.
Request: please open the following resources for lumi.switch.b1nc01 and lumi.switch.b2nc01 on my project so they can be read and controlled via the Open API:
4.1.85 — channel 1 switch status (read + write)
4.2.85 — channel 2 switch status (read + write, for b2nc01)
Use case: personal home automation. A self-hosted dashboard that lists all wall switches by room, shows live on/off state, and lets me toggle them — already working for other Aqara devices in the same home. Thanks in advance for your help.
Does a request with spec.query.qlinkmodel.config return a response?
From the response, you should be able to extract the endpointId, the functionCode, and the traitCode, and then send them to the API using spec.write.trait.
Thanks John — big progress! spec.query.qlinkmodel.config works when models is passed as an array: {"models":["lumi.switch.b1nc01","lumi.switch.b2nc01"]}.
From the response I extracted the On/Off trait for the E1 switches:
endpoint deviceType Switch → endpointId 2 (b1nc01); b2nc01 has two, endpointId 2 and 3 (one per rocker)
But every spec.write.trait returns code 302 (Request failed). I’ve tried, for a real device subjectId:
{"subjectId":"<did>","endpointId":2,"functionId":132,"traitCode":"OnOff","value":1} (also with traitId:32920, value:true)
array form [{...}] → returns code 303
wrappers {"data":[...]}, {"traits":[...]}, {"spec":[...]}, and did instead of subjectId
Could you share the exact request body spec.write.trait expects (and the matching read intent for the current OnOff state)? I’ll post the full working example here for the E1 wall switches once I have it. Thanks!
I pulled the E1 spec via spec.query.qlinkmodel.config {“models”:[…]} — endpoint Switch, endpointId 2 (and 3 on the double b2nc01), functionId 132 (Output), traitId 32920 / traitCode OnOff, Bool, writable.
But spec.write.trait and spec.query.trait return code 302 for every payload I try — and, importantly, they return 302 even for a device that already works via the legacy resource API (my doorbell lumi.camera.agl002, just reading its FirmwareRevision trait). So this doesn’t look like a payload/schema issue — it looks like the spec.*.trait intents aren’t enabled for my project (App ID 151357164167156531203010, region open-ger).
Is there a provisioning step to enable the spec trait intents for a project, or does Customer Service have to open them (same as the resource-level open request)? Thanks a lot for the pointers!