Skip to content

Instantly share code, notes, and snippets.

@loopj
Created February 22, 2025 22:37
Show Gist options
  • Save loopj/180c959a821f252ddc4c7ad7b8031eee to your computer and use it in GitHub Desktop.
Save loopj/180c959a821f252ddc4c7ad7b8031eee to your computer and use it in GitHub Desktop.
Trigger an action when a Vantage button is held for more than a specified time.
blueprint:
name: "Vantage Button Held"
description: "Trigger an action when a Vantage button is held for more than a specified time."
domain: automation
input:
button_id:
name: "Vantage Button ID"
description: "The ID of the button to monitor."
selector:
number:
min: 1
max: 9999
mode: box
hold_time:
name: "Hold Time (seconds)"
description: "Minimum duration the button must be held."
default: 1
selector:
number:
min: 1
max: 10
unit_of_measurement: "seconds"
action:
name: "Action"
description: "The action to run when the button is held for the specified time."
selector:
action:
mode: parallel
trigger:
- platform: event
event_type: vantage_button_pressed
event_data:
button_id: !input button_id
action:
- wait_for_trigger:
- platform: event
event_type: vantage_button_released
event_data:
button_id: !input button_id
timeout:
seconds: !input hold_time
- condition: "{{ wait.trigger is none }}" # If timeout occurs, button was held long enough
- choose:
- conditions: []
sequence: !input action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment