Zigbee2MQTT [Z2M] - Samsung SmartThings Button

Blueprint to support the Samsung SmartThings Button using Zigbee2MQTT.
Built starting with the ZHA version by johnny5w

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Supported actions:

  • Single press
  • Double press
  • Hold

samsung-smartthings-button

Blueprint:

blueprint:
  name: Zigbee2MQTT [Z2M] - Samsung SmartThings Button
  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:
          integration: mqtt
          domain: sensor
    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: {}
mode: restart
max_exceeded: silent
trigger:
  - platform: state
    entity_id: !input "samsung_smartthings_button"
    attribute: action
action:
  - variables:
      press_type: "{{ trigger.to_state.state }}"
  - choose:
      - conditions:
          - "{{ press_type == 'single' }}"
        sequence: !input "remote_button_short_press"
      - conditions:
          - "{{ press_type == 'double' }}"
        sequence: !input "remote_button_double_press"
      - conditions:
          - "{{ press_type == 'hold' }}"
        sequence: !input "remote_button_hold_press"
1 Like

Hi ImplaleAle22

Thanks very much for this blueprint. I cant figure out, how to get the SmartThings Button to switch the state of a ligth. I have tried setting the automation up via the UI and the blueprint, but i get this error message.

“Error: UndefinedError: ‘dict object’ has no attribute ‘to_state’”

I am very new to the HA-scene and i cant seem to find any information, which can help solve my problem. Can anybody point me in the rigth direction? I will be very grateful.

My Automation Config is the following:

> mode: restart
> max_exceeded: silent
> trigger:
>   - platform: state
>     entity_id: sensor.knap_b_action
>     attribute: action
> action:
>   - variables:
>       press_type: '{{ trigger.to_state.state }}'
>   - choose:
>       - conditions:
>           - '{{ press_type == ''single'' }}'
>         sequence:
>           - type: toggle
>             device_id: 956fc7f9878e24e6864ca6657d10d933
>             entity_id: light.0x00178801082cd644
>             domain: light
>           - type: toggle
>             device_id: 61df5498cc083802392c1bf41cc259c5
>             entity_id: light.loftlampe_ved_skrivebordet
>             domain: light
>       - conditions:
>           - '{{ press_type == ''double'' }}'
>         sequence: []
>       - conditions:
>           - '{{ press_type == ''hold'' }}'
>         sequence: []
> id: '1660161786337'
> alias: Knap B - Hyggestuen
> description: '

And my blueprint config the following

> id: '1660161786337'
> alias: Knap B - Hyggestuen
> description: ''
> use_blueprint:
>   path: ImpaleAle22/zigbee2mqtt-z2m-samsung-smartthings-button.yaml
>   input:
>     samsung_smartthings_button: sensor.knap_b_action
>     remote_button_short_press:
>       - type: toggle
>         device_id: 956fc7f9878e24e6864ca6657d10d933
>         entity_id: light.0x00178801082cd644
>         domain: light
>       - type: toggle
>         device_id: 61df5498cc083802392c1bf41cc259c5
>         entity_id: light.loftlampe_ved_skrivebordet
>         domain: light

I have this same issue, did you ever get it figured out?

Wondering if you able to figure this out as I am having the same issue with this blueprint

This blueprint was working flawlessly. But then since I switched from Conbee2 to ZBDongle-P, it stops working.
I also changed to a new battery as well, but I don’t think it’s relevant here.
Somehow the automation never got triggered.

Migrated to z2m and used this blueprint and had no issues the first day. Then updated HA and not sure why, but my buttons aren’t working anymore. I see the button update the logs but the blueprint doesn’t trigger.

Edit, not sure why this template stopped working, but recreated it by hand using the right actions and setting trigger IDs