Script already running / slow script execution in 0.85

Hey all,

I dragged my feet a bit in upgrading from 0.84.6 to 0.85.1 and since the update I’ve been having an issue with my universal remote. It’s built in lovelace using entity button cards which call scripts using toggle tap actions. The scripts vary the commands sent to my harmony hub based on the current activity.

In <=0.84.6 I could click the buttons and trigger the scripts as fast as I wanted. Now I have to pause about a second between clicks and when I go to fast I get

2019-01-17 19:01:37 WARNING (MainThread) [homeassistant.components.script] Script script.media_down_arrow already running.

It’s not debilitating but it is certainly frustrating. Anyone have any ideas?

My lovelace button’s look like:

- type: entity-button
  entity: script.media_down_arrow
  name: Down
  icon: mdi:arrow-down-box
  tap_action:
    action: toggle
  hold_action:
    action: none

And my scripts look like

media_down_arrow:
  alias: Down
  sequence:
    - service: remote.send_command
      entity_id: remote.living_room
      data_template:
        device: >
          {% if states.remote.living_room.attributes.current_activity == "Watch Kodi" %}
            51738178
          {% else %}
            51736885
          {% endif %}
        command: >
          DirectionDown
        num_repeats: 1

I’m posting more findings here just in case someone else has seen this. I don’t feel like I have enough info to file an issue yet. I’ve observed two more things, the first makes me think this is a backend issues (possibly related to switch to aioharmony) while the second observation would seem to suggest it’s a frontend issue.

  • Entity-Button presses sent to my Roku do not have this issue, but commands to my TV (IR) and HTPC (bluetooth) do.
  • Commands sent via Developer Call Service panel do not seem to have this issue regardless of device.

I do have exactly the same issue with my harmony remote buttons. When using arrow down or arrow up i.e. I always get the error “script already running”. The script execution is too slow in my opinion. Therefore the delay_secs paramter makes no sense when scripts running at least even longer.