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)
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:
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âŚ
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âŚ
Hi. I am using this blueprint since a lot of time. Since yesterday everything worked fine but, since I added some Philips Hue on my Home Assistant Zigbbee2MQTT, the release Actions of my aqara buttons stopped working and I cant understand why⌠I tried disabling any buttons automation and recreate everything from beginning but there is no way to make it work anymoreâŚ
I tryied to lounch any kind of service using single button release and multiple button release but nothing happens⌠Any Idea?
@Drafted Thanks so much for creating and sharing this blueprint! Iâve successfully used it with my new Aqara Wireless Mini Switch model WXKG11LM for single and double click actions. I am getting an error in my logs though,
Logger: homeassistant.helpers.template
Source: helpers/template.py:147
First occurred: 6 January 2023 at 19:04:48 (8 occurrences)
Last logged: 6 January 2023 at 19:59:28
Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'action' when rendering '{{ trigger.to_state.attributes.action if trigger.to_state.state == "" else trigger.to_state.state }}'
Any idea how to resolve to prevent this error?
I would advise everyone to use a more modern and native way to bind actions to buttons without using blueprints:
Oddly thatâs exactly what I started doing originally with my Aqara buttons, but I couldnât get the desired functions to work. I found the blueprint after a search and thought I would try it, and the single and double clicks instantly worked, so I was definitely doing something wrong somehow with my original automation.
Iâve gone back and set the automation up successfully without the blueprint now, after double checking the steps with your screenshots, so thank you for taking the time to post the above.
One final thing I canât figure out yet, and it may be trying to do too much with a single button, is using the hold action event trigger. My button sends a hold as well as a release action event through Z2M.
I would like to use the hold for dimming of one bulb.
Can anyone help with how this could be setup, or does it involve a lot of configuration, in which case, it may be better to just keep the button for single and double presses, and use the HA mobile app dashboard to change brightness as and when that is required, or look at a dedicated dimmer like the hue v2 with dedicated function buttons?
Iâm new to using momentary action switches but was able to use both your blueprint and your manual instructions successfully for a simple minded device on-off automation as a test.
I have a complex automation that Iâm currently starting from a click on the HA dashboard that Iâd also like to start from a physical click on one or more these switches. Since the action portion is embedded in an automation itself, is it possible to direct it to an automation rather than to a device?
Thanks.
Thanks for this amazing blueprint, made my life a lot easier!
I had to customize it to include the action âmanyâ from this device, so if youâre still updating this would be helpful for other people!
Could you add the new aqara knob h1?
I feel the same way as @fir3drag0n. Could you create a blueprint for Aqara H1 knob? product model is âZNXNKG02LMâ
Any progress on this?
Separate issue I ran into as of 2023.7.1 (may have been broken before, but I recently updated to a newer version of this Blueprint via this updater script: GitHub - koter84/HomeAssistant_Blueprints_Update: This is a script to automatically check for updates for your HA Blueprints
As a result of one/both of those changes, all my automations using this blueprint failed with the following error:
message malformed: invalid template (templatesyntaxerror: unexpected char '\\' at 67) for dictionary value @ data['action'][0]['variables']['command']
Anyways, I had to manually edit the blueprint to fix the issue.
'{{ trigger.to_state.attributes.action if trigger.to_state.state == "" else trigger.to_state.state }}'
to the former value of '{{ trigger.to_state.state }}'
.It looks like you can just change the line to:
command: '{{ trigger.to_state.attributes.action if trigger.to_state.state == "" else trigger.to_state.state }}'
Which is what the official blueprint syntax is. Looks like the update script may be parsing the source incorrectly and it escaped the double double quotes.
Works for me with that edit
Hey @Scoff ; have you find a way to manage this ? Iâm looking to the exact same behavior too.
@Drafted : Any recommendation for this ?
Hey @flowerpower , I ended up using AppDaemon and ControllerX with Z2M in order to achieve the single click, double click and hold dimming functionality - works perfectly
Great idea !! I just had a look and it fits the needs Thanks !
@Scoff: Did you (or anyone else) ever find a solution? Iâd like to do something like:
âŚwith my Aqara Mini Switch (single button), which exposes single, double, triple, quadruple, hold
and release
. Thanks!
Can be added support for WXKG13LM ? (The new T1 switch) Xiaomi WXKG13LM control via MQTT | Zigbee2MQTT
Use a new native method to bind any keys without bluprints.
I no longer use this blueprint and have no plans to support it.
I have a noob question.
I have the WXKG11LM switch, and HA is only showing âsingleâ aciton in the triggers for this device.
Am I missing something?
I also tried few blueprints and the switch is not showing in the entities when I search for it, so none of the automations worked.
Thanks