I was having trouble with the double press and long press using ZHA. Got them fixed with some simple code changes, just sharing here in case others find it useful:
In blueprints/automation/EPMatt/ikea_e1812.yaml
First change the variables:
Iâve paired my Tradfri shortcut button, set up the helper and selected the controller, but this blueprint just doesnât appear to work - listening on zha_event fires nothing, so appears dud.
Thanks for the BP! Single press and long press are working via Z2M but for some reason double press doesnât work, when I view the traces I see the first tap causes the single press event to run, the delay is executed to wait for the potential second tap and although the second one runs it fails the first condition so I assume thatâs why the first event still runs after the delay completes. Initially I was running the original firmware version it shipped with (2.3.015) and just upgraded to 2.3.080 but no change in behaviour. Any ideas?
Another issue now. Short press works. It fires the event and turn on a lamp. Long press and double press doesnât work properly. In the history log for my button it fires the event for long press and double press. But nothing actually happens with my lamp.
Same issue for me, after updating to 2.3.080 double click no longer registers. I donât even see the events in the log. Has anyone been able to work around this?
Edit: I should mention that single click and long press events work fine and show up in the log correctly.
Has anyone got this to successfully work with Zigbee2MQTT?
I have the Shortcut button working through Zigbee2MQTT fine and I can setup a basic automation to switch on a light. This blueprint is ideal but when setup it just doesnât trigger the required action. You can see the button is being pressed in the Blueprint events.
The automation will store the trigger_action as follows:
trigger_action: '{{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }}'
Later in that automation the trigger_action is evaluated against the button_long variable, which for ZHA is defined as follows:
button_long: [move_with_on_off_0_83]
For some reason the automation however picks up the above shown zha_event and evaluates that to move_with_on_off_MoveMode.Up_83. Can somebody explain what is happening here?
The template to create the trigger_action variable clearly is appending the trigger.event.data.command which is move_with_on_off by _ followed by the trigger.event.data.args separated by further _, if there are any args.
So I would expect the string to be move_with_on_off_0_83 and the automation to work⌠but somehow it is not.
Edit: I found this on Github and ammended my automation with the proposed changes. The automation is now working.
I just added this blueprint with deconz as the integration. It appears that the double-click is exposed as a discrete event in Deconz with code 2004. What would be needed to modify the blueprint to recognize 2004 as double-click instead of the virtual version?
From what I can tell, the deconz codes are 1002 (single click), 2004 (double click), 1001 (hold/long press), 1003 (release/long press).
There is an issue with the regex used in these blueprints for the Ikea buttons after a HA release. It doesnât look like these blueprints are being actively maintained as it was last updated over a year ago.
Please see the following post and thread that has the fix which involves you updating the blueprint file and removing some spaces from the regex statement: