Aqara cube/MFKZQ01LM Question on "Tap" action

I’ve managed to pair my cube to my Z2M network, It took a few attempts to do so. I now have almost all of the actions working except for “Tap” action.
It’s silly I know, however no matter how many times I tap a finger or something with a little more weight like a pen or a screwdriver on the cube I see no “Tap” action.

Did I miss a handshake during pairing ? Or maybe I have a version without a “Tap” action? This is the DB entry for the cube:

{"id":11,"type":"EndDevice","ieeeAddr":"0x00158d00029bbdb0","nwkAddr":58872,"manufId":4151,"epList":[1,2,3],"status":"online","joinTime":1561088985,"endpoints":{"1":{"profId":260,"epId":1,"devId":24321,"inClusterList":[0,3,18,25],"outClusterList":[0,3,4,5,18,25],"clusters":{}},"2":{"profId":260,"epId":2,"devId":24322,"inClusterList":[3,18],"outClusterList":[3,4,5,18],"clusters":{}},"3":{"profId":260,"epId":3,"devId":24323,"inClusterList":[3,12],"outClusterList":[3,4,5,12],"clusters":{}}},"_id":"KYVluBVge5W0OqTR"}
{"id":11,"type":"EndDevice","ieeeAddr":"0x00158d00029bbdb0","nwkAddr":58872,"manufId":4151,"modelId":"lumi.sensor_cube.aqgl01","epList":[1,2,3],"status":"online","joinTime":1561088985,"endpoints":{"1":{"profId":260,"epId":1,"devId":24321,"inClusterList":[0,3,18,25],"outClusterList":[0,3,4,5,18,25],"clusters":{}},"2":{"profId":260,"epId":2,"devId":24322,"inClusterList":[3,18],"outClusterList":[3,4,5,18],"clusters":{}},"3":{"profId":260,"epId":3,"devId":24323,"inClusterList":[3,12],"outClusterList":[3,4,5,12],"clusters":{}}},"_id":"KYVluBVge5W0OqTR"}
{"id":11,"type":"EndDevice","ieeeAddr":"0x00158d00029bbdb0","nwkAddr":58872,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.sensor_cube","epList":[1,2,3],"status":"online","joinTime":1561088985,"endpoints":{"1":{"profId":260,"epId":1,"devId":24321,"inClusterList":[0,3,18,25],"outClusterList":[0,3,4,5,18,25],"clusters":{}},"2":{"profId":260,"epId":2,"devId":24322,"inClusterList":[3,18],"outClusterList":[3,4,5,18],"clusters":{}},"3":{"profId":260,"epId":3,"devId":24323,"inClusterList":[3,12],"outClusterList":[3,4,5,12],"clusters":{}}},"_id":"KYVluBVge5W0OqTR"}
{"id":11,"type":"EndDevice","ieeeAddr":"0x00158d00029bbdb0","nwkAddr":58872,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.sensor_cube","epList":[1,2,3],"status":"online","joinTime":1561088985,"endpoints":{"1":{"profId":260,"epId":1,"devId":24321,"inClusterList":[0,3,18,25],"outClusterList":[0,3,4,5,18,25],"clusters":{}},"2":{"profId":260,"epId":2,"devId":24322,"inClusterList":[3,18],"outClusterList":[3,4,5,18],"clusters":{}},"3":{"profId":260,"epId":3,"devId":24323,"inClusterList":[3,12],"outClusterList":[3,4,5,12],"clusters":{}}},"_id":"KYVluBVge5W0OqTR"}
{"id":11,"type":"EndDevice","ieeeAddr":"0x00158d00029bbdb0","nwkAddr":58872,"manufId":4151,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.sensor_cube","epList":[1,2,3],"status":"online","joinTime":1561088985,"endpoints":{"1":{"profId":260,"epId":1,"devId":24321,"inClusterList":[0,3,18,25],"outClusterList":[0,3,4,5,18,25],"clusters":{"genBasic":{"dir":{"value":3},"attrs":{"modelId":"lumi.sensor_cube.aqgl01"}},"genIdentify":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":2},"attrs":{}},"genScenes":{"dir":{"value":2},"attrs":{}},"genMultistateInput":{"dir":{"value":3},"attrs":{}},"genOta":{"dir":{"value":3},"attrs":{}}}},"2":{"profId":260,"epId":2,"devId":24322,"inClusterList":[3,18],"outClusterList":[3,4,5,18],"clusters":{"genIdentify":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":2},"attrs":{}},"genScenes":{"dir":{"value":2},"attrs":{}},"genMultistateInput":{"dir":{"value":3},"attrs":{}}}},"3":{"profId":260,"epId":3,"devId":24323,"inClusterList":[3,12],"outClusterList":[3,4,5,12],"clusters":{"genIdentify":{"dir":{"value":3},"attrs":{}},"genGroups":{"dir":{"value":2},"attrs":{}},"genScenes":{"dir":{"value":2},"attrs":{}},"genAnalogInput":{"dir":{"value":3},"attrs":{}}}}},"_id":"KYVluBVge5W0OqTR"}

So how does a “tap” action work on a Aqara cube?

Many thanks.

I think you should tap the cube on a surface. So pick up the cube and tap it on the surface.

That works.
Its still tricky triggering but it works.

Thanks for tip, or tap even. :smile:

that TAP i hate it!!!
it was why i ordered the damn thing hhhh
but the Shake is cool much better than the TAP :slight_smile:

i made small node-red flow if anyone is interested, it will take a number of commands
i need to tweak it some more getting allot of false but its a good start

[{“id”:“106d05be.063f2a”,“type”:“mqtt in”,“z”:“9f4a7111.37acd”,“name”:“”,“topic”:“zigbee2mqtt/Cube1”,“qos”:“2”,“datatype”:“auto”,“broker”:“1bf2fc63.c5e7a4”,“x”:391.85069274902344,“y”:158.6672821044922,“wires”:[[“aad61f8c.ba46”]]},{“id”:“aad61f8c.ba46”,“type”:“json”,“z”:“9f4a7111.37acd”,“name”:“”,“property”:“payload”,“action”:“”,“pretty”:false,“x”:571.8506927490234,“y”:158.6672821044922,“wires”:[[“e3e73ac2.abeb28”]]},{“id”:“28768d26.731e32”,“type”:“batcher”,“z”:“9f4a7111.37acd”,“name”:“Action”,“maxTopics”:1,“maxMessagesPerTopic”:10,“maxDelay”:“1500”,“x”:871.8506927490234,“y”:158.6672821044922,“wires”:[[“25d693dd.68acfc”]]},{“id”:“e3e73ac2.abeb28”,“type”:“change”,“z”:“9f4a7111.37acd”,“name”:“”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:“payload.action”,“tot”:“msg”}],“action”:“”,“property”:“”,“from”:“”,“to”:“”,“reg”:false,“x”:721.8506927490234,“y”:158.6672821044922,“wires”:[[“28768d26.731e32”]]},{“id”:“25d693dd.68acfc”,“type”:“json”,“z”:“9f4a7111.37acd”,“name”:“”,“property”:“payload”,“action”:“”,“pretty”:false,“x”:991.8506927490234,“y”:158.6672821044922,“wires”:[[“7348336b.80aa8c”,“4b31da81.e68f14”,“1ebec6a7.1d0269”,“78e10c5d.862e64”,“44f63e58.c8be7”,“7ffd82b7.b89c5c”,“b416229.4ad89e”,“9b524a49.9e0e08”,“17457e72.1a8362”,“91b9c43b.cbb248”]]},{“id”:“7348336b.80aa8c”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“Left Right Right”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“cont”,“v”:“"rotate_left","rotate_right","rotate_right"”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1180,“y”:160,“wires”:[]},{“id”:“78e10c5d.862e64”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“Flip Right”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“cont”,“v”:“"flip90","rotate_right"”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1161.8506927490234,“y”:278.6672821044922,“wires”:[]},{“id”:“4b31da81.e68f14”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“Left Right Right”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“cont”,“v”:“"rotate_right","rotate_left","rotate_left"”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1180,“y”:200,“wires”:[]},{“id”:“1ebec6a7.1d0269”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“180”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“["flip180"]”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1150,“y”:240,“wires”:[]},{“id”:“44f63e58.c8be7”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“Flip Left”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“cont”,“v”:“"flip90","rotate_left"”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1161.8506927490234,“y”:318.6672821044922,“wires”:[]},{“id”:“7ffd82b7.b89c5c”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“Right Right”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“["rotate_right","rotate_right"]”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1170,“y”:360,“wires”:[]},{“id”:“b416229.4ad89e”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“Left Left”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“["rotate_left","rotate_left"]”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1160,“y”:400,“wires”:[]},{“id”:“9b524a49.9e0e08”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“tap”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“["tap"]”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1150,“y”:440,“wires”:[]},{“id”:“17457e72.1a8362”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“shake”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“["shake"]”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1150,“y”:487,“wires”:[]},{“id”:“91b9c43b.cbb248”,“type”:“switch”,“z”:“9f4a7111.37acd”,“name”:“Flip Flip”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“["flip90","flip90"]”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:1160,“y”:527,“wires”:[]},{“id”:“1bf2fc63.c5e7a4”,“type”:“mqtt-broker”,“z”:“”,“name”:“”,“broker”:“192.168.1.103”,“port”:“1883”,“clientid”:“”,“usetls”:false,“compatmode”:true,“keepalive”:“60”,“cleansession”:true,“birthTopic”:“”,“birthQos”:“0”,“birthPayload”:“”,“closeTopic”:“”,“closePayload”:“”,“willTopic”:“”,“willQos”:“0”,“willPayload”:“”}]

