Smooth Hold-to-Dim / Brighten
This blueprint lets you control any light, group, or area using a 2-button remote with event entities (such as multi-press and hold events). It offers single-press toggles, double-press shortcuts, and a smooth duration-based dimming/brightening calculation when holding down the buttons.
Features
- Button 1 Single Press: Turns target lights on immediately.
- Button 1 Double Press: Sets target lights to 100% brightness instantly.
- Button 1 Hold & Release: Smoothly ramps brightness up.
- Button 2 Single Press: Turns target lights off.
- Button 2 Hold & Release: Smoothly ramps brightness down.
Requirements
- Home Assistant: 2024.1.0 or newer (uses modern
actionsyntax andevententities). - Compatible Remote: Any 2-button remote that exposes
evententities supportingmulti_press_1,multi_press_2,long_press, andlong_releaseevent types.- Tested & Works Great With: IKEA BILRESA (E2489)
Inputs
- Button 1 Event Entity: The event entity associated with Button 1 (e.g., UP / Brighten).
- Button 2 Event Entity: The event entity associated with Button 2 (e.g., DOWN / Dim).
- Reference Light Entity: A specific light entity used to sample the current brightness percentage before starting a dimming/brightening operation.
- Target Lights / Area: The target entities, devices, light groups, or entire area you want to control.
Installation Options
Option 1: Import via Badge
Click the My Home Assistant import badge at the top of the post.
Option 2: Manual Import
Import a blueprint from this address: https://gist.github.com/Blightbuster/f1673ce4be3be068dbb7f7086092f4df
Usage
- Go to Settings > Automations & Scenes > Automations.
- Click + Create Automation.
- Select Remote Light Control with Smooth Hold-to-Dim.
- Map your remote event entities and choose your reference light and target entities/areas.
- Save and enjoy smooth remote light adjustments!
YAML Blueprint Code
Summary
blueprint:
name: Button Light Control with Smooth Hold-to-Dim
description: >
Controls light brightness using a 2-button remote with single-press, double-press,
and smooth hold-to-dim/brighten features based on press duration.
domain: automation
input:
button_1_entity:
name: Button 1 Event Entity
description: The event entity for Button 1 (e.g., Up/Brighten button).
selector:
entity:
domain: event
button_2_entity:
name: Button 2 Event Entity
description: The event entity for Button 2 (e.g., Down/Dim button).
selector:
entity:
domain: event
reference_light:
name: Reference Light Entity
description: >
The specific light entity used to read the current brightness state during dimming operations.
selector:
entity:
domain: light
target_lights:
name: Target Lights / Area
description: The lights, group, or area to control.
selector:
target:
entity:
domain: light
mode: restart
triggers:
- trigger: event.received
target:
entity_id: !input button_1_entity
options:
event_type:
- multi_press_1
id: button_1_pressed_once
- trigger: event.received
target:
entity_id: !input button_2_entity
options:
event_type:
- multi_press_1
id: button_2_pressed_once
- trigger: event.received
target:
entity_id: !input button_1_entity
options:
event_type:
- long_press
id: button_1_held_down
- trigger: event.received
target:
entity_id: !input button_2_entity
options:
event_type:
- long_press
id: button_2_held_down
- trigger: event.received
target:
entity_id: !input button_1_entity
options:
event_type:
- multi_press_2
id: button_1_pressed_twice
conditions: []
actions:
- choose:
# --- BUTTON 1 HELD: Brighten ---
- conditions:
- condition: trigger
id:
- button_1_held_down
sequence:
- variables:
ref_light: !input reference_light
start_time: "{{ now().timestamp() }}"
start_brightness: >-
{{ (state_attr(ref_light, 'brightness') | float(0) / 2.55) | round(0) }}
target_transition: >-
{% set start = (state_attr(ref_light, 'brightness') | float(0) / 2.55) | round(0) %}
{{ [(100 - start) / 20, 0.1] | max }}
- parallel:
- action: light.turn_on
target: !input target_lights
data:
transition: "{{ target_transition }}"
brightness_pct: 100
continue_on_error: true
- sequence:
- wait_for_trigger:
- trigger: event.received
target:
entity_id: !input button_1_entity
options:
event_type:
- long_release
- action: light.turn_on
target: !input target_lights
data:
brightness_pct: >-
{% set elapsed = now().timestamp() - start_time %}
{% set added_pct = (elapsed / 5) * 100 %}
{% set final_pct = start_brightness + added_pct %}
{{ [final_pct | round(0), 100] | min }}
# --- BUTTON 2 HELD: Dim ---
- conditions:
- condition: trigger
id:
- button_2_held_down
sequence:
- variables:
ref_light: !input reference_light
start_time: "{{ now().timestamp() }}"
start_brightness: >-
{{ (state_attr(ref_light, 'brightness') | float(0) / 2.55) | round(0) }}
target_transition: >-
{% set start = (state_attr(ref_light, 'brightness') | float(0) / 2.55) | round(0) %}
{{ [start / 20, 0.1] | max }}
- parallel:
- action: light.turn_on
target: !input target_lights
data:
transition: "{{ target_transition }}"
brightness_pct: 1
continue_on_error: true
- sequence:
- wait_for_trigger:
- trigger: event.received
target:
entity_id: !input button_2_entity
options:
event_type:
- long_release
- action: light.turn_on
target: !input target_lights
data:
brightness_pct: >-
{% set elapsed = now().timestamp() - start_time %}
{% set sub_pct = (elapsed / 5) * 100 %}
{% set final_pct = start_brightness - sub_pct %}
{{ [final_pct | round(0), 1] | max }}
# --- BUTTON 1 SINGLE PRESS: Turn On ---
- conditions:
- condition: trigger
id:
- button_1_pressed_once
sequence:
- action: light.turn_on
target: !input target_lights
data:
transition: 0
# --- BUTTON 2 SINGLE PRESS: Turn Off ---
- conditions:
- condition: trigger
id:
- button_2_pressed_once
sequence:
- action: light.turn_off
target: !input target_lights
data:
transition: 0
# --- BUTTON 1 DOUBLE PRESS: Full Brightness ---
- conditions:
- condition: trigger
id:
- button_1_pressed_twice
sequence:
- action: light.turn_on
target: !input target_lights
data:
brightness_pct: 100