Skip to content

Instantly share code, notes, and snippets.

@tlux
Last active May 2, 2026 21:41
Show Gist options
  • Select an option

  • Save tlux/e66b637ab7754dee00c0e2985c3eac80 to your computer and use it in GitHub Desktop.

Select an option

Save tlux/e66b637ab7754dee00c0e2985c3eac80 to your computer and use it in GitHub Desktop.
IKEA BILRESA Scroll Button Home Assistant Blueprint
blueprint:
name: IKEA BILRESA Scroll Button Light Control
description: Control a light with an IKEA BILRESA Scroll Button using on/off and level (scroll) commands.
domain: automation
input:
zha_device:
name: Button Device
description: The Zigbee device that sends events
selector:
device:
integration: zha
brightness_target:
name: Target Light
description: The light entity to control
selector:
entity:
domain: light
scaling_factor:
name: Scaling Factor
description: Multiplier applied to brightness changes
default: 0.5
selector:
number:
min: 0
max: 1
step: 0.1
mode: slider
mode: restart
max_exceeded: silent
variables:
brightness_target: !input brightness_target
scaling_factor: !input scaling_factor
trigger:
- platform: event
id: zha-on
event_type: zha_event
event_data:
device_id: !input zha_device
command: "on"
- platform: event
id: zha-off
event_type: zha_event
event_data:
device_id: !input zha_device
command: "off"
- platform: event
id: zha-level
event_type: zha_event
event_data:
device_id: !input zha_device
command: move_to_level
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.id == 'zha-level' }}"
sequence:
- variables:
current_brightness: >-
{{ state_attr(brightness_target, 'brightness') | default(0) | int }}
target_lvl: "{{ trigger.event.data.args[0] | default(0) | int }}"
diff: "{{ (target_lvl - current_brightness) * scaling_factor }}"
final_brightness: "{{ (current_brightness + diff) | round(0) | int }}"
- service: light.turn_on
target:
entity_id: !input brightness_target
data:
brightness: "{{ [ [final_brightness, 255] | min, 1 ] | max }}"
transition: 0.1
- conditions:
- condition: template
value_template: "{{ trigger.id == 'zha-on' }}"
sequence:
- service: light.turn_on
target:
entity_id: !input brightness_target
- conditions:
- condition: template
value_template: "{{ trigger.id == 'zha-off' }}"
sequence:
- service: light.turn_off
target:
entity_id: !input brightness_target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment