That last side entity is only updated for some of the moves. It is the one that the cube provides. If you are automating against last side I suggest you use the one I create and mentioned above. I provide it on every move.
Z2m has at minimum 3 triggers everytime you do something, a wake-up, the actual trigger, and another null trigger after that. Sometimes there’s even more…
That’s why my blueprint does some of the stuff it does.
If you think there is an issue with the blueprint, and I can’t really tell here, please put your thoughts and data together and do an issue for me. We can sort it out over there.
This is the first report but that doesn’t mean something hasn’t changed.
So I was trying to use to the " Z2M_Cube_Dimmer_Control_Stub_Actions_and_Script_SAMPLE.yaml"" - I am fairly new to homeasistant so got a little confused - so if I understood it correctly the script has two parts, the top part I added under actions (CW 3 side Up) Template condition -
the bottom part of the script (heavy lifter) I added to my script.yaml file
/script:
cube_dimmer_control_5:
description: Template Dimmer Control
variables:
angle:
light:
sequence:
- service: light.turn_on
data_template:
entity_id: “{{ light.tv_light }}”
brightness_pct: >
{% set step_size = angle * 0.4 %}
{# Use the 0.4 above to change the sensitivity of the action. #}
{# Get brightness as a percent. #}
{% set cb = (state_attr( light, ‘brightness’) | float(10) / 255.0) * 100.0 %}
{% set new_brightness = cb | int(10) + step_size %}
{% if new_brightness < 5 %}
{# If it gets really low set to 0. Adjust if needed for your lights. #}
0
{% elif new_brightness <= 10 %}
{# If it’s not quite 0, set to a minimum working brightness. #}
10
{% elif 91 <= new_brightness < (90 + step_size) %}
{# If it’s almost full brightness, set to 100%. #}
100
{% else %}
{# Send actual calculated value. #}
{{ new_brightness }}
{% endif %}/
the enitity I am trying to control is light.tv_light also in the script section I created a script called “cube_dimmer_control_5” , now when I rotate the cube I can see in the automation screen that the automation tempelate gets triggered - but the under scripts the script never gets triggered , and so the dimmer does not work either - if you could please guide me with this setup - it will help me immesnsley in future automations using scripts.
I can’t quite tell what you are doing, but in general you download/install the blueprint, then select it in the automation ui editor one of a couple of ways.
Once there you find the line item you want to add stuff to, in this case action CW side 3 and action ccw side three.
Hi James , so as a first step when I try to add action in blueprint by choosing call service and pasting the code I am getting the following error when I try to save -
there is no service called “”. Clear that sample stuff before you add real stuff.
And if you are messing around with the script name make sure it’s the same in scripts as well. You very likely only need one of those scripts and can call it from multiple BP instances, so changing the name and getting yourself confused is not advised.
Also you don’t call CW and CCW with the same cube action.
You have to think about what is happening here. The sample text is showing you what you need. service: '"". The part of the sample code I provide you need is the part that looks like that. So for the CW one copy the service and data sections into the CW in the BP.
The call is identical for both the CW and CCW sections because the angle goes nefative when turned CCW. Both of these make separate calls to the same script.
I have added 3 new script blueprints to replace the yaml scripts I had offered as samples before. I have also cleaned the coding up on these and simplified them.
They may now be suitable for use in other people Blueprints and/or your bare automation to help with light dimming with the cube, color change with the cube, and simulating long / short button press with the cube.
I am now working on one to do volume control.
Are you hitting ‘run’ in the automation, which won’t work because there is no data in the trigger, or are you actuating the cube itself?
Also, since you are selecting an action double-tap, make sure the cube is in action mode not scene mode.
Hello, just wanted to say thanks for the amazing blueprint, but im facing an issue.
With my Pro cube the Aqara logo is on side 1, and the automation works as intended when coupled to “side 1”. That being said there are no “side 6” fields to work with and the ones labeled “side 0” do not work with my “side 6”.
On the dashboard it shows the current side as being 6, so I assumed that there is no entity for “side 0”. I tried changing the yaml file from “doubletap_face_0” to “doubletap_face_6” but no luck it getting it to work.
Z2M numbers the cube sides 1 to 6. ZHA numbers the cube sides 0 thru 5. This is a Z2M automation, so there is no 0.
Also if you set up the sensor and it reports to you that you are on side 6, that is detected from the cube so that is what side it’s on.
Is you make changes, that’s cool, but make the change in the !inputs, and in the actions. It won’t work if you change in one spot. Lots of stuff going on there and I can explain only so much in the helper file.
If you are using ZHA, use this BP:
For both the old cube and the new cube. The ZHA team has not to my knowledge updated a correct interface for the new cube, so the only functions that are available are less than the old cube. The cube itself will do them, but ZHA has no idea it is doing it.
There is an open issue with the zigpy team but no one has stepped up to fix it yes. Perhaps if people created a bit of a buzz around it it might get some attention.