This is a Blueprint for automating the Linkind 1-Key Remote Control (ZBT-DIMSwitch-D0001), a Zigbee remote control which, as the name suggests, has a single button that supports short and long button presses.
I had seen reports of this button working with ZHA, so I decided to give it a try. It has been working flawlessly for me for a couple of weeks now using a manual automation with zha_event triggers, so I created this Blueprint and am sharing in case it is useful for others. Thanks to @makeitworktech, @bowentz and @freshcoast for Blueprint-related inspiration.
I purchased the remote control as part of a kit that also included a Zigbee plug (Amazon link), but the remote control is also available as a stand-alone purchase (Amazon link). Unfortunately, both are out of stock currently, at least on Amazon.
I welcome any suggestions for improving this Blueprint.
blueprint:
name: ZHA - Linkind 1-Key Remote Control
description: Execute action(s) on short button press and/or long button press.
domain: automation
input:
linkind_remote:
name: Linkind 1-Key Remote Control
selector:
device:
integration: zha
manufacturer: lk
model: ZBT-DIMSwitch-D0001
button_short_press:
name: Short Button Press
description: Action(s) to run on short button press.
default: []
selector:
action: {}
button_long_press:
name: Long Button Press
description: Action(s) to run on long button press.
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/zha-linkind-1-key-remote-control-zbt-dimswitch-d0001/383521
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'linkind_remote'
action:
- variables:
button_cluster_id: '{{ trigger.event.data.cluster_id }}'
button_command: '{{ trigger.event.data.command }}'
- choose:
- conditions:
- '{{ button_cluster_id == 6 }}'
- '{{ button_command in [''on'', ''off''] }}'
sequence: !input 'button_short_press'
- conditions:
- '{{ button_cluster_id == 8 }}'
- '{{ button_command == ''move'' }}'
sequence: !input 'button_long_press'