IKEA Bilresa Scroll Wheel without Blueprint

If you want to test the ikea bilresa scroll wheel without any blueprint, you do it like that:

# ikea matter bilresa
- alias: mattertest1
  id: mattertest1
  trigger:
  - platform: state
    entity_id:
    # selector 1
        - event.bilresa_scroll_wheel_button_1
        - event.bilresa_scroll_wheel_button_2
        - event.bilresa_scroll_wheel_button_3
    # selector 2
        - event.bilresa_scroll_wheel_button_4
        - event.bilresa_scroll_wheel_button_5
        - event.bilresa_scroll_wheel_button_6
    # selector 3
        - event.bilresa_scroll_wheel_button_7
        - event.bilresa_scroll_wheel_button_8
        - event.bilresa_scroll_wheel_button_9
  action:
  - variables:
        event_type: "{{ trigger.to_state.attributes.get('event_type', 'no-type') }}"
        count: "{{ trigger.to_state.attributes.totalNumberOfPressesCounted | default(0) }}"
        button: "{{ trigger.to_state.entity_id }}"
        selector: >
          {% if button in ['event.bilresa_scroll_wheel_button_1', 'event.bilresa_scroll_wheel_button_2', 'event.bilresa_scroll_wheel_button_3'] %}
            1
          {% elif button in ['event.bilresa_scroll_wheel_button_4', 'event.bilresa_scroll_wheel_button_5', 'event.bilresa_scroll_wheel_button_6'] %}
            2
          {% else %}
            3
          {% endif %}
        action: >
          {% if button in ['event.bilresa_scroll_wheel_button_1', 'event.bilresa_scroll_wheel_button_4', 'event.bilresa_scroll_wheel_button_7'] %}
            clockwise
          {% elif button in ['event.bilresa_scroll_wheel_button_2', 'event.bilresa_scroll_wheel_button_5', 'event.bilresa_scroll_wheel_button_8'] %}
            counter_clockwise
          {% elif button in ['event.bilresa_scroll_wheel_button_3', 'event.bilresa_scroll_wheel_button_6', 'event.bilresa_scroll_wheel_button_9'] %}
            press
          {% else %}
            unknown
          {% endif %}
        message: >
          {% if event_type.startswith('multi_press_') %}
            {% if action == 'clockwise' %}
              clockwise {{ count }}x
            {% elif action == 'counter_clockwise' %}
              counter-clockwise {{ count }}x
            {% elif action == 'press' %}
              press {{ count }}x ({{ event_type }})
            {% endif %}          
          {% elif event_type == 'long_press' %}
            long press
          {% elif event_type == 'long_release' %}
            long release
          {% else %}
            unknown event {{ event_type }} for button {{ button }}
          {% endif %}          
  - service: system_log.write
    data:
        message: "Bilresa Selector {{ selector }}: {{ message }}"
        logger: mattertest
5 Likes

You can do it via the UI as well, using Devices - [MATTER BILRESA DEVICE] and then use the drop down to select the event..and use the Event received triggers for the buttons - single, double, triple and long click all work.(see screenshot)

Oddly you have to add ‘above: 0’ in the YAML to each of the scroll ‘Device’ triggers as well. Not sure why…but only the Event received buttons will work otherwise. You’ll like get an error before you save if you don’t.

Just in case anyone doesn’t know this because I didn’t - before all his of you have to make the scroll entites visible - ‘Current switch position (X)’ in the Matter page for the device, 1-9. And wait 30s for each to appear. It’s a real pain if you have to re-add the BILRESA which I had to do about 2-3 times before and after an update before it ‘stuck’

One of them still drops off and I have to take the batteries out and then it’s seen again. Not sure why?