What is the correct procedure for implementing the cube into Home Assistant?
I have tried this from the guide https://www.zigbee2mqtt.io/devices/MFKZQ01LM.html
Pairing with z2m is okay.

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/xiaomi_cube"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.action }}"

but i guessed its outdated and tried to change it to:

sensor:
  - platform: "mqtt"
    name: "xiaomi_cube"
    state_topic: "zigbee2mqtt/xiaomi_cube"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.action }}"
    json_attributes_topic: "zigbee2mqtt/xiaomi_cube"

Anyway nothing happens in HA. State is always “unknown”

In configuration.yaml in z2m I simply have:
‘0x00158d00010b28a2’:
friendly_name: xiaomi_cube

Must something be added?

The tap action works by tapping the cube on a surface like a table, so not by tapping with your finger on the cube. But I don’t like this action myself, so instead I use the slide action for turning on lamps etc.

Why would you want to use manual configuration? If you use MQTT, just use MQTT autodiscovery as explained here:

In case you really want to use manual configuration, be sure to add all three sensors as explained here at the bottom of the page:

I use manual config to actually be able to select which sensors I need in HA.
For all sensors prior to the cube I only need 1. Not linkquality and battery status.

Update: After re pairing a few times near the coordinator it now works perfect in HA.
I used this:

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/xiaomi_cube"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.action }}"

If you don’t require the LQI and battery percentage, then indeed this is the only part you need to add.
In the general format:

sensor:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    value_template: "{{ value_json.action }}"
    icon: "mdi:gesture-double-tap"
1 Like