Aqara Buttons All-In-One [Zigbee2MQTT]

can you please share what have you done? please

can u provide z2m logs here when you press a key?

I’m using version: 1.18.1-1
Aqara WXKG12LM.
MQTT explorer shows the messages being sent.

I have uninstalled the bleuprint… created a manual automation and it works… not sure why the blueprint does not work…

It didnt work. I found someone with a similar issue saying that there was no event trigger and got it resolved this way…but its too advanced for me to understand…would really appreciate if you could guide me through the process.

I’m also not too sure what decouple does for a switch…

Aqara QBKG25LM (3gang, no neutral) does not trigger event · Issue #5106 · Koenkk/zigbee2mqtt · GitHub

Hi there.

I have one QBKG22LM and one QBKG21LM. I also have one QBKG25LM (three-gang) but that one is known not to work with Z2M.

The issue manifests when I set homeassistant_legacy_triggers: false and try to use the action attribute like this:

- conditions:
        - condition: state
          entity_id: sensor.zigbee_button_smallroom_action
          state: double
          attribute: action

in Z2M config. The event generated then looks like this:

{
    "event_type": "state_changed",
    "data": {
        "entity_id": "sensor.zigbee_switch_kitchen_action",
        "old_state": {
            "entity_id": "sensor.zigbee_switch_kitchen_action",
            "state": "release_right",
            "attributes": {
                "action": "release_right",
                "button_right": "release",
                "linkquality": 99,
                "operation_mode": "decoupled",
                "operation_mode_left": "decoupled",
                "operation_mode_right": "decoupled",
                "state_left": "ON",
                "state_right": "ON",
                "friendly_name": "zigbee.switch.kitchen action",
                "icon": "mdi:gesture-double-tap"
            },
            "last_changed": "2021-04-29T14:09:00.562730+00:00",
            "last_updated": "2021-04-29T14:09:00.562730+00:00",
            "context": {
                "id": "cbec526666baa680ce0a95e81ed7b034",
                "parent_id": null,
                "user_id": null
            }
        },
        "new_state": {
            "entity_id": "sensor.zigbee_switch_kitchen_action",
            "state": "release_right",
            "attributes": {
                "action": "",
                "linkquality": 99,
                "operation_mode": "decoupled",
                "operation_mode_left": "decoupled",
                "operation_mode_right": "decoupled",
                "state_left": "ON",
                "state_right": "ON",
                "friendly_name": "zigbee.switch.kitchen action",
                "icon": "mdi:gesture-double-tap"
            },
            "last_changed": "2021-04-29T14:09:00.562730+00:00",
            "last_updated": "2021-04-29T14:09:00.572998+00:00",
            "context": {
                "id": "804978c97cc9e29542033e55b3d7da04",
                "parent_id": null,
                "user_id": null
            }
        }
    },
    "origin": "LOCAL",
    "time_fired": "2021-04-29T14:09:00.572998+00:00",
    "context": {
        "id": "804978c97cc9e29542033e55b3d7da04",
        "parent_id": null,
        "user_id": null
    }
}

Hello
when I try to import the schema to HA I get this message:
while scanning a simple key in “”, line 242, column 1: ^ could not find expected ‘:’ in “”, line 243, column 1: < p> <img src = "https: // community-a … ^

can you help and tell what went wrong? :slight_smile:
mirek

Same here. Looks like it might be including the image HTML code after the code block, and deciding that this HTML code is not valid blueprint code.
The blueprint itself is fine. If I copy / paste the code block to a blueprint file myself, then I can use it.

@zalus @mmakaay fixed.

1 Like

thanks for the help

Blueprint updated!

Changelist:

  1. Now it works with any value of homeassistant_legacy_entity_attributes of z2m.
  2. Changed the mode to parallel to get rid of ignoring some actions.

I’m having an issue where I single click the button and Home Assistant detects me pressing it 3 times.

What could be causing this?

1 Like

Hi, I’m having the same problem. Have you managed to fix it?

This is great! Thank you.

I am finding that my ‘tripple’ click isn’t working.

Tripple is spelled wrong (should be ‘triple’ with one p) on the blueprint front end… could the typo be extending into the payload too?

Ah yep, it is. In the blueprint I was able to correct the typo of ‘tripple’ and the command works OK now.

Blueprint updated!

Changelist:

  1. Fix typo of Triple action. Thanks @niko123456000

Hello,
I find this confusing.
The first sentence indicates that legacy triggers are required, so to be left enabled.
The second sentence (set legacy to false), means according to the site this links to:
legacy: Set to false to disable the legacy integration (highly recommended), will change structure of the published payload (default true). The value must be true or false.

Nevertheless, independently of my confusion, the blueprint works with my mini switch on first try :slight_smile:

homeassistant_legacy_triggers is not the same legacy in device options. About triggers see Z2M Responding to button clicks. By default homeassistant_legacy_triggers: true and if you haven’t touched this - you don’t need to do anything.

legacy: false in device section removes the deprecated click sensor (we use action sensor instead) and it’s not required, just a recommendation.

Hi. Same, I realized that the automation is being triggered 3-4 times every time, instead of 1 as it should.

I did some testing with a switch Helper to confirm it:


(of course, I only clicked once)

image

The blueprint is triggering multiple times because that’s how it works. You might a null trigger that wakes the switch, a real trigger, then a null trigger that turns the switch action off.

If you add a condition statement after the trigger, you can set it to only allow triggers into the rest of the blueprint that the blueprint can properly act on. You may still see the extra triggers, but the error log won’t spam on seeing the things that there is no action for.

I mentioned this to someone else here…

EDIT July 6 2022

So, this was a bit annoying because there are so many triggers, but I wrote it up for you folks upon a request… The owner of the main blueprint needs to edit it and add this as I cannot do that.

You can on your own add this to your copy. It should make sure that only valid triggers make the blueprint code execute. I don’t have any of the hardware so this team will need to take this test and troubleshoot it. It is pretty straightforward if you look at it. (here is a list of the triggers I can handle, ignore everything else) It will still trigger on garbage, but those are trapped as not matching the condition and will just show up as an empty trace.

Sorry in advance if there is a typo…

Add this after the trigger, before the action:

condition:
  condition: template
  value_template: '{{ trigger.to_state.attributes.action in ( ''single'',''double'',''triple'',''quadruple'',''hold'',''release'',''shake'',''single_left'',''double_left'',''triple_left'',''hold_left'',''release_left'',''single_right'',''double_right'',''triple_right'',''hold_right'',''release_right'',''single_center'',''double_center'',''triple_center'',''hold_center'',''release_center'',''single_both'',''double_both'',''triple_both'',''hold_both'',''release_both'') }}'

If you still cannot see the trace you want, simply tell HA to add more traces…