Aqara Cube ZHA - Simplified face-based device control

Im a big rookie to HA. Im not sure what exactly you are asking. Ive used 3 scenes to toggle between radio channels within HA itself. And I use " radio browser" and a lovelace card to control.

If there is an easier way to get it connected to the cube im all ears. I havent figured it out yet.

You have answered my question… Your integration is Radio Browser.

I will take a look and come back to you…

Radio Browser will be playing in a Media Player entity, so you can use services media_player.toggle, media_player.volume_up and media_player.volume_down in other to control it.

Something like this:

thnx for your assistance. I managed to turn on/off power by tapping the cube.
volume regulation by rotating clock/counter
swapping between channels by toggling between scripts of each radio channel with the swipe action.

Yet im not able to toggle the power AND resume the last channel it was playing.

EDIT I have managed to let it start with a radio channel allready playing. Yet the toggling between the different channels isnt going as smoothly. it either just randomly selects another channel or even the same one. I tried to create a helper/scene where it should run the 3 different scripts for the channels but it fails to start the script on activating the scene.

Don’t you wanna share some of your code so we can take a look and try to get ideas?

Can anyone confirm whether or not this blueprint will also fully work with the new Aqara Cube T1 Pro?

1 Like

I don’t have the new cube, so I would appreciate if someone try the Blueprint with the new cube and come back with some.feedback.
It will be a bit hard for me to change the Blueprint wit out having the cube with me, but maybe with a couple of info from your side I can put it to work.

Thanks for your reply and willing to look into it if someone provides some data/feedback.

Can’t easily order it on Amazon in my country yet, but as soon as it comes in there I might order it and give it a try with your blueprint. For now I’ve ordered the old cube and give that a try first.

I have the new cube, the T1 PRO is what you mean right?
I have tried connected the cube to HA using Aqara Hub and also through ZHA.

Through aqara hub only face changes are recognised
And through ZHA I am only getting events for rotate and shake

Therefore you would not yet be able to utilize the full functionality of the blueprint with the new cube

See the following issue:
Zigbee Home Automation (ZHA) - Aqara T1 Pro Cube - Only Shake and Rotate Events Triggering · Issue #84301 · home-assistant/core (github.com)

1 Like

Thanks for sharing, @althan.

I’ve managed to get it working now with this fix.

1 Like

Hi, I’m using your blueprint and it is fantastic! I’m trying to trigger an automation with a condition tapping the cube, but it doesn’t work. I’m quite sure it is my fault, but I can’t find a solution. Thanks in advance for any help

alias: Cinema ON
description: Predispone la stanza per guardare il proiettore
trigger: []
condition:
  - condition: device
    device_id: ccacf2caf9f620ad7d9a3188184ae33d
    domain: media_player
    entity_id: media_player.denon_avr_x3100w
    type: is_off
action:
  - service: media_player.turn_on
    data: {}
    target:
      entity_id: media_player.telecomando_jvc
  - service: media_player.turn_on
    data: {}
    target:
      device_id: aeb8570f8bd33d8d211583bfcb230583
  - service: light.turn_on
    data:
      transition: 0
      rgb_color:
        - 0
        - 255
        - 255
      brightness_pct: 25
    target:
      device_id: 8dc8effc7091a9739d018cc870eb4845
  - service: media_player.turn_on
    data: {}
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - service: switch.turn_off
    data: {}
    target:
      device_id: 4cadbb0719870b5e4915cf64fbad075f
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: media_player.select_source
    data:
      source: Media Player
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data:
      transition: 0
    target:
      area_id: soggiorno
mode: single

Hi @falcof, my apologies for my late reply here.

It isn’t clear to me what you are asking for? Do you wanna help to create a trigger for this automation you shared or are you trying to fit those conditions and actions in one of the faces on the Blueprint?

If you want to use the Blueprint, you can use an “if..then” statement like this:

if:
  - condition: state
    entity_id: media_player.denon_avr_x3100w
    state: "off"
then:
  - service: media_player.turn_on
    data: {}
    target:
      entity_id: media_player.telecomando_jvc
  - service: media_player.turn_on
    data: {}
    target:
      device_id: aeb8570f8bd33d8d211583bfcb230583
  - service: light.turn_on
    data:
      transition: 0
      rgb_color:
        - 0
        - 255
        - 255
      brightness_pct: 25
    target:
      device_id: 8dc8effc7091a9739d018cc870eb4845
  - service: media_player.turn_on
    data: {}
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - service: switch.turn_off
    data: {}
    target:
      device_id: 4cadbb0719870b5e4915cf64fbad075f
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: media_player.select_source
    data:
      source: Media Player
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data:
      transition: 0
    target:
      area_id: soggiorno

Hi, that is not what I was expecting as an answer, but I think it should solve my problem.
I created 2 different automations (cinema on and cinema off) and I would like to trigger both knocking on the same face of the cube, depending on the state of Denon.
I will try to use your suggestion using if… then…
Thanks in advance, I’ll let you know

1 Like

This Blueprint may or may not work with the new cube version, but the new cube version has several functional differences from the old one.
The new cube version has an ACTION mode and a SCENE mode and you might have have to switch it to get it to work properly.
I have tested my blueprint and it works properly with the new cube if the cube is in the correct mode. The exception being that the DROP function is apparently no longer available.

Here is a link on how to switch the mode of the cube should you need to do so and everything I know about the new cube hardware:

1 Like

I’m sorry, but I have to say that the cube doesn’t trigger anything

Could you please share your yaml? Please remove any sensitive information.

By the way, do you have anything in your logs?
Which Cube model are you using? The old one or the Cube pro?

Hi, first of all thanks for been so kind. Here’s my config.yaml


# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
camera: !include configurations/camera.yaml

I have the old cube, all my other automations, trigger by the cube are working.
There’s an error in my log.
Logger: miio.miioprotocol
Source: /usr/local/lib/python3.10/site-packages/miio/miioprotocol.py:255
First occurred: 17 gennaio 2023 07:17:38 (17081 occurrences)
Last logged: 21:03:53

Got error when receiving: {‘code’: -9999, ‘message’: ‘user ack timeout’}

Thank you in advance

Hi @falcof,

When I asked for your yaml I mean the auto.atiin itself, not the configuration.yaml.
Just open your Automation (the one using the Blueprint) and click on the menu and select to view as yaml.

I don’t think this is related to the Blueprint or the Cube.

if:
  - condition: state
    entity_id: media_player.denon_avr_x3100w
    state: "off"
then:
  - service: media_player.turn_on
    data: {}
    target:
      entity_id: media_player.telecomando_jvc
  - service: media_player.turn_on
    data: {}
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - service: scene.turn_on
    data: {}
    target:
      entity_id: scene.relax
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: media_player.select_source
    data:
      source: MPlay
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - service: media_player.turn_on
    data: {}
    target:
      device_id: aeb8570f8bd33d8d211583bfcb230583
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      entity_id: light.piantana

Again, thank you!