[OBSOLETE] Device Handler for Aqara Wired Wall Switch

Hi @lpthanh do u own a Aqara Wirless Wall Switch WXKG02LM (2018 revision)? I am trying out your Main-Child method with it to see if it can work for the new ST app. This is because the new ST app only allows us to set actions for 3 interactions (Press/Double/Hold) but there are a total of 9 interactions (Single Left/Single Right/Single Both/Double Left/Double Right/Double Both/Hold Left/Hold Right/Hold Both). The concept is very similar to yours,

  • Main: Allow us to set actions for Single Both/Double Both/Hold Both
  • Child: Main will create 2 child, one for left, one for right. This allow us to set the automation for individual Single Left/Double Left/Hold Left and Single Right/Double Right/Hold Right.

I use the DTH from Original & Aqara Xiaomi Zigbee Sensors (contact, temp, motion, button, outlet, leak, etc) as the base. I am able to get it to create 2 child buttons and also create the button event for the child buttons, but I can’t seem to get the child buttons to work at all, it is neither detecting the interactions or allowing me to set actions for it. As this is the first DTH I am working on, was wondering if I could show the code for you to have a look too? And maybe point me in a direction? Thanks!