HarvsG
July 2, 2023, 11:25am
1
Check the version number of your shortcut button
As of 2.3.075 the shortcut buttons no longer fire multiple messages for each press, and a new double press “off” command is introduced. This makes automations much simpler.
Checking software version numbers in ZHA:
Device page of the device in question
3 dots next to “RECONFIGURE” → Manage Zigbee Device
Clusters → Basic (Endpoint id: 1, Id: 0x0000, Type: in)
Cluster Attributes → sw_build_id (id: 0x4000)
Click Read Attribute
If device is battery powered, trigger it somehow
The version should appear in the “Value” box
If you are using an older version then you can have a look at this blueprint ZHA - IKEA Tradfri Shortcut button
If you want to update your firmware then you may find this link useful. But beware, your other Tradfri products are likely to be updated during the process and there are some breaking changes, particularly with the binding behaviour of the on/off switches.
Are you sure you don’t want the release version ?
blueprint:
name: BETA ZHA - IKEA Tradfri Shortcut button
description: Control anything with the ikea shortcut button
source_url: https://https://community.home-assistant.io/t/zha-ikea-tradfri-shortcut-button-firmware-2-3-075-or-greater/402565
domain: automation
input:
shortcut_button:
name: Device
description: Select an IKEA shortcut button
selector:
device:
integration: zha
manufacturer: IKEA of Sweden
model: TRADFRI SHORTCUT Button
button_short:
name: Single click
description: 'Choose action(s) when short pressed:'
default: []
selector:
action: {}
button_double:
name: Double click
description: 'Choose action(s) when double pressed:'
default: []
selector:
action: {}
button_long:
name: Long click
description: 'Choose action(s) when long pressed:'
default: []
selector:
action: {}
button_release:
name: Release Long Click
description: 'Choose action(s) (if any) when releasing long press. This will run in a separate call of the automation so in "single" mode it may be suppressed by the long-press action if that takes some time. It cannot easily be used to stop a long-press action, for that - use mode: "restart instead" '
default: []
selector:
action: {}
automation_mode:
name: Automation Mode
description: 'The [mode](https://www.home-assistant.io/docs/automation/modes/) for this automation. Default is "single" - further actions are blocked whilst the automation is running. Choose "resart" if you want the long-press action to stop on release.'
default: single
selector:
select:
options:
- single
- restart
- queued
- parallel
mode: !input 'automation_mode'
trigger:
- platform: event
event_type: zha_event
event_data:
cluster_id: 6
device_id: !input 'shortcut_button'
- platform: event
event_type: zha_event
event_data:
cluster_id: 8
device_id: !input 'shortcut_button'
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
args: '{{ trigger.event.data.args }}'
- choose:
- conditions:
- '{{ endpoint_id == 1 }}'
- '{{ cluster_id == 6 }}'
- '{{ command == ''on'' }}'
sequence:
- choose:
default: !input 'button_short'
- conditions:
- '{{ endpoint_id == 1 }}'
- '{{ cluster_id == 6 }}'
- '{{ command == ''off'' }}'
sequence:
- choose:
default: !input 'button_double'
- conditions:
- '{{ endpoint_id == 1 }}'
- '{{ cluster_id == 8 }}'
- '{{ command == ''move_with_on_off'' }}'
sequence:
- choose:
default: !input 'button_long'
- conditions:
- '{{ endpoint_id == 1 }}'
- '{{ cluster_id == 8 }}'
- '{{ command == ''stop_with_on_off'' }}'
sequence:
- choose:
default: !input 'button_release'
Fork of: ZHA - IKEA Tradfri Shortcut button
Edit 1: On my install at least the ‘wait_for_trigger’ is never triggered and the automation times out.
Edit 2: 2023-07-02 Edited post instructions for checking firmeware version for the new UI
1 Like
2023-07-02 Version 2 release:
Removed the - wait_for_trigger:
and timeout
blocks as I am not sure what they were achieving
The automation will only trigger on cluster_id
6 and 8. So it will no longer trigger on device checkin
which will simplify logbooks, debugging and traces.
Automation mode is now user-configurable
Button release action is now configurable.
To update either see the guide here or delete all your automations that use the blueprint and then delete the blueprint and re-import with the link above.
An example of a version that dims a light until the button is released. Automation Mode: restart
doing the work of ‘stopping’ here. When the button is released the automation is triggered again which interrupts the previous run which was doing the dimming.
alias: "[ZHA] Study Shortcut Button Beta test"
description: ""
use_blueprint:
path: >-
HarvsG/beta-testing-zha-ikea-tradfri-shortcut-button-firmware-2-3-075-or-greater.yaml
input:
shortcut_button: cf69732507e91ead4a2f4c7ffae3e7b5
button_short:
- service: light.toggle
data: {}
target:
entity_id: light.study_light
button_double:
- service: light.toggle
data: {}
target:
entity_id: light.study_lamp
button_long:
- repeat:
while:
- condition: numeric_state
entity_id: light.study_lamp
below: 256
above: 3
attribute: brightness
sequence:
- service: light.turn_on
data:
brightness_step_pct: -1
target:
entity_id: light.study_lamp
button_release: []
automation_mode: restart
If you wanted the button to switch between dimming and brightening, you could created a hidden input Boolean and toggle it in button_release
.
Hi,
I get this error message MANY times in the log. Any idea of what’s wrong??
2023-07-08 19:18:31.877 WARNING (MainThread) [homeassistant.components.automation.beta_zha_ikea_tradfri_shortcut_button] BETA ZHA - IKEA Tradfri Shortcut button: Already running
Also, for some reason, my Home Assistant cannot fetch the firmware version of my shortcut button
Thank you for pointing this out. Now fixed in Edit 3.
This shouldn’t have caused any failures, it was expected behaviour of single mode, I have added max_exceeded: silent back in to silence these log messages.
Are you ‘waking’ the device by clicking it whilst reading the attribute? (These battery powered zigbee devices sleep unless they are sending commands, so they will never respond to a server request unless they are woken - they are probably awake for less than a second after a click)
Thanks for your response. I ran into another problem before I had the chance to test what you suggested. The battery was drained within 24 hours for some reason. Any clue of what’s causing the battery to get depleted??
I had that issue when I tried the skyconnect. I switched back to conbee II I’m not sure what causes it but if you hunt around this forum and the github issues for HA core
opened 01:55PM - 19 Jan 23 UTC
integration: zha
### The problem
I switched from Deconz/Conbee to ZHA/Skyconnect and since then … the problems started.
Everyday some random devices (Aqara sensors, Ikea Bulbs) getting unavailable. I have to pair them again and the next day some diffent device is unavailable.
With Deconz/Conbee I never had this problems.
### What version of Home Assistant Core has the issue?
core-2023.1.5
### What was the last working version of Home Assistant Core?
core-2022.11
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
zha
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/zha
### Diagnostics information
[zha-f63193a751e4f18abbdbeaba6257af97-LUMI lumi.sensor_magnet.aq2-38e364b71addd13e8f72c896cb83e544.json.txt](https://github.com/home-assistant/core/files/10457314/zha-f63193a751e4f18abbdbeaba6257af97-LUMI.lumi.sensor_magnet.aq2-38e364b71addd13e8f72c896cb83e544.json.txt)
[zha-f63193a751e4f18abbdbeaba6257af97-Zigbee Coordinator-aabc7e236d33f421590e46eb61ea0400.json.txt](https://github.com/home-assistant/core/files/10457323/zha-f63193a751e4f18abbdbeaba6257af97-Zigbee.Coordinator-aabc7e236d33f421590e46eb61ea0400.json.txt)
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
```txt
2023-01-19 12:35:59.016 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x99DE](lumi.sensor_magnet.aq2): last_seen is 141280.53930068016 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:03.510 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xAD16](lumi.sensor_wleak.aq1): last_seen is 1038776.234536171 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:04.011 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x0CBA](SmokeSensor-EF-3.0): last_seen is 167550.2345740795 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:28.082 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x6378](lumi.sensor_wleak.aq1): last_seen is 144684.77171301842 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:30.030 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x3BBB](TRADFRI remote control): last_seen is 144489.35309433937 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:30.057 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xDB20](TRADFRI control outlet): last_seen is 614320.0762073994 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:32.193 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xAE69](lumi.sensor_magnet.aq2): last_seen is 169974.5131304264 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:47.953 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7D4](TRADFRI bulb E27 WS opal 1000lm): last_seen is 20564.596658945084 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:52.008 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x2A27](lumi.sensor_magnet.aq2): last_seen is 108069.15588212013 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:36:52.032 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x360D](lumi.sensor_magnet.aq2): last_seen is 170186.2264046669 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:37:04.510 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xAD16](lumi.sensor_wleak.aq1): last_seen is 1038837.235011816 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:37:12.012 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x0CBA](SmokeSensor-EF-3.0): last_seen is 167618.23617124557 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:37:12.019 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x99DE](lumi.sensor_magnet.aq2): last_seen is 141353.54190301895 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:37:32.083 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x6378](lumi.sensor_wleak.aq1): last_seen is 144748.77293539047 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:37:36.059 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xDB20](TRADFRI control outlet): last_seen is 614386.0775065422 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:37:45.031 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x3BBB](TRADFRI remote control): last_seen is 144564.3546833992 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:37:51.194 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xAE69](lumi.sensor_magnet.aq2): last_seen is 170053.51456308365 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:38:05.511 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xAD16](lumi.sensor_wleak.aq1): last_seen is 1038898.2359614372 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:38:11.954 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7D4](TRADFRI bulb E27 WS opal 1000lm): last_seen is 20648.59741950035 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:38:20.009 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x2A27](lumi.sensor_magnet.aq2): last_seen is 108157.15664672852 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:38:20.013 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x0CBA](SmokeSensor-EF-3.0): last_seen is 167686.2369081974 seconds ago and ping attempts have been exhausted, marking the device unavailable
2023-01-19 12:38:25.020 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x99DE](lumi.sensor_magnet.aq2): last_seen is 141426.5432062149 seconds ago and ping attempts have been exhausted, marking the device unavailable
```
### Additional information
_No response_
What’s the status of this “beta test”? Can I help? I have a bunch of these buttons and wrote my own blueprint recently but this one looks more “complete” so I’d prefer to use this.
HarvsG
March 22, 2024, 7:52am
8
At the moment it is almost* the same as the linked thread at the top:
Check the version number of your shortcut button
As of 2.3.075 the shortcut buttons no longer fire multiple messages for each press, and a new double press “off” command is introduced. This makes automations much simpler.
Checking software version numbers in ZHA:
Device page of the device in question
3 dots next to “RECONFIGURE” → Manage Zigbee Device
Clusters → Basic (Endpoint id: 1, Id: 0x0000, Type: in)
Cluster Attributes → sw_build_id (id: 0x4000)
Click Read Attribute
If device is batter…
I just keep this thread open so I can test/share changes as needed.
*This version doesn’t have max_exceeded: silent
to aid debugging.