Skip to content

Instantly share code, notes, and snippets.

@lintaba
Last active October 18, 2022 20:06
Show Gist options
  • Select an option

  • Save lintaba/5ecb40fc7fdfd78d2348dc51497107b2 to your computer and use it in GitHub Desktop.

Select an option

Save lintaba/5ecb40fc7fdfd78d2348dc51497107b2 to your computer and use it in GitHub Desktop.
blueprint:
name: "BTNW Quick toggle to set brighness"
description: "Change brighness with quick on-off toggle"
domain: automation
input:
switch:
name: Switch
description: Switch to turn on-off-on.
selector:
entity:
domain: binary_sensor
target_light:
name: Light
description: Light to change brightness.
selector:
entity:
domain: light
light_low:
name: Low light percent
default: 10
selector:
number:
min: 5
max: 75
step: 1
unit_of_measurement: "%"
mode: slider
trigger:
- type: not_powered
platform: device
entity_id: !input switch
domain: binary_sensor
action:
- wait_for_trigger:
- type: powered
platform: device
entity_id: !input switch
domain: binary_sensor
timeout: "5"
continue_on_timeout: false
- if:
- condition: numeric_state
entity_id: !input target_light
attribute: brightness
below: "76"
then:
- service: light.turn_on
data:
brightness_pct: 100
target:
entity_id: !input target_light
else:
- service: light.turn_on
data:
brightness_pct: !input light_low
target:
entity_id: !input target_light
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment