Files
home-assistant-blueprints/README.md
2025-10-25 21:41:26 -07:00

5.4 KiB

Home Assistant Blueprints

Multi-Press Action Blueprint

Trigger different actions based on how many times an entity changes state rapidly. Perfect for light switches, buttons, or any entity where you want single, double, triple, or quad-press actions.

Import URL

https://git.johnogle.info/johno/home-assistant-blueprints/raw/branch/main/multi_press_action.yaml

Installation

Method 1: Import via UI

  1. Go to Settings → Automations & Scenes → Blueprints
  2. Click "Import Blueprint" (blue button, bottom right)
  3. Paste the import URL above
  4. Click "Preview" then "Import"

Method 2: Manual Installation

  1. Download the blueprint file
  2. Place it in /config/blueprints/automation/multi_press_action.yaml
  3. Restart Home Assistant or reload automations

Features

  • Configurable time window: Set how quickly presses must occur (default 1.5s)
  • Immediate or delayed single-press: Choose whether single press acts instantly or waits
  • Up to 4 press levels: Single, double, triple, and quad press actions
  • Complex action support: Each action can include conditions, scenes, scripts, and more

Configuration Options

Input Description Default
Trigger Entity The entity to monitor for state changes Required
Time Window Maximum time between presses (seconds) 1.5
Execute Single Press Immediately Run single press action without waiting Yes
Single Press Action Action(s) to run on single press None
Double Press Action Action(s) to run on double press None
Triple Press Action Action(s) to run on triple press None
Quad Press Action Action(s) to run on quad press (4 times) None

Usage Examples

Example 1: Light Switch with Scene Control

Use Case: Normal switch operation, but double-press for bright scene

Configuration:

  • Trigger Entity: light.bedroom
  • Immediate Single Press: Enabled
  • Single Press Action: Leave empty (light toggles naturally)
  • Double Press Action:
  - choose:
      - conditions:
          - condition: sun
            after: sunset
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.bedroom_bright_night
      - conditions:
          - condition: sun
            before: sunset
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.bedroom_bright_day

Example 2: Button with Escalating Actions

Use Case: Button that does more based on number of presses

Configuration:

  • Trigger Entity: binary_sensor.my_button
  • Immediate Single Press: Disabled (wait to see if multi-press)
  • Single Press Action: Turn on TV
  • Double Press Action: Turn on TV + soundbar + dim lights
  • Triple Press Action: Full movie mode (TV + soundbar + lights off + close blinds)
  • Quad Press Action: Party mode

Example 3: Bathroom Light with Time-Based Logic

Configuration:

  • Trigger Entity: light.bathroom
  • Immediate Single Press: Enabled
  • Triple Press Action:
  - choose:
      - conditions:
          - condition: time
            after: "22:00:00"
            before: "06:00:00"
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.bathroom
            data:
              brightness_pct: 10
              color_temp: 454
      default:
        - service: light.turn_on
          target:
            entity_id: light.bathroom
          data:
            brightness_pct: 100

Updates

To get the latest version of this blueprint:

  1. Go to Settings → Automations & Scenes → Blueprints
  2. Find "Multi-Press Action" in your list
  3. Click the menu (three dots)
  4. Select "Re-import Blueprint"
  5. Your existing automations will automatically use the updated version

Changelog

v1.0.0 (2025-10-25)

  • Initial release
  • Support for single, double, triple, and quad press actions
  • Configurable time window
  • Optional immediate single-press mode
  • Full action sequence support with conditions

Tips

  • Immediate mode (default): Best for switches that control things directly (like lights). No delay on single press.
  • Delayed mode: Best for buttons that only trigger automations. Waits to see if you're doing a multi-press.
  • Time window: Start with 1.5s. Increase if you have trouble with multi-press detection, decrease for faster response.
  • Action complexity: Each action input supports full Home Assistant action sequences - use conditions, choose blocks, multiple services, etc.

Troubleshooting

Multi-press not detecting:

  • Increase the time window
  • Check that your entity is actually changing state rapidly
  • Look at Developer Tools → Events to watch state_changed events

Single press delayed even in immediate mode:

  • Make sure "Execute Single Press Immediately" is enabled
  • Check that your single press action isn't empty (unless you want the natural entity behavior)

Automation not working:

  • Check the automation trace (Settings → Automations → your automation → ⋮ → Traces)
  • Verify your trigger entity is the correct one
  • Test with simple actions first (like notifications)

Support

Found a bug or have a feature request? Open an issue on the repository!

License

Feel free to use, modify, and share this blueprint!