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

Not if you use my blueprints…
However the T1 Pro Quirk file for ZHA is wrong, incomplete, and messed up, but I fix that one (where I can) as well.
Z2M is better.

Ahh yeah. I just went ZHA with your latest compatible… seems to be working okay except for that. Will look into z2m next I suppose, while it’s fresh.

What a wonderfull Blueprint!.
Thank you!!

Do you happen to know where or how i can change the step size?

Change the step size of what?

1 Like

Hi - have had the original cube working perfect with your blueprint Z2M for ages. At Xmas, got the pro for the lounge… but can I get it work with with Z2M Pro blueprint… No! lol

MQTT device info shows correctly what happening such as turn cube from side 1 to side 2 etc, but whatever device I ask it to operate such as turn on a lamp, well, it doesnt. Using in action mode.

Nothing in HA logs either.

Any ideas,

You are not giving me much to go on here. I will say the majority of the problems I’ve solved with the new cube is that it was not in the mode you think it is in, so try changing the mode back and forth, or try adding a different function to the scene and the action functions and see if you can chase something down. However if the blueprint is sending the event out that it did a thing, the matching action should be triggering.

Also make sure the topics are correct and the cubes are not interfereing with each other due to a naming problem.
My set-up has a z2m one, a z2m pro one, and one running zha so they should work together just fine.

1 Like

Thanks SG, will do some further investigation…

NEW VERSION →

:bookmark_tabs: Changelog

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

Hello, I have a problem with this bluescript, more precisely with importing it. When I click Add to HA button, I get redirected to my HA install, and see this link: HA_Blueprints/Automations/Zigbee2MQTT-Aqara-Magic-Cube-T1-Pro-CTP-R01-Xiaomi-Lumi.yaml at d1c15d75a7b5fa3042d60f7eee2d7633ea8a27a3 ¡ SirGoodenough/HA_Blueprints ¡ GitHub
After clicking preview I see a very long error, I will include part of it not to make too much mess here:

