Skip to content

Instantly share code, notes, and snippets.

@ThomasHack
Last active December 14, 2025 11:03
Show Gist options
  • Select an option

  • Save ThomasHack/87566a01632e5d1b3ca0ee8cdf7b6878 to your computer and use it in GitHub Desktop.

Select an option

Save ThomasHack/87566a01632e5d1b3ca0ee8cdf7b6878 to your computer and use it in GitHub Desktop.
blueprint:
name: "IKEA Bilresa – Live & Unlocked (Custom)"
description: "Requires modified event.py! Triggers on every 'multi_press_ongoing' event to provide smooth, unlimited scrolling."
domain: automation
input:
scrollwheel_right_event_entity:
name: "Scroll Wheel – Right (Button 1)"
description: "Entity that fires when rotating right"
selector:
entity:
domain: event
scrollwheel_left_event_entity:
name: "Scroll Wheel – Left (Button 2)"
description: "Entity that fires when rotating left"
selector:
entity:
domain: event
target_light:
name: "Target Light"
selector:
entity:
domain: light
step_percentage:
name: "Brightness Step per Tick (%)"
description: "Amount to change brightness for every detected rotation tick."
default: 5
selector:
number:
min: 1
max: 20
trigger:
# With force_update=True, this triggers on every packet received
- platform: state
entity_id: !input scrollwheel_right_event_entity
id: "right"
- platform: state
entity_id: !input scrollwheel_left_event_entity
id: "left"
condition:
# This is the magic check. It only works because you modified event.py
# to allow "multi_press_ongoing" through.
- condition: template
value_template: "{{ trigger.to_state.attributes.event_type == 'multi_press_ongoing' }}"
action:
- variables:
step: !input step_percentage
is_right: "{{ trigger.id == 'right' }}"
# Direction Logic: Right = +1 (Brighten), Left = -1 (Dim)
# (You can swap the 1 and -1 below if your wheel is inverted)
direction_sign: "{{ 1 if is_right else -1 }}"
final_change: "{{ step * direction_sign }}"
# Apply the change
- if:
- condition: state
entity_id: !input target_light
state: "on"
then:
- service: light.turn_on
target:
entity_id: !input target_light
data:
brightness_step_pct: "{{ final_change }}"
else:
# If light is OFF, only turn ON if we are brightening (Right)
- if:
- condition: template
value_template: "{{ direction_sign > 0 }}"
then:
- service: light.turn_on
target:
entity_id: !input target_light
data:
brightness_pct: "{{ step }}"
mode: queued
max: 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment