šŸ§Æ ZHA - Xiaomi Cube Controller

Well, feeling dumb. User Error.

I was 100% using your blueprint at the end - but I had loaded at least 4-5 others during testing of various issues. Reloading my configs, issue resolved - yours fires events as set up.

The Logbook still only shows the ā€œface anyā€ event, but the correct changes occur.
image

As the docs say, you can add the template sensor and pull that sensor to the dashboard to see what the blueprint thinks is happening real time. It helps a lot when setting things up.

I canā€™t get tis working

template:

  • trigger:
    • platform: event
      event_type: cube_last_action
    • platform: event
      event_type: zha_cube_last_action
      sensor:
    • name: ā€œCube Last Actionā€
      unique_id: cubelastaction
      icon: mdi:eye-refresh-outline
      attributes:
      friendly_name: ā€œCube Actionā€
      state: >
      {{ trigger.event.data.friendly_name }} -
      {{ trigger.event.data.action }} -
      {{ trigger.event.data.side }} frm
      {{ trigger.event.data.last_side }}Preformatted text

state unavailable what do I need to do to fix this sensor code

Perhaps could you edit that for me do lit looks like it does on your screen?
It may be a matter of indenting or something.
How to help us help you - or How to ask a good question.

It should be looking exactly like this, and Iā€™m thinking you have sensor: indented wrong.
HA_Blueprints/Samples/Cube_Last_Action_Template_Trigger_SAMPLE.yaml at c05d6fb431c1d84cb145c7d6dd5ffe5a60b1d9e2 Ā· SirGoodenough/HA_Blueprints Ā· GitHub.

thanks but I tried to put that code in my templates.yaml and got errors so I download your yaml file and uploaded it to home assistant folder it creates sensor but still says unavailable ill keep trying I would love this working maybe ive miss something

According to what you have above, you did not copy it correctly. The indentation is off, and this is very important.
See what mine in my working config file looks like:
Home-Assistant-Config/templates/trigger/ZHA Cube Last Action.yaml at d0068d87b4036406bb6a19d257bf6cf695331c85 Ā· SirGoodenough/Home-Assistant-Config Ā· GitHub.

I canā€™t help you id you donā€™t copy the stuff I give you correctly.

Just wanted to type out an appreciation for this helper/automation. Worked great, really enjoy.

Thank you for this.

1 Like

NEW VERSION available today

:bookmark_tabs: Changelog

  • 2024-06-04: Blueprint Input Sections for enhanced Descriptions.

Hi
First a HUGE thank you to you Sir_Goodenough for all the time & effort you have put in and for sharing this great blueprint!

Second, Im not sure if its me, but the blueprint lists actions for faces 0 to 5ā€¦ it took me a long time to realise that my cube is numbered like a dice : 1 through 6ā€¦ so I was testing with an automation on ā€œside 5ā€ and nothing was workingā€¦ but then realised in fact ā€œside 5ā€ in the blueprint actually refers to my cube with dice number 6!! Hope this may help someone in the futureā€¦

Thanks
James

2 Likes

Like @inghaj mentioned, the Cube T1 Pro has dice face number markings printed on to each face of the cube.
image
These markings are different to the face numbers defined in this blueprint. This easily leads to confusion when setting up automations with this blueprint and the Cube T1 Pro, since all the side number actions have to be translated from the blueprintā€™s number to the cubeā€™s printed number.

It would be great if this blueprint could be updated to support the correct face numbers as marked on the Cube T1 Pro. I imagine this would need to be a configuration to optionally enable alternate cube face numbering, so that existing automations are unaffected.

The faces on the cube are marked like this:

Cube T1 Pro Marking Blueprint Face Number
Logo (1) 0
2 1
3 2
4 3
5 4
6 5

Iā€™ve raised this as an issue on your GitHub repo too for tracking.

This is on my list of fix items, Or I think it is.
Feel free to add an issue in my GitHub for it if it isnā€™t, as I plan to look at it.
Then I canā€™t forget it (again) and during a major overhaul is the time.

2 Likes

Hi there, this page has been very handy, thank you! I have managed to get the cube paired, Iā€™ve changed mode so that rotate, slide etc work. Iā€™ve using blueprint and dimmer script to have side 0 (with logo) control a light group or individual light (I selected the entity but did try area and other ways to pick the lights).

The dimmer does work when I rotate counter clockwise but it also dims when I rotate clockwise. So, it just ends up turning the lights offā€¦ any suggestions?

Other actions like Knock seem to turn on and off lights etc just fine but increasing brightness with a clockwise rotation using your brightness script doesnā€™t seem to work for me.

Thanks in advance!

Hello ganonderp,
Welcome to the Home Assistant Forum and Thanks for choosing my Blueprint.

Show me the cw and ccw inputs you built in your automation for these commands (or your whole automation is fine as well). Please use the ā€˜</>ā€™ stuff in the editor to designate code blocks so I can read it. If you are not familiar, you can find the YAML to share using the edit as YAML in the top right menu.

I know my blueprint code so if you didnā€™t change that donā€™t include any if that.

My Aqara Cube T1 Pro does register and registration even shows in event listener but there after no other events show in the event listener. And so no actions of the cube work. How to diagnose this?

Hello Bruce B,

So you have tried my Blueprint and it doesnā€™t trigger anything?
Iā€™m not quite sure what you are doing, where you are looking, and what you are trying to do.

Perhaps you are not activating it correctly or it is in scene mode instead of action mode. Scene mode is not enabled when using ZHA, so you need to be in action mode. Read the top post to help with some of that.

Hello @Sir_Goodenough, thanks for the reply. Yes, I have imported your blueprint and tried using it for actions but it did not work.

Even if the Cube is in Scene Mode, is it not supposed to show the events firing under zha_event in the log listerner?

Also, how to switch it from Scene Mode to Action mode? I have read that the button should be pressed five times but it seems to not work.

Isnā€™t there a command to send from shell to the device to tell it to change to Action Mode?

Thanks.

Pushing the button is the only way to change modes that I know of when using ZHA.
Aqara Cube T1 Pro - Anyone got any advice for getting it working?.

Thanks.

Should pressing the button five times send an event that I should see on event listener?

Also, is there a second button on the cube or just one button?

I tried it multiple times and I donā€™t know if it is in Action mode or not.

What is a simple process to set it up for an action? A pictorial guide would be very appreciated. Thanks

This advice I just gave someone else should help.

Also this advice as I did some testing to figure this crap out.:

I also updated Github and the top document here to contain these instructions. No code changes happened, just the helper file and the community forum post here.

  • 2025-02-10: Added section to explain how to interview and change Action / Scene Mode in ZHA