Invalid blueprint: extra keys not allowed @ data[‘blueprint’][‘input’][‘action_any_side_group_2_actions’][‘collapsed’]. Got True extra keys not allowed @ data[‘blueprint’][‘input’][‘action_any_side_group_2_actions’][‘icon’]. Got ‘mdi:fruit-cherries’ extra keys not allowed @ data[‘blueprint’][‘input’][‘action_any_side_group_2_actions’][‘input’]. Got {‘action_slide_any’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 2 :cherries: Slide on any side’, ‘description’: “Side doesn’t matter on this one.\n**!!Warning!!** The automations for the specific side will also trigger. :apple::pear:\nI suggest using only one of the three groups of triggers, not multiple groups…”, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_doubletap_any’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 2 :cherries: Double tap on any side’, ‘description’: "Side doesn’t matter on this one.\n**!!Warning!!** The a… extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_1_group_1_actions’][‘collapsed’]. Got True extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_1_group_1_actions’][‘icon’]. Got ‘mdi:numeric-1-box’ extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_1_group_1_actions’][‘input’]. Got {‘action_slide_face_1’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 1 :apple: Slide with face 1 up’, ‘description’: “Face 1 is the one with the ‘Aqara’ LOGO”, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_doubletap_face_1’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 1 :apple: Double tap with face 1 up’, ‘description’: “Face 1 is the one with the ‘Aqara’ LOGO”, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_flipped90_face_1’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 1 :apple: Flip 90 degrees to face 1’, ‘description’… extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_1_group_3_actions’][‘collapsed’]. Got True extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_1_group_3_actions’][‘icon’]. Got ‘mdi:numeric-1-circle’ extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_1_group_3_actions’][‘input’]. Got {‘action_1_from_6’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 3 :pear: Flip to side 1 from side 6’, ‘description’: ‘!!Warning!! The flip 180 automations :apple: for side 1 and the ANY :cherries: automations will also trigger.\nI suggest using only one of the three groups of triggers, not multiple groups…’, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_1_from_2’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 3 :pear: Flip to side 1 from side 2’, ‘description’: '!!Warning!! The flip 90 automations :apple: for side 1 and th… extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_2_group_1_actions’][‘collapsed’]. Got True extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_2_group_1_actions’][‘icon’]. Got ‘mdi:numeric-2-box’ extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_2_group_1_actions’][‘input’]. Got {‘action_slide_face_2’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 1 :apple: Slide with face 2 up’, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_doubletap_face_2’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 1 :apple: Double tap with face 2 up’, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_flipped90_face_2’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 1 :apple: Flip 90 degrees to face 2’, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_flipped180_face_2’: {‘name’: ':palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 1 :apple: Flip 180 degrees… extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_2_group_3_actions’][‘collapsed’]. Got True extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_2_group_3_actions’][‘icon’]. Got ‘mdi:numeric-2-circle’ extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_2_group_3_actions’][‘input’]. Got {‘action_2_from_1’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 3 :pear: Flip to side 2 from side 1’, ‘description’: ‘!!Warning!! The flip 90 automations :apple: for side 2 and the ANY :cherries: automations will also trigger.\nI suggest using only one of the three groups of triggers, not multiple groups…’, ‘default’: , ‘selector’: {‘action’: {}}}, ‘action_2_from_3’: {‘name’: ‘:palm_down_hand: ACTION MODE ONLY :palm_down_hand: Group 3 :pear: Flip to side 2 from side 3’, ‘description’: '!!Warning!! The flip 90 automations :apple: for side 2 and the… extra keys not allowed @ data[‘blueprint’][‘input’][‘action_side_3_group_1_actions’][‘collapsed’]. Got True extra keys not allowed @ data[‘blueprint’][‘input’][

I don’t know what to do, maybe somebody will show me where is the missing character or other probably primitive mistake. I got an aquara t1 pro recently and id love to use your script as it seems to have everything I need.

I just updated it last nught and didn’t test importing, becayse I only change description. I may have messed it up. Let me check and I’ll fix it right away .

UPDATE:
I just went to the top post, clicked the button, and imported it. Looked OK no error.

Are you using Home Assistant 2024.6.0 or newer? That is required to allow import.
This error tells me you are running something older:

Okay, my HA installation was 2024.4.(something), gonna update it and check again, thanks for help

EDIT: It works! Thanks for help a lot!

1 Like

Hi, I am getting Error: Template rendered invalid entity IDs: number.Aqara-T1-Pro_last_side
What do I do wrong?
Thanks

Hello li.ilya,

Thanks for considering my blueprint.
I am thinking the answer to your question might be found in this section of the documentation.

🧯 Zigbee2MQTT Aqara Magic Cube T1-Pro CTP-R01 Xiaomi Lumi cagl02.

Read this over and simplify that name, and I think you will have better luck.

I’ve added the blueprint and set up an automation, and while group 1 actions work (flip to side from any side), I cannot get group 3 actions to work (flip to side from specific other side)

I looked at the automation trace, and while the helper number entity is created and the trace says the number.set_value service is being called, the “last_side” variable within the automation is always 0, and so none of the group 3 actions can trigger. Looking at the number helper entity on the dashboard, it looks like it has always been “unavailable”, and never had a number successfully stored to it.

I’ve checked that:

  • The cube is in scene mode.
  • Trace and successful operation of group 1 actions suggests MQTT/Blueprint/etc. are set up correctly.
  • Z2M and HA friendly_name match.

I’m not sure where to go from here troubleshooting-wise, any ideas would be appreciated. I am running HAOS 14.0 with Core 2024.12.3, were there any breaking changes to how the number helper would be updated?

The last_side entity is a number sensor set-up automatically by the Blueprint using MQTT.

You didn’t perhaps delete that did you? It shows up in MQTT with a name similar to your cube, and if you thought it was a duplicate and deleted it, well, it wasn’t.

No, understood, as I noted in my first message the entity itself does exist in HA, it just never seems to be updated by the automation when I flip the cube.

Again, all of the automation logic that does not depend on last_side works perfectly, I’m just out of ideas on how to debug the group 3 actions specifically, since the entity is always “unavailable” and therefore evaluates as zero due to the input check step of the automation.

I’m guessing this is probably user error somewhere on my part, but I can’t figure out where, so I was just hoping someone else had done this before and could point me in the right direction.

Well the good thing it if the number entity gets deleted, it should just make a new one.
After a current backup, delete the number entity, then restart HA and activate the cube once it’s up. See if it fixes itself.

My next suggest will be to remove the blueprint, restart HA (or reload automations) and import it again and see if it was just a glitch.

If that doesn’t fix it it’s likely a bug so put in an issue in the github. I am overdue for an edit, after the holidays it’s on the schedule for me.

Z2M version 2.x has dropped. This means if you install that, you will need to make a change to your configuration in order to use :fire_extinguisher: Zigbee2MQTT Aqara Magic Cube T1-Pro CTP-R01 Xiaomi Lumi cagl02.

I have not yet made changes to accommodate for the update, and my changes are going to be likely using the Home Assistant experimental event entities.

So to accommodate the change, I will be asking you to change 2 buttons in the Z2M :gear: set-up screen in the User Interface (UI) screen.

Please click both these:
Home Assistant legacy action sensors So that it will work now until I update this and
Home Assistant experimental event entities for later so it works after I update this.
Also leave Enabled checked as well. It should look similar to that photo when you are done.

Sorry for any inconvenience this is causing you. I wanted the dust to settle a bit so that I could see the final version of the change before I updated my stuff. In the end I think this is a positive change and will make programming these devices a lot easier for everyone.

Sorry, not using your Blueprint, but the Cube generates this list of events in Z2M vers 2:

event_types:
  - shake
  - throw
  - tap
  - slide
  - flip180
  - flip90
  - hold
  - side_up
  - rotate_left
  - rotate_right
  - 1_min_inactivity
  - flip_to_side
event_type: 1_min_inactivity
icon: mdi:gesture-double-tap
friendly_name: Magic Cube Action

However, if I create an automation that simply notifies me when one of those events triggers, many of them don’t.

For example., here’s the condition the automation is looking for and the subsequent action:

      - conditions:
          - condition: template
            value_template: "{{ trigger.to_state.attributes.event_type  == 'flip180' }}"
        sequence:
          - action: tts.cloud_say
            data:
              cache: false
              entity_id: media_player.respeaker_satellite_media_player
              message: flip me over

When I flip the cube over, I get the response for

      - conditions:
          - condition: template
            value_template: "{{ trigger.to_state.attributes.event_type  == 'side_up' }}"
        sequence:
          - action: tts.cloud_say
            data:
              cache: false
              entity_id: media_player.respeaker_satellite_media_player
              message: side up

:man_shrugging:

Well all are familiar to me except

  - side_up
  - 1_min_inactivity
  - flip_to_side

- Hold
only happens in scene mode. I think there are others that only happen in the other mode. Make sure you are checking both modes if you are testing for the events to show.

Also the 90 and 180 flip require a click (tap, whatever you want to call it) back to a hard surface and then no touch sit still for a second.
If you are niot used to the cube and what triggers what, that might be what you are running into.

1 Like