UPDATE 2016-10-29
As of version 0.81, the new buttons and wireless wall switches are fully supported, so no need for this hack anymore
\UPDATE
I bought a new Xiaomi Aqara button, model WXKG11LM, and added it to my gateway. No worries, gateway picked it up and sees press, double press and hold.
Hass.io, on the other hand, knows nothing about it… I was getting a detection error with a payload of {‘cmd’: ‘read_ack’, ‘model’: ‘remote.b1acn01’, ‘sid’: ‘158d0001e79089’, ‘short_id’: 2100, ‘data’: ‘{“voltage”:3165}’} It turns out there are two different 2nd gen buttons, One which is detected as sensor_switch.aq2 and the newer one which is detected as remote.b1acn01. And while the sensor_switch.aq2 only has single and double click_types, the remote.b1acn01 has all of the click_type of the 1st generation button.
Checking the PyXiaomiGateway project on GitHub, the new 2nd generation button has been added to the xiaomi_gateway __init__.py, but this hasn’t made it through to Hass.io yet.
No problem… grab the __init__.py file from GitHub, create a directory called xiaomi_gateway under config, and put the file in there (Note, NOT config/custom-components/xiaomi_gateway). Sometimes the very last line loses its indentation which breaks everything Xiaomi, so check it and make sure it’s still indented correctly. But all of this this still didn’t work, the button was still not detected….
Further digging showed that it also has to be added to xiaomi_aqara.py file in binary_sensor. No problem, head over to to the raw file on GitHub and grab it. If you don’t already have one, create a directory called custom_components under config. In this directory, create a new directory called binary_sensor in in this directory create a new file called xiaomi_aqara.py, and paste the raw file into it. Then edit line 39 and change it from:
'sensor_switch.aq2', 'sensor_switch.aq3']:
to
'sensor_switch.aq2', 'sensor_switch.aq3', 'remote.b1acn01']:
And restart Home Assistant