šŸ§Æ Zigbee2MQTT - Xiaomi Cube Controller

Hi, it is not possible for me to delete the ā€œAqara Magic Cube Zigbee2MQTT - 2022-04-26ā€ blueprint. Any suggestion? Thanks

Are there still automations based on the blueprint? If yes delete them and retry.

1 Like

It worked. Iā€™ve missed 2 automations. Thaks

Hi Guys, & @Sir_Goodenough ,

Unfortunately iā€™m running into some issues. What iā€™ve done:

  • Adding the cube while shaking it. Itā€™s succesfully connected to a CC2531 on Zigbee2MQTT, (iā€™ve got also a conbee II, but thatā€™s on Deconz, and iā€™m to lazy to move all my devices).
  • CC2531 is working well
  • Cube has been detected en exposes correct information over MQTT:

image

What works:

  • Rotating left or right.

Not working:

  • Tapping, sliding etc.

In Event Listener iā€™m seeing:


It works well when i rotate the device. But tapping/sliding it doesnā€™t change.

When iā€™ll check the this sensor, it showā€™s actions on a correct way. (it flashes shortly the correct action).

So rotating left/right works, but not tapping etc.
Oh, btw, i cannot find the switch to enably legacy support in Zigbee2MQTT.

Do i something wrong, or is some kind of script failure?

I also donā€™t see any errors in the log.

Thanks in advance!

Sorry I did not get back sooner. Iā€™ve been offline for a week.
Look at the traces for a tap and a slide. You will see if it the blueprint not triggering properly of it the cube is triggering and the script you added is not working.
Remember there will be null triggers before and after a good trigger. HA defaults to 5 triggers saved per device before they disappear, so you may want to extend that to 10 or something to help with troubleshooting as well. There is a tip in the top post on doing that as well.

Found it!

Weird i havenā€™t seen this before, but the action_angle doesnā€™t exist here. Had to change action_angle into angle in ā€˜variablesā€™:

angle: '{{ trigger.payload_json.action_angle | float(0.0) }}'

into:

angle: '{{ trigger.payload_json.angle | float(0.0) }}'

OK. that was how I had this documented first. I guess some systems only have angle, some only have action_angle, and some version of Z2M or this driver have both like mineā€¦ I will update the documentation to reflect.
Thanks for the information.

Thanks for you quick responses! Iā€™m thinking, isnā€™t it possible to check if there is an action_angle in the payload? If yes, use that, if not, use angle?

My update here will be exactly that. They both hold the same information. Just inconsistencies in implementation by the driver author(s).

Add Notes about angle vs action_angle.
HINT: (Either will work, use the one that you see in the sensor list.)

Hi - just a note for anyone experiencing the same problem as me - I was getting an error in the trace saying the template had failed

I had an underscore in my entity name in Zigbee2mqtt (Funcube_Office)

After trying out various things I changed the entity name in Z2M to FuncubeOffice and also in the automation topic and this solved the problem.

Thanks for the blueprint @Sir_Goodenough

Also - not sure if I was doing something wrong but I could not get my HA to see an entity for ā€˜last action triggerā€™ you mention in the docs. Do I need to set anything up to use this or should it just appear?

Iā€™m not sure wherein the Docs you are referring to. There have been several iterations of this blueprint and older versions my have referred to that sensor. This version uses MQTT triggering to get the ā€˜eventā€™ captured.
Perhaps a link to the paragraph you are referring to would help?

This bit in your original post. But as you say I can use the mqtt message so no problem.

Thanks again

Added new Blueprint for the Pro Cube.

:fire_extinguisher: Zigbee2MQTT Aqara Magic Cube T1-Pro CTP-R01 Xiaomi Lumi cagl02

This Blueprint gives you literally hundreds of actions available on the new Magic Cube.

Thanks for this blueprint. However, I just canā€™t get it to work. I keep getting the error that the entity ID must be given. I set the Topic like how it should be . So ā€˜zigbee2mqtt/Aqara Cubeā€™ and it just doesnā€™t work. What am I missing here? I tried to press the link on how to find the topic in the blueprint but it gives me a 404.

No spaces or punctuation in the topic to make this work.

Thanks, thatā€™s what I figured. Is there any way I can get a suitable MQTT topic without renaming my devices in Z2M? I would like to use ā€˜Aqara Cubeā€™ as name and maybe use ā€˜aqara_cubeā€™ as topic for example.

How come spaces donā€™t work? Iā€™ve made a blueprint for dimming lights with a Friends of Hue switch, and I use spaces in those blueprints without issues.

Use the method mentioned in the instructions to change the name. Clicking the update HA box will set the Friendly names for you. The entity name will not change in HA.
This naming problem is a by-product of the BP making the helper file for you and not having to deal with legacy mode or not legacy mode in the Z2M setup, both of which caused problems before.
There may be a better way that I can deal with spaces and punctuation and I may eventually figure that out, but for now, this is the only way it works.

New Version:

:bookmark_tabs: Changelog

  • 2023-03-01: Add Author Tag. Bump HA required Version to 2023-3-0

Thanks, this solved my issue too.
Got stuck in the trace with Aqara_Cube, AcaraCube works

1 Like

I am struggling as a bit new to all of this.

If I understand correctly I find the cube in ZHA, which I have done. I assume I then need to disable ZHA and go back to using Z2M and find the device again?

I have added the helper and the Blueprint but when I try to automate using the Blueprint it does not show the cube as an option (I can see the cube in HA when I search for devices otherwise)

What integration are you using?
I have blueprints available for both ZHA and for Z2m.
Pick the right blueprint to match the integration you have installed the cube into.
All my Blueprints are listed in the end of the top post.