ZHA Sonoff SNZB-01P wireless button short_double_long press action

Implement the corresponding blueprint for the current trigger conditions of not clicking, double clicking, and long pressing in automation after ZHA connects to SNZB-01P
Implemented three actions as shown in the figure

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

blueprint:
  name: Sonoff Zigbee wireless Button SNZB-01P
  description: Setup actions for three functions of the SONOFF Zigbee button with Press ,Double Press, and long press.
  domain: automation
  input:
    button_id:
      name: Button
      description: The button to configure.
      selector:
        device:
          manufacturer: eWeLink
          model: SNZB-01P
          multiple: false
    press_action:
      name: Press Action
      description: Action to perform on Press.
      default: []
      selector:
        action: {}
    double_press_action:
      name: Double Press Action
      description: Action to perform on Double Press.
      default: []
      selector:
        action: {}
    long_press_action:
      name: Long Press Action
      description: Action to perform on Hold.
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/zha-sonoff-snzb-01p-wireless-button-short-double-long-press-action/635422
variables:
  button_id: !input button_id
  press_action: !input press_action
  double_press_action: !input double_press_action
  long_press_action: !input long_press_action
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input button_id
action:
- choose:
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.command == "toggle" }}'
    sequence: !input press_action
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.command == "on" }}'
    sequence: !input double_press_action
  - conditions:
    - condition: template
      value_template: '{{ trigger.event.data.command == "off" }}'
    sequence: !input long_press_action
2 Likes

According to my HA the “import” link is pointing to:

Did you find a way to use this blueprint? It points to a wrong URL for me as well.
I’m new to blueprints and tried to investigate creating one from scratch with the above code but not able to because of my limited knowledge :frowning:

Sorry for late reply, I didn’t get any notification about it.

There are other similar topics for this.

Use this blueprint and the last message ParksideParade.
After (or while?) installing the blueprint, you need to change the device name, then it works.

1 Like

Fantastic, really appreciate the reply and help!

1 Like

Thank you very much for this great blueprint. It worked for me in a minute!