Skip to content

Instantly share code, notes, and snippets.

@jgillies
Created August 24, 2025 00:59
Show Gist options
  • Select an option

  • Save jgillies/5caf4d84ba0a4b73ba400a52a34f5da9 to your computer and use it in GitHub Desktop.

Select an option

Save jgillies/5caf4d84ba0a4b73ba400a52a34f5da9 to your computer and use it in GitHub Desktop.
blueprint:
name: Double-toggle light → 100% brightness
description: >
When a selected light is toggled twice within a short window, set that same
light to 100% brightness.
domain: automation
input:
target_lights:
name: Lights to watch
description: One or more light entities that you physically toggle.
selector:
entity:
domain: light
multiple: true
window_ms:
name: Double-toggle window (ms)
description: How quickly the two toggles must happen.
default: 600
selector:
number:
min: 150
max: 2000
step: 50
unit_of_measurement: ms
mode: restart
max_exceeded: silent
triggers:
- platform: state
entity_id: !input target_lights
# any on↔off change counts as a toggle
conditions: []
actions:
- variables:
light_id: "{{ trigger.entity_id }}"
window: !input window_ms
# Wait for the SAME light to change state again within the window
- wait_for_trigger:
- platform: state
entity_id: "{{ light_id }}"
timeout:
milliseconds: "{{ window | int }}"
continue_on_timeout: true
# Only act if a second toggle actually occurred in time
- choose:
- conditions: "{{ wait.trigger is not none }}"
sequence:
- service: light.turn_on
target:
entity_id: "{{ light_id }}"
data:
brightness_pct: 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment