Aqara lightswitch - two way control

Hi there,

A new HE user here, getting to grips with the hubitat way of doing things. I wonder if I could ask for some advice.

I have an Aqara lightswitch, model QBKG12LM of the type shown here. This is a wired double switch that allows the button pushes to be transmitted over zigbee, and (I hope) the wired lights to be controlled via HE.

I have installed the driver from here and have been able to successfully get the Aqar buttons to control other lights. What I can't figure out though, is how to get other buttons or rules to turn the lights wired into the Aqara buttons on and off.

Any help would be much appreciated!

Many thanks,

Chris

Bump... if anyone with some more experience of hubitat or the aqara switches can help I would really appreciate it.
Cheers.

I don't have the Aqara buttons, but just installed the double-relay which uses the same driver. I think the buttons are very close to the relay in design. So you should be able to call up the button child app as a switch action in a rule machine rule.

1 Like

Hiya,

Thanks very much for the tips. You'll have to excuse me as I'm not entirely clear exactly how to do what you describe. If you could check my approach and explain further/give me a nudge in the right direction it would be appreciated.

Here's what I'm doing:

  • Add a machine rule app
  • Add a new rule
  • Give it a name
  • Select condition (I chose mode is night so I can test it easily via the dashboard by changing the mode)
  • Define the rule ("Mode is night")
  • Select actions... this is where I start being uncertain - what action type would call up the "button child app"? (Also, what is a "button child app"? I can't find any decent documentation that describes what the child functionality is so I'm working a little in the dark to start with!)
    - I've had a stab at selecting the "Set mode or global variables, push buttons" action
    - Then select "Push a button"
    - I can then choose the "Bedroom switch" (which is what I have called the Aqara switch)
    - I can then choose a button number (1 or 2)
    - I can then choose the button operation to be "push"

However, changing the mode to and from night doesn't seem to turn the lights on and off.

Is it because the "button" functionality is treated separately from the "light" functionality in these switches? If so, I'm not sure how to "call up" the light functionality, as HE seems to just treat the device as a button, and I need to be able to call it up as both in different circumstances. (I have no problem using HE to use these buttons to control other lights)

Thoughts?

The driver consists of two parts.

  • The parent driver, this is what implements the buttons.
  • The child devices, these are the switches (relays).

You should add one more driver to your hub (Generic Child Switch) if you haven't already done so, set Number of buttons to 2 on your device's page and then push Recreate Child Devices. Two more devices will appear, those are your "switches".

In RM, you'll need the switch capability of those child devices.

3 Likes

Fantastic - thank you so much!

Just to check... have I missed documentation somewhere that explains this kind of functionality, or is the only real source of knowledge this forum?

The documentation is constantly evolving, it can be useful in some cases, but you used my custom driver, and it's obviously not mentioned in the official docs.

What I usually do when I use custom DTHs is checking the logs, and understanding the source code. The DTHs are usually not that complicated, so their behavior can be deciphered from the code...

Well it's working now, and your help is much appreciated - thank you.

I have a long learning journey to go on...

Perhaps you could share with me how you made it worked.