Script already running after update 0.39

Hey Guys,

After update 0.39 everytime the door opens I see the following message in the log:

17-03-05 18:16:57 WARNING (MainThread) [homeassistant.components.script] Script script.door_open already running.

I use the following automation:

#Trigger if door is opened
- alias: 'Trigger if door is closed'
   hide_entity: true
  trigger:
    platform: state
    entity_id: sensor.fibaro_system_fgk10x_door_opening_sensor_access_control_2_9
    to: '23'
  action:
  # Cancel timer that is running
  - service: script.turn_off
    data:
       entity_id: script.door_opened_timer
  # Set input boolean to off
  - service: input_boolean.turn_off
    data:
      entity_id: input_boolean.front_door_open

#Trigger if door is opened
- alias: 'Trigger if door is opened'
  hide_entity: true
  trigger:
    platform: state
    entity_id: sensor.fibaro_system_fgk10x_door_opening_sensor_access_control_2_9
    to: '22'
  action:
    - service: script.turn_on
      entity_id: script.door_open

And the following script:

#Script will run if door is open
#Script will cancel excisting timer
#Script will start new timer
 alias: "Door open"
 sequence:
   # Cancel timer that is running
 - service: script.turn_off
 data:
    entity_id: script.door_opened_timer
   # Turn on boolean door_closed_check
   - service: input_boolean.turn_on
     data:
       entity_id: input_boolean.front_door_open
   # Create a new timer
       - service: script.turn_on
         data:
           entity_id: script.door_opened_timer

And using this timer script:

# Script will run if door is closed
# Script will run 10 minutes
alias: "Door open in last 10 minutes"
sequence:
  - delay:
      minutes: 10
  - service: input_boolean.turn_off
    data:
      entity_id: input_boolean.door_closed_check

Any idea why I get the message after 0.39?

Having same issue with 39.3

This issue is fixed in update 0.40.0:

I am running hassio (version 0.60.1). I noticed that some of my automation’s aren’t working correctly. The issue has been traced down to a warning saying that a script is already running. I don’t think this was an issue in the past for me.

If you read the git issue, and look at the original automation, the problem fixed was that z-wave devices were triggering the automation multiple times when they were only supposed to trigger it once.

Unless you have a z-wave devices that is triggering multiple times when it shouldn’t, you have a different problem.

HA has some kind of limitation that a script can not have multiple instances of it running. I used to have an automation trigger based on motion and the goal was to pump everything through a single templated script. However, the motion in room 1 & 2 happen randomly so sometimes both would fire too close together and the 2nd one there would throw the script already running error and not turn on the lights. My solution was to off-load my automation logic to Node-RED, which doesn’t care if a sub-flow is executed multiple times simultaneously.