Blueprint to support the Samsung SmartThings Button using Zigbee2MQTT.
Built starting with the ZHA version by johnny5w
Supported actions:
Single press
Double press
Hold
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"
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
p-clausen
(P Clausen)
August 11, 2022, 7:33pm
2
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
smoysauce
(smoysauce)
August 26, 2022, 8:58pm
3
I have this same issue, did you ever get it figured out?
Nolo
(Nolo)
March 16, 2023, 2:42pm
4
Wondering if you able to figure this out as I am having the same issue with this blueprint
leptians
(Leptians)
April 12, 2023, 5:47am
5
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
idcrook
(David Crook)
December 29, 2024, 1:59am
7
I was encountering the same problems. Now works for me!
I figured it was something to do with the triggering. Made a local copy off blueprint. Now works after commenting out attribute: action
in trigger:
attribute: action
Can comment or delete line in trigger
portion of blueprint.
trigger:
- platform: state
entity_id: !input samsung_smartthings_button
# attribute: action
found referenced at Zigbee2MQTT - Tuya 4-button Scene Switch (TS0044) - #54 by just.bondarenko
1 Like
Ok. I just updated the YAML in my original blueprint post to remove attribute: action
. I think that should fix the blueprint when imported.
1 Like