Switch Manager - New refined switch integration to manage your switches

I’m trying to set up a hold action for the Ikea Strybar in ZHA, however for some reason it seems to always get stuck in an endless loop. It could be due to the fact that, as far as I’ve found, the hold_release event for the top and bottom button is the same. The blueprint currently is the following:

name: Ikea Styrbar ZHA
service: ZHA
event_type: zha_event
identifier_key: device_id
buttons:
  ## Not sure why the buttons are back to front and illogical by their numbers??
  - x: 247
    y: 61
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: 'on'
      - title: hold
        conditions:
          - key: command
            value: move_with_on_off
      - title: hold_release
        conditions:
          - key: command
            value: stop_with_on_off

  - x: 442
    y: 248
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: press
          - key: params.param1
            value: '256'
      - title: hold
        conditions:
          - key: command
            value: hold
          - key: params.param1
            value: '3328'
      - title: hold (released)
        conditions:
          - key: command
            value: release
          - key: params.param1
            value: '-7258'
  - x: 245
    y: 434
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: 'off'
      - title: hold
        conditions:
          - key: command
            value: move
      - title: hold_release
        conditions:
          - key: command
            value: stop_with_on_off
  - x: 52
    y: 248
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: press
          - key: params.param1
            value: '257'
      - title: hold
        conditions:
          - key: command
            value: hold
          - key: params.param1
            value: '3329'
      - title: hold (released)
        conditions:
          - key: command
            value: release
          - key: params.param1
            value: '1675'

And the automation it fires:

- wait_template: "{{ data.button_last_state[2].action == 1 }}"
  continue_on_timeout: false
  timeout: "00:00:20"
- service: notify.persistent_notification
  data:
    message: hold pressed
    title: "{{ data.button_last_state[2].action }}"
- repeat:
    until:
      - condition: template
        value_template: "{{ data.button_last_state[2].action != 1 }}"
    sequence:
      - service: light.turn_on
        data:
          brightness_step_pct: -5
        target:
          entity_id: light.bed_lights
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 50
- service: notify.persistent_notification
  data:
    message: hold pressed stop
    title: "{{ data.button_last_state[2].action }}"

I left the notifications in there as a check, however the last notify action is never fired. Attaching one to the hold_release action does fire two events (since both the up and down button are seen as not being held anymore. Do you happen to have an idea as to what’s causing this? There are also multiple events fired for each button press, perhaps that could also be causing issues, though I am not sure how to set the debounce in ZHA.

Also, massive thanks for this integration! The interface is incredible and it’s been a joy to work with. A lot clearer than building from automations :smiley: