šŸ§Æ Zigbee2MQTT - Xiaomi Cube Controller

Oops, replied to the wrong post. Sorry Rubin110. I meant to tag DS_DVā€¦

I guess the dimming code is just not meant for my application since there is a 0 - 100% brightness.
Where as with volume control there is just up and down. There is no way to read the actual volume apart from just subjectively listening or looking at the stereo.

i will try the short & long press method. but i fear that when i turn the cube like 100Ā° it only will register the press once :confused:

maybe to be a little clearer i donā€™t need 100% accuracy when setting volume i rather need a way to turn the volume more than just one step (i guess i have like 500 volume steps on my stereo)

So make a little script that when itā€™s called, it bumps the volume 10 steps (or however many). Another to lower the vol by the same number of steps.
Then trigger it with the short press rotation simulator. If you want to raise the volume, turn it cw which calls the script, then again, etcā€¦
Get that working and use the ā€˜long-pressā€™ as a larger number of steps bump for when you need a bigger volume bump at a time.

1 Like

that is a great idea - i ll try that :smiley:

i followed your described steps and the yaml now looks like this:

alias: Cube CXA long volume
description: ''
use_blueprint:
  path: SirGoodenough/Zigbee2MQTT - Xiaomi Cube Controller.yaml
  input:
    remote: sensor.cube_action
    rotate_cw_face_0:
      - condition: template
        value_template: '''{{ angle > 100 }}'''
        enabled: true
      - service: script.ir_cxa_volup_5x
        data: {}
    rotate_ccw_face_0:
      - condition: template
        value_template: '''{{ angle > 100 }}'''
      - service: script.ir_cxa_voldown_5x
        data: {}

but it doesnā€™t seem to trigger when i rotate the cube :confused:

Why are there 3 quotes? What is enabled: true? Maybe thatā€™s just GUI gibberish, not sureā€¦

I noticed a problem in the documentation that I cannot fix at the moment. If you are using the GUI method to add this, replace the word angle in the condition statement with trigger.to_state.attributes.action_angle because angle is not defined. The condition statement should look like this in the GUI method:
{{ trigger.to_state.attributes.action_angle > 100 }} or
{{ trigger.to_state.attributes.action_angle > 0 <= 100 }}

I donā€™t use the GUI enough and mess it up sometimes, itā€™s too confusingā€¦

so i made 4 separate automatons now short / long volume up and short / long volume down
the strange thing is that the short / long volume up works but volume down doesnā€™t :confused:

i tested the scripts and they work fine.

but even tho i got it working to one side i have to admit that it is a workaround but i rather get a new remote or someone figures out how to make the volume steps angle dependent. It is so much more intuitive that way ( : the bigger the angle change of the turn the bigger the volume adjustment.

//EDIT1: tested with ccw as volup and cw as vol down. ā†’ ccw is definitively bugged with the conditional template : (

If you look at my sample dimmer control, I pass the angle into a script. You could turn that into an integer in the script and tell it to move that many stepsā€¦
Itā€™s about 80% thereā€¦

Hi there. First of all thank you so much for creating this. I can tell it took a lot of time.

I am not a software engineer so forgive my ignorance here. I am looking for the ā€œsensor entityā€. Is this supposed so be a unique identifier? Or is it the sensor.aqara_cube_action? Hard to tell from ā€œsensor.xxDevice_Namexx_actionā€ if there should be some numbers in there or something?

Anyway, this is what I plugged into the ā€œremoteā€ section. Then I went down to Group 2: rotate CCW and selected the device. The problem Iā€™m running into is that the actions field just says ā€œno actionsā€ and is just greyed outā€¦

Thatā€™s the right sensor.
All the actions start empty and you have to put in there what you want to happen.

How do you do that? Itā€™s a dropdown selection box. And itā€™s grayed out.

The question is why is it greyed outā€¦

Yes, that is the question I am asking.

Well I have never seen it greyed out.
Is everything else working? what version of HA. What version of Z2m.

Iā€™m an idiot.

@Sir_Goodenough

Hello!
I hope you are doing well!
Can cubeā€™s firmware can be updated if there is an available OTA update?
Also, is "Knockā€ command function will be supported on the future?

Knock is supported. It is sent out as action ā€˜tapā€™ from the action sensor and my blueprint handles it. There is gif file in the main post and the description file demonstrating how to do it.

Updates to firmware on the cube are between Aqara and Z2M, nothing to do with using the device.

I update the blueprint to keep up with Home Assistant and any suggested changes. That has to be manually installed. see:

1 Like

Thanks so much.

sorry to be ignorant. Iā€™m sick with the flu so am probably missing the obvious.
But how do I setup the scripts youā€™ve outlined? specifically dimmer control
do i need to add that as a new scripts in scripts.yaml ? something else entirely

Yes, they are independent scripts that you create and call as a service from the blueprint. Just like it shows.