deCONZ - Xiaomi Aqara MFKZQ01LM Cube Controller

Thanks! It’s working great!

I dont get it, you mention 2 sensors.
I have only 1 sensor showing in HA mi_magic_cube.

And do i create a seperate blueprint.yaml or do i out this in automations?

By looking they can be completly diffrent deconz vs ZHA vs Zigbee2mqtt, might be wrong but lot of the time you need the platform setup with the device to actually get the data to make these, this would be a lot of work for them to do… definitly think buying a beer would be needed in these instants (might be wrong)

Just upgrade to the latest version of Home Assistant which supports blueprints 2020.12.1. Then import the blueprint by copying the url from this topic. Then in your blueprints overview you click on create automation and see if it works for both the rotation and the other gestures. If so you don’t have to do anything else. If either rotation or gestures are working you might have to rename one of the sensors through the deconz rest-api.

I have no idea what the values are that zigbee2mqtt uses and sends to HomeAssistant for this device. You need to have someone who knows these values so you can adjust the blueprint to make it work with zigbee2mqtt

@usaiphone I had exactly the same question and couldn’t find an existing blueprint. That is why I made a Z2M variant based on this blueprint.

@wmn79 Thanks for this blueprint, but I get a pretty bad error: Is it possible that your blueprint reacts to the event 7000 for wakeup? Everytime I barely touch my desk, with the cube on it, the automation is triggered. Looking at the yaml it could be the rotate_cw action? I’m monitoring the events in the home assistant event log and nothing besides 7000 is fired

Hi, I don’t have any issue with this myself. How does your yaml look for this automation. If you share it might shed some light in the direction we need to look into.

- id: '1613080417800'
  alias: Nanoleafs
  description: ''
  use_blueprint:
    path: wmn79/deconz-xiaomi-aqara-mfkzq01lm-cube-controller.yaml
    input:
      remote: af6980cfe91e40c1af3f6bcdc101a745
      slide:
      - type: toggle
        device_id: 026535bd3201ac3920466c25b8fcd4b3
        entity_id: light.nanoleafs
        domain: light
      flip_90: []
      shake:
      - service: light.turn_on
        data:
          effect: '{{ (["Pride", "Color Waves", "Sinelon", "Beat", "Juggle", "Fire"]
            | random) }}'
        entity_id: light.nanoleafs
      rotate_cw:
       - service: light.turn_on
        data:
          effect: "Snow"
        entity_id: light.nanoleafs
      rotate_ccw: []

“Snow” is activated everytime the cube is woken up, like touching my desk with the cube on it.

The problem is line 94 in the blueprint:

  - conditions:
    - '{{ event | int > 0 }}'
    sequence: !input 'rotate_cw'

This is matching for every event over 0, like 7000, what is the wake up event for the cube. I think it would be fine if you would ignore that specific number?

Let me check if I can reproduce it, otherwise it may be a solution to add an extra sequence (which you then don’t use) for the event 7000.

1 Like

That sounds like a good idea! Maybe there is also someone who wants to use this event for something, even if I can not think of a use case right now :sweat_smile:

I have updated the start post with the edited blueprint including a wake. I believe you need to delete the current downloaded one and then add it again. I quickly tested it and it looks fine, but you can better test it yourself. Good luck!

1 Like

Reimported the Blueprint last night and set actions to the turn event again, so far no more problems. Thanks a lot!

1 Like

How to add this blueprint to HA? There is no link here. Thanks for help

You could do this in the “old fashioned” way by copying the url of this topic and paste it in the blueprint import dialog. But I have now also added a my.homeassistant badge which you can use to do this in an even more convenient way.

1 Like

How can I check this? I have googled and tried everything to my knowledge… Can someone explain how to check this step by step?

Never mind… did a reboot of hassio all seems to work right now…

I have the same problem. In the states on the developer page it only says “binary_sensor.cube_158d0002a6f758”. It is the Aqara Cube connected over a Xiaomi Gateway. Even without this Blueprint, I have the problem that only “rotation” is recognized, not clockwise or counter clockwise. The other gestures seem to work.
I have the Xiaomi Integration installed and the Cube showed up as this binary sensor after I added it in my Android Xiaomi Mi Home App. Do I have to “install” the cube somewhat differently?

This blueprint is for using the cube with the deCONZ integration. In your post I read you use the Xiaomi integration, so it makes sense that this blueprint does not work with your install.

1 Like

Correct, I use the Xiaomi integration. Can I use the deCONZ Integration in parallel to the Xiaomi integration? Or does the deCONZ integration support all Xiaomi components… porpably not…