Multi-Press Sensor Trigger Blueprint for Home Assistant

Multi-Press Sensor Trigger Blueprint for Home Assistant

A simple and flexible blueprint for automating actions based on single, double, and long press events from a sensor entity. Ideal for devices like the Sonoff SNZB-01, this blueprint allows you to configure specific actions for each press type.

Features:

  • Supports single press, double press, and long press events.
  • Fully customizable actions for each press type.
  • Works with any sensor entity that changes state based on button presses.

Usage:

  1. Import the blueprint using the link below.
  2. Create a new automation using the blueprint.
  3. Select the sensor entity and define actions for each press type.

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


Example Automations:

Single Press:
Toggle a light.

service: light.toggle
target:
  entity_id: light.living_room

Double Press:
Turn on the light at full brightness.

service: light.turn_on
data:
  brightness: 255
target:
  entity_id: light.living_room

Long Press:
Turn off the light.

service: light.turn_off
target:
  entity_id: light.living_room

Contribution:

Feel free to contribute or share feedback for improvements! You can fork this blueprint on GitHub or Gist and modify it to suit your needs.

Hello
Is your blueprint compatible with the zigbeetomqqt version 2.0 who stop the usage of action and click

  • Only breaking when legacy is enabled:
    • Action and click sensors have been removed (homeassistant.legacy_triggers setting). This means all sensor.*_action and sensor.*_click entities are removed. Use the MQTT device trigger instead.
    • Entity attributes (homeassistant.legacy_entity_attributes setting) has been removed. This means that entities discovered by Zigbee2MQTT will no longer have entity attributes (Home Assistant entity attributes are accessed via e.g. states.binary_sensor.my_sensor.attributes).

Thanks

i think i made it possible to use with your usecase
please try it and let me know