IKEA STYRBAR - duplicated events

I have 2 Ikea styrbar remotes on my setup (using ZHA with a conbee II adapter).

One is working ok. One click generates one event and I can trigger some automation based on that

The second one is behaving weirdly and multiple events are generated several events (currently 5 of them but earlier today it was 2 or 3). An event log is below

I have tried removing the device then repairing it. In some cases, it emitted 2-3 events per click right after pairing. In some cases, it behaved properly for a short while then started firing multiple events again.

I am running the latest stable version of home assistant (in docker)
Both styrbar are on the same version of the firmware: 0x00010024

Happy to help with any debugging

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:fd:27:ff:fe:04:a4:a9",
        "unique_id": "84:fd:27:ff:fe:04:a4:a9:1:0x0006",
        "device_id": "38121af1e18e56911d9092ff4928cb74",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-01T14:59:32.107279+00:00",
    "context": {
        "id": "eb13d7e929d07c34b323fd9d4870a52b",
        "parent_id": null,
        "user_id": null
    }
}

Event 115 fired 14:59:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:fd:27:ff:fe:04:a4:a9",
        "unique_id": "84:fd:27:ff:fe:04:a4:a9:1:0x0006",
        "device_id": "38121af1e18e56911d9092ff4928cb74",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-01T14:59:32.098439+00:00",
    "context": {
        "id": "3e25bea65287937a37a7b2060af51a0e",
        "parent_id": null,
        "user_id": null
    }
}

Event 114 fired 14:59:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:fd:27:ff:fe:04:a4:a9",
        "unique_id": "84:fd:27:ff:fe:04:a4:a9:1:0x0006",
        "device_id": "38121af1e18e56911d9092ff4928cb74",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-01T14:59:32.091410+00:00",
    "context": {
        "id": "02354edffb3a63f061b4f778e9fb79b0",
        "parent_id": null,
        "user_id": null
    }
}

Event 113 fired 14:59:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:fd:27:ff:fe:04:a4:a9",
        "unique_id": "84:fd:27:ff:fe:04:a4:a9:1:0x0006",
        "device_id": "38121af1e18e56911d9092ff4928cb74",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-01T14:59:32.083263+00:00",
    "context": {
        "id": "4f5c4826b1aba464d82821cb05dee61c",
        "parent_id": null,
        "user_id": null
    }
}

Event 112 fired 14:59:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:fd:27:ff:fe:04:a4:a9",
        "unique_id": "84:fd:27:ff:fe:04:a4:a9:1:0x0006",
        "device_id": "38121af1e18e56911d9092ff4928cb74",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-01T14:59:32.068947+00:00",
    "context": {
        "id": "149055410411818d60f379acd8093ab9",
        "parent_id": null,
        "user_id": null
    }
}

Did you make any progress? I’m having similar.
Just bought Styrbar yesterday, added to my Conbee II stick.
ZHA sees the following as well:

Event 3 fired 8:39 AM:
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:2e:14:ff:fe:40:a8:76",
        "unique_id": "84:2e:14:ff:fe:40:a8:76:1:0x0006",
        "device_id": "ba05e2fb4fb80f7a3f9a8dc6c5e40de8",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-02T07:39:33.398676+00:00",
    "context": {
        "id": "0c5ba34c3ec516fb669e115e4cd0dca0",
        "parent_id": null,
        "user_id": null
    }
}
Event 2 fired 8:39 AM:
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:2e:14:ff:fe:40:a8:76",
        "unique_id": "84:2e:14:ff:fe:40:a8:76:1:0x0006",
        "device_id": "ba05e2fb4fb80f7a3f9a8dc6c5e40de8",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-02T07:39:33.392759+00:00",
    "context": {
        "id": "74d2ff0e2105ac7a1802d4cfd06e3aea",
        "parent_id": null,
        "user_id": null
    }
}
Event 1 fired 8:39 AM:
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:2e:14:ff:fe:40:a8:76",
        "unique_id": "84:2e:14:ff:fe:40:a8:76:1:0x0006",
        "device_id": "ba05e2fb4fb80f7a3f9a8dc6c5e40de8",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-02T07:39:33.387826+00:00",
    "context": {
        "id": "4d10ff9b919efe9aadb6162817fae9e9",
        "parent_id": null,
        "user_id": null
    }
}
Event 0 fired 8:39 AM:
{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:2e:14:ff:fe:40:a8:76",
        "unique_id": "84:2e:14:ff:fe:40:a8:76:1:0x0006",
        "device_id": "ba05e2fb4fb80f7a3f9a8dc6c5e40de8",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2021-12-02T07:39:33.382225+00:00",
    "context": {
        "id": "57a9777ead2a85f3324cd1a8d4270d44",
        "parent_id": null,
        "user_id": null
    }
}

I was trying to trap the event and then get lights to turn on. Here is the automation, but please realize it is NOT YET working. But something to model on.

## NOT WORKING
alias: 'Styrbar1 -  Remote'
id: 'fb7f015b-8536-4282-9afe-04f4c0842f04'
description: ''
initial_state: true
mode: restart
max_exceeded: silent

trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: ba05e2fb4fb80f7a3f9a8dc6c5e40de8
condition: []
action:
  - variables:
      command: "{{ trigger.event.data.command }}"
      cluster_id: "{{ trigger.event.data.cluster_id }}"
      endpoint_id: "{{ trigger.event.data.endpoint_id }}"
      args: "{{ trigger.event.data.args }}"
  - choose:
      # Play short
      - conditions:
          - "{{ command == 'toggle' }}"
          - "{{ cluster_id == 6 }}"
          - "{{ endpoint_id == 1 }}"
        sequence:
          - service: switch.toggle
            target:
              entity_id: switch.living_room_desk_switch
      # //TODO add some smarts so this loads my favourite station if nothing is playing.
      # Play long
      - conditions:
          - "{{ command == 'press' }}"
          - "{{ cluster_id == 6 }}"
          - "{{ endpoint_id == 1 }}"
          - "{{ args == [2, 0, 0] }}"
        sequence:
          - service: media_player.select_source
            data:
              entity_id: media_player.sonos_dining_room
              source: "{{ states('input_select.sonos_downstairs_source') }}"
          - service: media_player.volume_set
            data:
              entity_id: media_player.sonos_dining_room
              volume_level: "{{ 6 / 100 }}"
      # Volume up
      - conditions:
          - "{{ command == 'step_with_on_off' }}"
          - "{{ cluster_id == 8 }}"
          - "{{ endpoint_id == 1 }}"
          - "{{ args == [0, 43, 5] }}"
        sequence:
          - service: media_player.volume_up
            target:
              entity_id: media_player.sonos_dining_room
      # - conditions:
      #     - "{{ command == 'move_with_on_off' }}"
      #     - "{{ cluster_id == 8 }}"
      #     - "{{ endpoint_id == 1 }}"
      #     - "{{ args == [0, 84] }}"
      #   sequence:
      #     - repeat:
      #         count: 10
      #         sequence:
      #           - service: light.turn_on
      #             target: !input light
      #             data:
      #               brightness_step_pct: 10
      #               transition: 1
      #           - delay: 1
      # Volume down
      - conditions:
          - "{{ command == 'step' }}"
          - "{{ cluster_id == 8 }}"
          - "{{ endpoint_id == 1 }}"
          - "{{ args == [1, 43, 5] }}"
        sequence:
          - service: media_player.volume_down
            target:
              entity_id: media_player.sonos_dining_room
      # - conditions:
      #     - "{{ command == 'move' }}"
      #     - "{{ cluster_id == 8 }}"
      #     - "{{ endpoint_id == 1 }}"
      #     - "{{ args == [1, 84] }}"
      #   sequence:
      #     - repeat:
      #         count: 10
      #         sequence:
      #           - service: light.turn_on
      #             target: !input light
      #             data:
      #               brightness_step_pct: -10
      #               transition: 1
      #           - delay: 1
      # //TODO Mute/pause all Sonos and TV
      # Previous short
      - conditions:
          - "{{ command == 'press' }}"
          - "{{ cluster_id == 5 }}"
          - "{{ endpoint_id == 1 }}"
          - "{{ args == [257, 13, 0] }}"
        sequence: 
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ state_attr('media_player.sonos_move','source') == none }}"
                sequence:
                  - service: media_player.media_previous_track
                    target:
                      entity_id: media_player.sonos_dining_room  
            default:
              - service: input_select.select_previous
                target:
                  entity_id: input_select.sonos_downstairs_source
              - delay: '00:00:01'
              - service: media_player.select_source
                data:
                  entity_id: media_player.sonos_dining_room
                  source: "{{ states('input_select.sonos_downstairs_source') }}"
      # Previous long
      # - conditions:
      #     - "{{ command == 'hold' }}"
      #     - "{{ cluster_id == 5 }}"
      #     - "{{ endpoint_id == 1 }}"
      #     - "{{ args == [3329, 0] }}"
      #   sequence: !input button_left_long
      # Next
      - conditions:
          - "{{ command == 'press' }}"
          - "{{ cluster_id == 5 }}"
          - "{{ endpoint_id == 1 }}"
          - "{{ args == [256, 13, 0] }}"
        sequence: 
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ state_attr('media_player.sonos_move','source') == none }}"
                sequence:
                  - service: media_player.media_next_track
                    target:
                      entity_id: media_player.sonos_dining_room  
            default:
              - service: input_select.select_next
                target:
                  entity_id: input_select.sonos_downstairs_source
              - delay: '00:00:01'
              - service: media_player.select_source
                data:
                  entity_id: media_player.sonos_dining_room
                  source: "{{ states('input_select.sonos_downstairs_source') }}"
      # Next long
      # - conditions:
      #     - "{{ command == 'hold' }}"
      #     - "{{ cluster_id == 5 }}"
      #     - "{{ endpoint_id == 1 }}"
      #     - "{{ args == [3328, 0] }}"
      #   sequence: 
  # https://community.home-assistant.io/t/zha-ikea-five-button-remote-for-lights/25380

Not much

Thank you. I’m struggling to get the automation to work right now.
Will try to get the blueprint working. I tried it once with no success – so perhaps pilot error.

Thanks for the reply.

~Bryan

Debouncing it at the very bottom of the page
One error I did with the blueprint is going very fast and thinking that the “Helper - Last Controller Event” is optional. It’s written “required” but helper really made me think otherwise :slight_smile:

Good luck

OK. It finally works now. Agree. I had to add the helper input_text, reloaded and now the blueprint is working for me.

For others, here are the steps I followed.

  1. Pair the StyrBar with ZHA/Conbee II stick. Pairing mode on the StyrBar requires 4 quick button presses, look for the light to flash.
  2. Search for device in ZHA (adding the device).
  3. Add an input_text field similar to:
last_message_zha:
  name: Last Message ZHA
  initial: Some Text
  
  1. Add the Blueprint, Create a new automation.
  2. In the new automation, add the remote to catch the events.
  3. In the automation builder, be sure to reference the Helper - Last Controller Event.

This worked for me.

Thanks for your help!