Skip to content

Instantly share code, notes, and snippets.

@idcrook
Last active January 4, 2025 00:24
Show Gist options
  • Save idcrook/a5406ea0bb911435603958351858f466 to your computer and use it in GitHub Desktop.
Save idcrook/a5406ea0bb911435603958351858f466 to your computer and use it in GitHub Desktop.
Home assistant blueprint using event entity (Z2M 2.x) for Smartthings Button
blueprint:
name: Zigbee2MQTT 2.x - Samsung SmartThings Button - event entity
description: Automate your Samsung SmartThings button using Zigbee2MQTT.
domain: automation
input:
samsung_smartthings_button:
name: Samsung SmartThings Button
description: The Samsung SmartThings button to use
selector:
entity:
filter:
- integration: mqtt
domain: event
multiple: false
remote_button_short_press:
name: Single Press
description: Action to run on single press
default: []
selector:
action: {}
remote_button_double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
remote_button_hold_press:
name: Hold Press
description: Action to run on hold
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/zigbee2mqtt-z2m-samsung-smartthings-button/419722
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: !input samsung_smartthings_button
to: ~
action:
- variables:
# ["off","single","double","hold"]
event_type: "{{ trigger.to_state.attributes.event_type }}"
- choose:
- conditions:
- "{{trigger.from_state.state != 'unavailable'}}"
- "{{ event_type == 'single' }}"
sequence: !input remote_button_short_press
- conditions:
- "{{trigger.from_state.state != 'unavailable'}}"
- "{{ event_type == 'double' }}"
sequence: !input remote_button_double_press
- conditions:
- "{{trigger.from_state.state != 'unavailable'}}"
- "{{ event_type == 'hold' }}"
sequence: !input remote_button_hold_press
homeassistant:
enabled: true
# legacy_action_sensor: true
experimental_event_entities: true. # still needed to include this configuration at 2.0.0 release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment