Already running Warning Filling logs (Automation, scripts)

Recently I noticed that my logs started filling up with these messages:

    Exterior Lights On Before Sunset: Already running
    6:33:23 PM – Automation (WARNING) - message first occurred at September 7, 2020, 6:38:35 PM and shows up 4 times

This is the automation in question:

      - alias: 'Exterior Lights On Before Sunset'
        initial_state: on
        trigger:
          - platform: sun
            event: sunset
            offset: '-00:30:00'

        action:
          - service: script.exterior_lights

There are a few other automation that are also displaying the same error. This mainly started after the most recent update. Everything is working as it should so no complaints there. Just wondering if anyone else is seeing these warnings.

This is expected behaviour for the default mode (single) of automations and scripts.

Read more here https://www.home-assistant.io/integrations/automation/#automation-modes

1 Like

I had a long post written trying to question what was going on with sunset triggering multiple times such that it generates the warning… then I realized this automation is calling a script.

The warning only appears if the automation receives another trigger before the action sequence completes. So a couple things going on, is the automation aware of the script’s sequence such that it’s waiting for it to complete before itself completes, is the script even completing, is there a reason the sequence of the script isn’t in the action section of the automation (which itself is really a script)?

So unless the sunset event triggers multiple times and not just once per day, my guess is the action section/script is not completing and thus the warning.

1 Like

I didn’t look closely at the trigger. That is actually a bit of a worry.

Continuing on from sqirtburner’s post, there are two ways to run a script and they have an effect on whether or not the sequence waits for successful completion before progressing: https://www.home-assistant.io/integrations/script/#waiting-for-script-to-complete and what occurs if there is an error.

But really, you need to check if the script is completing.

Can you post the script here?

hey all,

im getting this error and here is my automation:

- id: barlightsonmotion
  alias: bar lights on motion
  trigger:
  - entity_id: binary_sensor.bar_motion_sensor_hue_dz, binary_sensor.konnected_bar
    from: 'off'
    platform: state
    to: 'on'
  condition:
    condition: numeric_state
    entity_id: sensor.bar_motion_hue_dz_lightlevel
    below: 20
  action:
  - service: homeassistant.turn_on
    entity_id: group.room_bar_all_lights_group

error:

Logger: homeassistant.components.automation.bar_lights_on_motion
Source: helpers/script.py:1145
Integration: Automation (documentation, issues)
First occurred: 13:22:13 (20 occurrences)
Last logged: 19:17:29
bar lights on motion: Already running

version

Version 2021.1.0
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.7
Operating System Family Linux
Operating System Version 5.4.79-v8
CPU Architecture aarch64
Timezone Europe/London

Maybe your motion sensor is triggering multiple times. Enough so that the previous triggers have started the automation already and since its set to run in single mode the other instances of motion is just throwing the error.

How you have solved your problem?

Ich have the same problem.

Same issue here with an automation in an room with multiple motion sensors.
Yes, i want to just let it run once at a time → so single ist the correct automation type.

But how can i prevent the warning log messages?

thx

Add:

mode: single
max_exceeded: silent
5 Likes

Thx, will try that