Aqara Wireless Switch (Zigbee2MQTT) - single, double and hold action

Hi, when debugging the automation using this blueprint (many thanks for developing) I recieve an error when debugging the script.

Error: UndefinedError: ‘dict object’ has no attribute ‘to_state’

I must be doing something wrong but what… any ideas?

tnx for your reply

Did you ever figure this out? I too am getting Error: UndefinedError: ‘dict object’ has no attribute ‘to_state’

HI Steve,
Just did not use the blueprint. No solution here. Sorry. I’m switching from Z2M to ZHA so I won’t use this blueprint anymore.

I was having the same dict object error. I fixed it by changing the variable.

Added the change on a Gist at Aqara Wireless Switch (single, double, hold) · GitHub

I have published an update to this blueprint today that should fix the errors you have experienced. Try updating (if you cannot update, then remove and reinstall).

Give it a try and give me an update if you have more problems.

Hi there, I can’t get this to work. The button actions are happening when I view the logbook, but the actions in the blueprint don’t occur. I’m not sure what to try, I have the WXKG11LM button.

1 Like

I had the same problem, modified the blueprint and it seems to work now: Aqara Wireless Switch (single, double, hold, release) · GitHub.
^ It’s a new version that uses trigger.to_state.state if available (in addition to trigger.to_state.attributes.action).

Thanks, but I just imported the blueprint again, but the automation still won’t trigger. Oh well the Aqara Buttons All-In-One [Zigbee2MQTT] blueprint is working for me.

Did you import from my link above? It’s a modified version.

No I didn’t realise yours was a modified version, I imported the original. Will try again when I get home tonight and report back - thanks!

thank you, your version works! Much appreciated. I had a look at your github revisions, there is quite a lot of change there, good work.

1 Like

The blueprint has been updated with the modifications done by @JetSerge.

This has suddenly stopped working for me. all my button automations have stopped triggering any actions

any info?

Does it says to you the same parsing error?

Getting the same. Did you manage to resolve this?

I no longer use Zigbee2MQTT in favor of ZHA, so I can’t perform tests with an updated version.

If you want to fix the deprecated integration, please ping me, @radinsky @rufio

If not, this blueprint must be considered deprecated, unfortunately.

Unfortunately I have created my own automation instead of using blueprint…
However, there’s a way to fix described here: Is there a deprecation on entity domain for selectors? - #2 by Sir_Goodenough

1 Like

Yes, just add filter: key and space it out like the docs suggest for the current format. Don’t have to test anything.
This is the same as all entity and device selectors now all blueprints.

Fixed locally and tested, indeed the only change is filter:
image

I use this Aquara button (WXKG11LM) with Zigbee2MQTT, and I created an automation who is triggered by the single action of this device, but seems the single action state is to short for fire the automation. So I’am not able to use this button. Have someone have this kind of problem?