Actually it works very well with the last edit I did in my post #58
I wanted to create a separate blueprint as complement for the one you wrote, to make the script faster to implement, but was able to do only the first part with user input the action part cannot understand how to make it work … below my try. If I will succeed will edit this post and correct it.
blueprint:
name: Single/Double Tap
description: Perform actions based on single or double tap (based on counter
domain: script
input:
counter_entity:
name: Counter Entity
description: The entity_id of the counter.
selector:
entity:
domain: counter
single_tap_delay:
name: Single Tap Delay (milliseconds)
description: Delay in milliseconds after a single tap.
default: 400
selector:
number:
min: 0
max: 1000
unit_of_measurement: milliseconds
single_tap_action:
name: Single Tap Action
description: Action to perform on a single tap.
selector:
action:
double_tap_action:
name: Double Tap Action
description: Action to perform on a double tap.
selector:
action:
mode: restart
max_exceeded: silent
---NOT WORKING---
script:
alias: Single/Double Tap
sequence:
- service: counter.increment
target:
entity_id: !input counter_entity
- if:
- condition: state
entity_id: !input counter_entity
state: "1"
then:
- delay:
milliseconds: !input single_tap_delay
- sequence: !input single_tap_action
- service: counter.reset
target:
entity_id: !input counter_entity
else:
- if:
- condition: state
entity_id: !input counter_entity
state: "2"
then:
- sequence: !input double_tap_action
- service: counter.reset
target:
entity_id: !input counter_entity