Hi, thanks for sticking with it, sorry about delays in getting back. I is the 1st gen one and I only have one and I don’t see where it’s going wrong. It’s not user error, I’ve been meticulous in checking that. If it was occasional then I’d say it was but it is repeatable and occurs all the time under different circumstances. I might just wipe the whole BP, device and helpers and rebuild and see if it does the same. Someone else in this thread said theirs did the same, occurred about end of 2022, just like mine did.
My advice is to wipe it and try a different BP. There are several to pick from, but if you pick mine I will be better able to help.
Mine have the red fire extinguisher in the title.
It’s fine if you share the link for you blueprint here. This is a collaboration arena, not a competition arena.
Mine started doing the same with knock, it changes consistently to another face (the opposite one specifically). The interesting bit is that it wasn’t like this when I started setting up the blueprint. Any fix or are we still trying to find the issue?
I kind of gave up to be honest because as per normal internet, everyone has an opinion and the original poster is always wrong about something despite not actually being wrong. Any posts saying “it works fine for me” are quite possibly the most useless replies you could ever post on a forum.
It’s a great helper but I don’t think the issue is the code, I think it’s an Aqara reporting/hardware issue.
For what it’s worth. this person
ZHA - Aqara Magic Cube (69 actions).
Has a conversion to change the activated face to fix what you described, @Fireblade .
I will say I didn’t seem to be able to duplicate your report but now this is 2 independant sources of the same issue, so I will look further.
My BP uses logic very similar to Edwards here, so I’m going to check it again and see if I can verify what mine’s doing. If I find a problem I’ll come back here after I fix it.
The problem is still most likely NOT Aqara. We get the data from the ZHA implementation and conversion used thru the zigpy libraries. There would need to be an issue reported there. Z2M implementation has had no reports of this to my knowledge.
UPDATE —>
I still cannot verify this. All sides report as expected in all cases. I did find a bug in the BP event sensor that I create to monitor the cube / help train operators, But the functions all work and all the stuff does what it is supposed to on the sides that it is supposed to…
Now it’s down to maybe integration and cube I guess.
My assumptions are you are using the current release of ZHA and have the original style cube. I didn’t retest the T1-Pro cube. That is using the same zigpy library as the old cube and is a messed up affair, with a bunch of stuff not working. I’ve had an issue raised for 11mo now and no takers to fix it. I have no idea how that works, looking for someone to take that on…
@Fireblade could you share the version of firmware on your cube, as well as the model. Perhaps that would shed some light.
Thank you @EdwardTFN this is brilliantly simple! (Not to dismiss the work from other template contributors, but I can only keep up to a certain level of complexity ).
Is there a reason why you didn’t bring ‘shake’ and ‘drop’ commands? I was actually to add ‘shake’ without success, but that may just be my limited blueprints skills…
As expected, this was me… I managed to add the ‘shake’ action.
Also, now understand the yaml indentation jokes!
Nice!
Feel free to share with others or make a PR on the repository.
Hi James,
Model is: MFKZQ01LM
Firmware would be a bit tricky as it is only in HA, I don’t have an Aqara hub so unless someone can give me an idea of where to look for the F/W version I can’t help I’m afraid.
Can I just add that both you and @EdwardTFN have been magnificent in continuing to look into this. I get frustrated when people say things that aren’t helpful and tend to give up for periods. I’m very technical but this is not my field of expertise so appreciate the tenacity of you both, thank you.
Got my cube a couple days ago was very excited to find this. Unfortunately the last face helper doesn’t work because it only ever uses the activated face to the time of change which is always the current face.
Set up some extra helpers to do some maths from the automation and was getting the active face information NOT the deactivated face. Roll from 3 to 1 and was getting last face as 1 not 3. This immediately screwed my initial use so I’ve expanded your wonderful work @EdwardTFN to make that a possibility.
However, I’d prefer to not upload it as my own as its yours apart from deactivated and activated face storing correctly.
I added this to the inputs:
current_face_input:
name: Current face up numeric helper
description: Please select a Numeric Helper to be used to record the last face
up.
selector:
entity:
domain:
- input_number
multiple: false
And this above activated face:
deactivated_face: '{{iif((command == ''slide'' or command == ''knock'' or command == ''flip''), trigger.event.data.args.deactivated_face, states(temp_last_face_input)) | int(0) }}'
And changed this bit to cope with the last face being last face and current being the current:
- service: input_number.set_value
target:
entity_id: !input last_face_input
data:
value: '{{ deactivated_face }}'
- service: input_number.set_value
target:
entity_id: !input current_face_input
data:
value: '{{ activated_face }}'
Hi @Fireblade, same behaviour here.
Aqara cube T1 PRO with FW updated:
- Slide in face 2 changes face to 5
- Slide in face 3 changes face to 6
- Slide in faces 6 and 2 transposed as you reported.
Any solution to be able to use all the movements with all the faces?
Thank you in advance!!
Hi!
I have tried to update the blueprint with your changes but I get the error:
Error:`Invalid blueprint: Missing input definition for last_face_input
Am I missing anything?
I added the input current_face_input, added the calculation for deactivated_face and the new services for the ‘slide’, ‘knock’ and ‘flip’.
Thank you!
I posted this answering Fireblade:
Thank you for your support
Hi @EdwardTFN - Is it possible to add an automation to ANY AND ALL of the 57 actions of the Aqara Cube?
So that if it is shaken, moved, rotated, flipped on any side, etc, it simply runs one automation?
Or is there a simple test to do? I keep failing to get it to do any action and I have 4 of them.
- Firmware became unavailable means what? zigbee is cryptic
They register fine to zha but I see logs like:
LUMI lumi.remote.cagl02-NEW-A Firmware became unavailable
10:49:50 PM - 2 hours ago
- And what does event fired mean? What action was it that caused this log?
LUMI lumi.remote.cagl02-NEW-A Zha Event was fired
10:49:50 PM - 2 hours ago
Thanks.
Hi Bruce B,
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: ---your cube device_id here ---
Should trigger any and all things your cube does.
It is the basis of most Cube Blueprints if you want further reference. But it will give you a lot of traffic, so you may want to condition that down a bit to cut out some noise.
Perhaps just taking control of someones blueprint is a better way to start what you are asking (or just using their blueprint).
Hi @Sir_Goodenough - Thanks. Very good idea. Where can I find someone else’ working blueprint to copy and test?
This is not the thread for this, start a new thread please.
Don’t want to hijack the thread for this blueprint.