Request to open Open API resources for lumi.switch.agl006 (Aqara Light Switch H2, 4-button 3-channel)

Hello Aqara Open API team,

Please open the Open API resources (read + write) for model lumi.switch.agl006 (Aqara Light Switch H2, 4-button / 3-channel).

Resource IDs needed: 4.1.85, 4.2.85, 4.3.85 (channel 1/2/3 on-off).

My Open API project AppId: 1511454599032094720b62d1 (Korea region, open-kr).

Use case: controlling my own H2 wall switch 3 channels from a custom home voice assistant, account-authorization mode on open-kr.aqara.com.

Currently query.resource.info {model: lumi.switch.agl006} returns and query.resource.value / write.resource.device return 302 ‘all resource not open’.

Thank you!

Hi. Try the following:

  1. query.device.info → Get the Device ID (did) of your H2 wall switch
  2. spec.query.specdevice.config → Use the did to fetch the traits
  3. spec.query.trait → Use the respective traits to get the current values
  4. spec.write.trait → Use the respective traits to control the device

Does this work instead?

1 Like

Thanks @JohnD! spec.query.trait works - I can read the OnOff state of my H2 switch channels (model lumi.switch.agl006, endpoints 2/3/4, functionCode Output, traitCode OnOff).

But spec.write.trait does NOT actuate. It returns code:0 (top-level AND per-item), but the response item shows value:null and the device state never changes (verified by reading back several seconds later; I tried value as bool true, int 1, and string “1”). spec.write.command with commandCode Toggle returns 403.

My request body:
{“intent”:“spec.write.trait”,“data”:{“traits”:[{“deviceId”:“lumi.54ef441001705a3a”,“endpointId”:2,“functionCode”:“Output”,“traitCode”:“OnOff”,“value”:true}]}}

Read works on the same project/token, so auth is fine. What is needed to actually WRITE/control the trait - a specific permission/scope, a different value format, or another step? (Account-authorization mode, Korea region, DEMO project.) Thank you!

Could you please post the response from spec.query.specdevice.config? And possibly also the response from spec.query.qlinkmodel.config (retrieved using the model). Please use the forum’s preformatted text feature for the output.

Unfortunately, I don’t have the Light Switch H2 myself, only the H2 Shutter Switch, and that one doesn’t have functionCode Output, traitCode OnOff. Also, I unfortunately can’t find the agl006 under “add virtual equipment” in the developer portal.