Skip to content

Instantly share code, notes, and snippets.

@kevinkucharczyk
Last active April 3, 2024 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinkucharczyk/a9ae0cdf9412239e9bbbe68a140cf3d4 to your computer and use it in GitHub Desktop.
Save kevinkucharczyk/a9ae0cdf9412239e9bbbe68a140cf3d4 to your computer and use it in GitHub Desktop.
moes smart button
blueprint:
name: ZHA - Moes Smart Button
description: Automate your Moes Smart Button using ZHA events.
domain: automation
input:
moes_smart_button:
name: Moes Smart Button
description: Moes Smart Button to use
selector:
device:
integration: zha
manufacturer: _TZ3000_ja5osu5g
model: TS004F
button_short_press:
name: Single Press
description: Action to run on short press
default: []
selector:
action: {}
button_double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_long_press:
name: Long Press
description: Action to run on long press
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'moes_smart_button'
action:
- variables:
command: '{{ trigger.event.data.command }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
- conditions: "{{ command == 'remote_button_short_press' }}"
sequence:
- choose:
- conditions: '{{ endpoint_id == 1 }}'
sequence: !input 'button_short_press'
- conditions: "{{ command == 'remote_button_double_press' }}"
sequence:
- choose:
- conditions: '{{ endpoint_id == 1 }}'
sequence: !input 'button_double_press'
- conditions: "{{ command == 'remote_button_long_press' }}"
sequence:
- choose:
- conditions: '{{ endpoint_id == 1 }}'
sequence: !input 'button_long_press'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment