šŸ§Æ Zigbee2MQTT - Xiaomi Cube Controller

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.

I have added 3 new script blueprints to replace the yaml scripts I had offered as samples before. I have also cleaned the coding up on these and simplified them.
They may now be suitable for use in other people Blueprints and/or your bare automation to help with light dimming with the cube, color change with the cube, and simulating long / short button press with the cube.
I am now working on one to do volume control.

Cube Light Dimming: Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Cube Color Change: Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Cube Long/Short Press Simulation: Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Same here. No errors visible. But the automation didnā€™t work. I renamed my device in z2m as cube01 instead of switch.cube01 (i.e. removed the full stop / period) and it worked. Thank you!

Dimming blueprint - you should change the sensitivity description. It looks like it should take whole numbers. But if you use the default 40 for sensitivity, it becaomse 40x not 40%. So you need to input via YAML as 0.4 to get something reasonable!

Oopsā€¦
Pulled the wrong variable downā€¦
Should be fixed nowā€¦
It;s meant to have the whole percentage in the top to make it easier for people to understand.

Good catch, sorry for the bobo.

I have a dumb question. I am trying to use the cube as dimmer. Clockwise will brighten the light no problem, however it does not dim counter clockwise. Am I missing something?

The examples I provide work for me. Check your code closely, there might be a typo in the CCW action or something.
It could even be in my code, I donā€™t always test 100% after updates. That one got a few updates recently.

Reading from the instructions, should it not just read the angle as negative and dim? Im sorry if I am incorrect, your blueprint looks like amazing work. :muscle: Its just so big and complicated for new users. Not a complaint, just an observation from a new user of your blueprint.

EDIT: So I am an idiot. I wasnt using a minus sign ( - ) for my angle :weary: