Reorganize blueprints: move legacy blueprints to blueprints/automation
This commit is contained in:
@@ -1,127 +0,0 @@
|
|||||||
blueprint:
|
|
||||||
name: Multi-Press Action
|
|
||||||
description: Trigger different actions based on how many times an entity changes state rapidly
|
|
||||||
domain: automation
|
|
||||||
input:
|
|
||||||
trigger_entity:
|
|
||||||
name: Trigger Entity
|
|
||||||
description: The entity to monitor for state changes
|
|
||||||
selector:
|
|
||||||
entity: {}
|
|
||||||
|
|
||||||
press_counter:
|
|
||||||
name: Multi-Press Counter
|
|
||||||
description: House-wide counter helper for tracking presses (create counter.multi_press_counter)
|
|
||||||
default: counter.multi_press_counter
|
|
||||||
selector:
|
|
||||||
entity:
|
|
||||||
domain: counter
|
|
||||||
|
|
||||||
time_window:
|
|
||||||
name: Time Window
|
|
||||||
description: Maximum time between presses (in seconds)
|
|
||||||
default: 1.5
|
|
||||||
selector:
|
|
||||||
number:
|
|
||||||
min: 0.5
|
|
||||||
max: 5
|
|
||||||
step: 0.1
|
|
||||||
unit_of_measurement: seconds
|
|
||||||
|
|
||||||
immediate_single_press:
|
|
||||||
name: Execute Single Press Immediately
|
|
||||||
description: If enabled, single press action runs immediately without waiting. If disabled, waits to see if it's a multi-press before acting.
|
|
||||||
default: true
|
|
||||||
selector:
|
|
||||||
boolean: {}
|
|
||||||
|
|
||||||
single_press_action:
|
|
||||||
name: Single Press Action
|
|
||||||
description: Action to run on single press
|
|
||||||
default: []
|
|
||||||
selector:
|
|
||||||
action: {}
|
|
||||||
|
|
||||||
double_press_action:
|
|
||||||
name: Double Press Action
|
|
||||||
description: Action to run on double press
|
|
||||||
default: []
|
|
||||||
selector:
|
|
||||||
action: {}
|
|
||||||
|
|
||||||
triple_press_action:
|
|
||||||
name: Triple Press Action
|
|
||||||
description: Action to run on triple press
|
|
||||||
default: []
|
|
||||||
selector:
|
|
||||||
action: {}
|
|
||||||
|
|
||||||
quad_press_action:
|
|
||||||
name: Quad Press Action
|
|
||||||
description: Action to run on quad press (4 times)
|
|
||||||
default: []
|
|
||||||
selector:
|
|
||||||
action: {}
|
|
||||||
|
|
||||||
mode: restart
|
|
||||||
max_exceeded: silent
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
- platform: state
|
|
||||||
entity_id: !input trigger_entity
|
|
||||||
|
|
||||||
action:
|
|
||||||
- variables:
|
|
||||||
time_window: !input time_window
|
|
||||||
immediate: !input immediate_single_press
|
|
||||||
counter_entity: !input press_counter
|
|
||||||
|
|
||||||
# Increment the counter (each restart = new press)
|
|
||||||
- action: counter.increment
|
|
||||||
target:
|
|
||||||
entity_id: !input press_counter
|
|
||||||
|
|
||||||
# Execute single press immediately if enabled
|
|
||||||
- if:
|
|
||||||
- condition: template
|
|
||||||
value_template: "{{ immediate and states(counter_entity) | int == 1 }}"
|
|
||||||
then:
|
|
||||||
- choose:
|
|
||||||
- conditions: []
|
|
||||||
sequence: !input single_press_action
|
|
||||||
|
|
||||||
# Wait for the time window to see if more presses come
|
|
||||||
- delay:
|
|
||||||
seconds: "{{ time_window }}"
|
|
||||||
|
|
||||||
# Get final press count and execute appropriate action
|
|
||||||
- variables:
|
|
||||||
final_count: "{{ states(counter_entity) | int }}"
|
|
||||||
|
|
||||||
# Reset counter before executing actions
|
|
||||||
- action: counter.reset
|
|
||||||
target:
|
|
||||||
entity_id: !input press_counter
|
|
||||||
|
|
||||||
# Execute action based on final press count
|
|
||||||
- choose:
|
|
||||||
# Only run single press if NOT immediate (delayed mode)
|
|
||||||
- conditions:
|
|
||||||
- condition: template
|
|
||||||
value_template: "{{ final_count == 1 and not immediate }}"
|
|
||||||
sequence: !input single_press_action
|
|
||||||
|
|
||||||
- conditions:
|
|
||||||
- condition: template
|
|
||||||
value_template: "{{ final_count == 2 }}"
|
|
||||||
sequence: !input double_press_action
|
|
||||||
|
|
||||||
- conditions:
|
|
||||||
- condition: template
|
|
||||||
value_template: "{{ final_count == 3 }}"
|
|
||||||
sequence: !input triple_press_action
|
|
||||||
|
|
||||||
- conditions:
|
|
||||||
- condition: template
|
|
||||||
value_template: "{{ final_count >= 4 }}"
|
|
||||||
sequence: !input quad_press_action
|
|
||||||
Reference in New Issue
Block a user