Button Bounce on a Dashboard

One of the things I use HA for is to operate an Entertainment System Remote Control, basically taking the remotes for the TV, Amplifier, Set Top Box, et.al., and combining them into a smart single interface using a Broadlink Pro RM4. Until recently it has been working without any issues. It now appears to have developed what appears to be keyboard bounce when I press the keys on the tablet running the dashboard, with duplicate events happening and log entries showing warnings of Already Running on scripts. The hardware is a Lenovo M8 Tablet.

Dashboard Entry

              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: perform-action
                  perform_action: script.fetch_mighty_exit
                  target: {}
                icon: mdi:exit-run

Script

fetch_mighty_exit:
  alias: Fetch Mighty Exit
  sequence:
  - action: remote.send_command
    metadata: {}
    data:
      num_repeats: 1
      device: Fetch Mighty
      command: Exit
    target:
      entity_id: remote.entertainment_remote
  description: ''

Log Entry

Logger: homeassistant.components.script.fetch_mighty_exit
Source: helpers/script.py:2067
integration: Script (documentation, issues)
First occurred: 28 July 2025 at 19:15:14 (2 occurrences)
Last logged: 28 July 2025 at 19:47:46

Fetch Mighty Exit: Already running

Any idea on what has caused the system to start repeating the button press?

Thanks,
Craig

You may want to check the ‘mode’ setting for your script? If not specified, I believe HA defaults to ‘single’. Here is the documentation link. You may also change it from the UI by selecting ‘Change mode’.

Hope that is helpful.

Thanks for the reply. Queued would mean that that the event would always run again. I always wish it to run once.

As far as I know, regular buttons don’t support debounce, but if you change them to custom:button-card, the following code should work:

- show_name: false
  show_icon: true
  type: custom:button-card
  tap_action:
    action: nothing
    real_action: |
      [[[
        const UUID = '310e3b36-5d8d-4061-abc4-26c0b44d69b6';
        const DEBOUNCE = 500; //milliseconds
        if (!window[UUID]) {
          window[UUID] = true;
          hass.callService('script','fetch_mighty_exit', {});
          setTimeout(_ => window[UUID] = false, DEBOUNCE);
        }
      ]]]
  icon: mdi:exit-run

To get a “multi-button debounce”, use the same UUID in every button.

Can’t help you fix your issue, but FYI, this is the second time I’m seeing someone reporting 2 actions at the same time (first time was here)

If you are using a custom card to achieve that layout, say so. Could be an issue with the card itself. Even if it’s not, stating what card you’re using might narrow down commonalities with the other thread.

Thanks for the replies. The issue was with the tablet, not HA.