šŸ§Æ Zigbee2MQTT - Xiaomi Cube Controller

I have tons of documentation and examples listed with my blueprint. Plus a script blueprint to do the code for you.

Code Examples are found in the Yaml file here
If you want to create the script file using a script BluePrint, I have that for you right here: Dimmer Control BluePrint

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Plus if you look above, I just came up with a volume control script blueprint as well.

1 Like

Thank you <3

The video solved my ā€œproblemā€

i somehow did not understand that i need to call the dimmer script with the trigger blueprint.
i donā€™t know why but i assumed that it worked as standalone.

now i got my dimming to work just fine and thanks to your work just in a few clicks!

You are awesome! thank you so much!

1 Like

Any suggestionsā€¦

All setup, no issues, no spaces in name ā€˜AqaraCubeā€™ and can see under MQTT logbook for the Aqara Cube that the actions are shown. Nothing in main log either.

Have just one automation (double tap) and that is to turn a bulb on, have tried other as well, but nothing happens.

I am obviously doing something wrong, any help appreciated.

After some diggingā€¦ I am getting the following in the log. I have also the HA SkyConnect installed, but nothing is on ZHA, waiting for ā€˜matterā€™ to come through.

2023-08-10 12:41:06.725 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities number.aqaracube_last_side are missing or not currently available

Could this be some kind of conflict?

Further update: have disabled ZHA, still the sameā€¦

I really have nothing to go on here, other than it donā€™t work and it canā€™t find the last_side entity the BluePrint creates.
Did you follow the troubleshooting in the documentation? (top post here or the guide file in GitHub) Did you create the sensor to help you see what the BP is seeing when you preform actions with the cube? Since this is the BP for the old style cube, are you using the old style cube? If this is the T1 Pro style cube, there is a different BP for that.

https://community.home-assistant.io/t/zigbee2mqtt-aqara-magic-cube-t1-pro-ctp-r01-xiaomi-lumi-cagl02/525111

1 Like

Hi - thanks for reply, I will go thru docs again. Yes, it is the old cube (original). As a note, tried to setup automations via MQTT and not working their either.

Sounds like you should verify that the cube is there as well. Under the MQTT integration, select devices, can you find it there? When you action the cube is HA responding in the HA log on the right?

Hi - yes its showing in MQTT, and logs show the action, but the bulb or whatever I device I choose does nothing.

Keep in mind that for every time an action is detected, a clear last event action also happens as seen by the log above. There are also wake-ups and noneā€™s and other things the BP does not act on. So many actions are screened out in the BP condition statement as not relevant to the BP.
Activate the cubeā€™s tap or whatever one you have programmed to do the light then look in the traces. Find the trace that the initial condition passed. What did it try to do?

This might be a matter of finding the right side of the cubeā€¦

Have you tried an action in the ā€˜any sideā€™ section to see if you can get something to work? The drop is a good one to use for initial testing, where you drop the cube from one hand to the other.

Going Miss Marple, will post after the investigationā€¦

  • 2023-08-07: Updates for Home Assistant 2023.8
    • LOOK THIS LINK FOR IMPORTANT UPDATE INSTRUCTIONS
    • Selector syntax change
    • Condition Selector addition (where applicable)
    • MQTT Discovery name changes (where applicable)
    • Clean-up code formatting
1 Like

Did what you said and it sort of works but is very intermittent. Tap for example has to be very quickā€¦

Devices will toggle on and off, but when using ā€˜Call Serviceā€™ to toggle a switch (Sonoff mains plug) nothing happens.

Any ideas? Thanks for your help.

I have a video up on how to tap in my instructions. Quick and fairly aggressive. Those cube actions are often misunderstood. Also please know you need a second or 2 between actions or the too soon action will not register. This is a de-bounce thing so that you donā€™t get unintended double actions on say a light, causing it to flash instead of go on or off.

Does the service call work when called from developer tools - services?
Does the Blueprint trace show that itā€™s trying to do it?
Does the diagnostic sensor register the action you think that you did?
Did you do the action on the same cube side you added the service call to?

These are physical actions sent to the BP the way you configured it. There is no way for me to troubleshoot this. That is why I built the diag sensor tool to help you know what side you are physically activating.

This is like me telling you I turned the key on my car and the radio works but it makes a noise and nothing happens. Please fix it for me. ( over chat )

Iā€™m glad to help where I can, but some things are up to you.

1 Like

Update: found out that when using call service with the cube turning on/off an entity all works perfectly fine, but toggle just doesnā€™t want to know.

Thanks for all your help.

1 Like

hello Sir_Goodenough (:
i have a question regarding the dimmer script.
I got it to work but every so often it somehow breaks the dimmer switch i use.

I made the following observations:

  • i mostly happens when i try to get to the lowest dimming point
  • when i try to get low dimming the dimmer shuts off
  • when i am in tasmota web ui i can dimm everything from 1 - 100
  • in tasmota webui it does not shut down when set to 1

i wonder if i can turn off the automatic shutoff when turning the dimmer to low values.
(in hope it might solve my problem).

The workaround is to unplug the main power from the dimmer to reset it.

with kind regards

You could remove this section. It is intended to force off if the setting ends up below 5%,

        {% if new_brightness < 5 %}
          {# If it gets really low set to 0. Adjust if needed for your lights. #}
          0

You could either remove those lines or set this to 10 or whatever the lowest you want it to go.

1 Like

thank you ill try that (:

as a note tho: since you wrote to set the script value for minimum brightness higher as low values might cause bugs i already have set mine to 15. But it also shuts off if you dim to low.

There is the minimum where it should stay on that you can pick, and I also set if it got below 5% it should shut off. This disables the shut off part, which appears to be causing you grief.

Taking that section out should assure the final setting to the light is the minimum level you set in the inputs.

i now set it to

  {% if new_brightness < 5 %}
          {# If it gets really low set to 0. Adjust if needed for your lights. #}
          1

which solves the shutting down part (:

but when its set to 0 it also shuts down if Minimum Brighness in the blueprint is set to 15
maybe my setup is bugged o.o

1% might still be off to the bulb. just take those lines out.

1 Like

1 works great (:
it works in tasmota web ui and it now works with the cube :slight_smile:

1 Like