🧯 ZHA - Xiaomi Cube Controller

This blueprint requires that you be using Home Assistant 2023.3.0 minimum. That is where this new feature has been added.

ahhh my mistake thank you.

I connected the magic cube through the Xiaomi gateway, but there is only one sensor.0x00000000_action. Why am I unable to add a device?

I’d suggest it didn’t add properly. That number is not a valid IEEE address.
Something went badly.

Troubleshooting steps…

@Sir_Goodenough Thank you for all your hard work on this. The blueprint looks fantastic. I have what I hope is a quick (albeit bone-headed) question. I read through everything here including your tidbit about the T1 Pro missing functionality in zigpy. In my case I only seem to be able to trigger rotation (right/left) and “shaken” events. I considered the cube’s mode is incorrect, but the scene mode doesn’t appear to support rotation, so I’m assuming I’m in action mode. Any tips?

Scene mode does rotate. You are in scene mode, switch it to action mode.
Here is a jump link to a list of what happens in action mode and scene mode with Z2M anyway…

Awesome. Thank you. Changing the mode seems to have done the trick. I do have one more question. I noticed that when you describe the helper entity, you indicate the range should be 0-6. I’m curious as to why it’s not 0-5 (assuming that 6 would actually be out of range).

Thanks again for all your help and hard work.

0 to 6 or 0 to 5 would be fine there. Either will work.
It was a carry-over from when I used to need to have people make an input helper for Z2M, which is the BP I built first.

I now build the input helper for you in the Z2M ones. I would do that here if I could…

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.

2 Likes

Hey @Sir_Goodenough, I’m using your BPs and they work flawlessly, thank you so much!

I was wondering about volume control - you mentioned back in April that you were working on one. I was curious to see how far you got. I was also wondering if I could adapt the light dimmer script yaml by changing domain from light to media_player (and a few other things). I did try instead using a basic binding of cw/ccw to media_player.volume_up/down, which does work, but the rotation fidelity isn’t smooth or consistent so I was looking for something nicer.

Try changing the multipliet so that you have to spin it way more times. This will smooth it out some. Otherwise we would have to make it do 5% bumps each time it detects a movement.
There is a helper BP I wrote in my library which does ‘short press’ / ‘long press’. You could move the volume like 5% on the short and 10% on the long?
Just thinking out of the box on how I would do this.

I am in the middle of an update of all my BP’s right now, so if you come up with something you think works well, drop it into an issue as a feature request, we can incorporate it in as a helper BP or something.

1 Like

I opened a feature request. It would be helpful if you could add any code you tried so far or details that would help me. I am not much of a media player person and want this to work for you (everyone)…

I have a beta version of the volume control BP I’m about to release if you want to test it.
It is your request after all.

(For future inquiries…) This link will not work forever and will eventually get merged into master upon release then deleted. Change ‘Nuggets’ to ‘master’ and you should be able to find it again.

NEW UPDATE:

Hi!

I have your blueprint woking and set up the dimmer script. It works great!
Before using the dimmer scrrpt I set up cw and ccw rotation to change light brigthness. This way I can set transition time as I want. Is there any way to set transition time with the dimmer script? I would like to smooth the transition between brightness settings.
I’m really new to this.

Thanks!

I don’t plan on doing so, but between the dimmer script and the volume script and other examples in the exchange, you should be able to craft something that works for transition.
Give it a shot, it’s just yaml.

I’ll give ir a try. I have never used YAML
But firs I have to solve another isue. The cube works when I pair it but after an hour it doesn’t respond anymore

It’s probably asleep. Trigger it on one of the triggers not used, then try the one you want. If you are using this BP, you can install the sensor I built to see when the cube is responding, without having to have an action on everything. It helps you learn what physical actions are needed to make it happen.

I was looking in the device feed on ZHA. When the cube works I see triggered actions even if the don’t have automations asdociated (unused gestures). But after an hour is like communication between cube and coordinator is droped. I’m using an XBee3 dongle (supported but not recommended). Tomorrow I’ll receive a Sonoff dongle.

Hello Team,

I get follow error : : Error: UndefinedError: ‘dict object’ has no attribute ‘event’
The cube is available in HA with Sonoff Zigbee 3.0 USB Dongle Plus - Sonoff Zigbee 3.0 ‎ZBdongle-P
any idea ?

Thanks W1z