šŸ§Æ Zigbee2MQTT - Xiaomi Cube Controller

Hi all,

I can not find the sensor: sensor.xxYour_Hamexx_action
I can only see :

  • action side
  • action to side
  • action from side
  • action angle

How can I create a custom sensor with only action?

Make sure the action sensor is enabled.

Maybe my z2m config but I donā€™t understand why only 4 sensors are present and not 5

Above is looking at the Device in Home assistant. That is where you enable or disable entities for the device. I have the action enabled, and I have the other 4 disabled as I donā€™t use them.

You canā€™t really make one. It should be part of the presets for the Device as Z2M finds it.
I am assuming you are using current version of Z2m.
Does the firmware on your device match mine?

I am using the addon,
Screenshot_2022-04-06_03-53-29

1 Like

Iā€™m not using add-on but docker version of Z2M
http://www.citrowallon.com/hass/hassio-magic.png
http://www.citrowallon.com/hass/z2m-magic.png

Is that docker container up to date?
Otherwise not sure what to say, your Z2M is not creating the sensor.
There is something called ā€˜actionā€™ in that 2nd picture, I donā€™t know what that screen is however.

Z2M ui probablyā€¦

I have Legacy API enabled. Sometimes that setting messes with devices differently.

Screenshot_2022-04-06_04-14-07

Same configuration for Legacy API.

Thank you very very much. fifth sensor is present now.

1 Like

What was it, may I ask.
In case others find the problem.

enabling of legacy API. It was disabled on my Z2M config.

Iā€™ve just forgot to add ā€œnowā€ in my previous message about ā€œLegacy APIā€

1 Like

I have fixed the Documentation to prevent this problem in the future. It is fixed on the Git Repo but I have not pushed it up to here yet because I anticipate other changes this week related to todayā€™s 2022.4 release and the multiple entity selector.

Donā€™t forget to click the :orange_heart: in the top document if you find this useful.

2022-04-11: No Code Change. Added guidance to solve missing Action Sensor condition in this document.

In the Dimmer Control example, I think the second line above should be {% if new_brightness < 5 %}, right? I found that if the light was off (cb == 0), I couldnā€™t turn it on, until I made that change.

Setting it up to control my home theater lights, volume, and a few other things. Only issue Iā€™m running into is if I pick up the cube and rotate it to a face (e.g. face #2 for volume control) and then put it down to rotate it, often it doesnā€™t pick up the face change, and thinks itā€™s still on face #1 (lights). I guess the cube expects to be ā€œflippedā€ to a face while on a table, not picked up, rotate, and put back down.

Thanks for the blueprint fork! Having lots of fun with itā€¦

Good catch. Iā€™ll fix that right away.

Yes, my solution is to set it on another side and 90-it to the correct side. There is the 1 second delay so you canā€™t be too quick, though. Pop the entity sensor somewhere in a dashboard and move the cube around, you will see what works and what doesnā€™t

I did see a de-bounce setting in Z2M but havenā€™t played with it yet, that may help here. One of these days.


UPDATE: doneā€¦

  • Example code bug fix from Michael Fischer
    2022-04-17 - Added new blueprint link to the family
    2022-04-26 - Re-configure to add 30 Action Methods 74 total nowā€¦

!!NOTICE!! If you are upgrading the Blueprint, upgrade the template sensor as well. The variables are differentā€¦

New Update todayā€¦ (27-APR-2022)

NO Blueprint CODE changesā€¦

Just some scripts to show you how to add 24 more actions using some template magic. LOOK HEREā€¦

  • 2022-04-26 update-A UPDATE: No code changes. Added examples to provide 24 more ways to trigger something using the rotate sensor as a device toggle, both long and short for each rotate sensor.

New Update todayā€¦ (29-APR-2022)

NO Blueprint CODE changesā€¦

WE ARE NOW AT ABOUT 128 WAYS TO TRIGGER, ( at least 128, maybe moreā€¦ )

Just some scripts to show you how to add 30 more actions using some template magic. LOOK HEREā€¦

  • 2022-04-26 update-B UPDATE: No code changes. Added examples to provide another 30 more ways to trigger something using conditionals in Group 3 :pear:,

Please Click the :orange_heart: at the end of the Top Post if you find this Useful

Hello,

I got problem with importing blueprints. This is what I get:

image

looking into into it now.
Sorry, sir. I just imported it 2x and cannot replicate.

I am betting you have an old version of HA that does not know what the multiple is.
I just noticed that I did not lock out versions older than

  homeassistant:
    min_version: 2022.4.0

So I am adding that now. You should now get an error that you need to update HAā€¦

Hello, I canā€™t get the automation to work.

The trace shows that it fails at the condition template at the beginning but I donā€™t understand why, here is the ā€œChanged variableā€ information :

this:
  entity_id: automation.aqara_magic_cube_zigbee2mqtt_2022_04_26
  state: 'on'
  attributes:
    last_triggered: '2022-05-05T23:40:18.659537+00:00'
    mode: single
    current: 0
    id: '1651792422338'
    friendly_name: Aqara Magic Cube Zigbee2MQTT - 2022-04-26
  last_changed: '2022-05-05T23:58:00.273312+00:00'
  last_updated: '2022-05-05T23:58:00.273312+00:00'
  context:
    id: 018096a8b451b854700e524ea4e71690
    parent_id: null
    user_id: null
trigger:
  id: '0'
  idx: '0'
  platform: state
  entity_id: sensor.aqara_cube_salon_action
  from_state:
    entity_id: sensor.aqara_cube_salon_action
    state: ''
    attributes:
      icon: mdi:gesture-double-tap
      friendly_name: Aqara Cube - Salon action
    last_changed: '2022-05-06T00:06:37.296813+00:00'
    last_updated: '2022-05-06T00:06:37.296813+00:00'
    context:
      id: 018096b097f05413d086c4b94da96997
      parent_id: null
      user_id: null
  to_state:
    entity_id: sensor.aqara_cube_salon_action
    state: rotate_right
    attributes:
      icon: mdi:gesture-double-tap
      friendly_name: Aqara Cube - Salon action
    last_changed: '2022-05-06T00:06:37.785562+00:00'
    last_updated: '2022-05-06T00:06:37.785562+00:00'
    context:
      id: 018096b099d920ccc36cf85229c67c2d
      parent_id: null
      user_id: null
  for: null
  attribute: null
  description: state of sensor.aqara_cube_salon_action

There are some hints above. Legacy needs to be on so that the action sensor is available. Also you need at least HA Version 2022.4.0 for some of the other stuff to work.
Check over the issues that others had above and let me know if you still have a problem.

WOWā€¦ I spent all afternoon fighting this thingā€¦ Tearing my hair out I didā€¦

There was a bug. Iā€™m about to load 2022.5.1 and see if itā€™s fixed.

@Stormweaker

I had the same issues as above and updated to 2022.5.0 and checked legacy API in z2m (v1.25.0) before posting here.

I updated to 2022.5.1 now but same issue.

Not sure if I can get more debug information, thatā€™s my first time using a blueprint.

Thank you for your time.

Thereā€™s another patch out today with another fix for it.
My HA has been in limbo fo 24hrs now due to ssl problems, I have not been able to test anything. But I assure you, if you copy the blueprint from the repo and paste it into a file manually, it will work. This is a HA problem causing everyone with selectors and some other items that have enumā€™s to not importā€¦ At least thatā€™s that the release notes said today.