Filter "Already running" in logs

Hello,
I have a lot of entries sounds “… Already running” in the logs. I know, which it means and from my configuration, it is fine, that the warning occurs. I don’t want (can, need, etc.) to resolve these warnings, but I want to filter them. From the logger docs I found out, that there is a built in filter function for such cases. In other cases and for other warnings, the filters work well, but not for the “… Already running” warnings.

Here is an example:
Exception

Logger: homeassistant.components.automation.firebase_update_raspi
Source: helpers/script.py:1344
Integration: Automatisierung (documentation, issues)
First occurred: 12:29:29 (29 occurrences)
Last logged: 15:24:29

Firebase Update Raspi: Already running

Filter:

logger:
  filters:
    homeassistant.components.automation:
      - " *Already running"
      - " *Already*"
      - " *running"

The warning is not filtered in the log, so what is going on? Of course, I can use “homeassistant.components.automation.firebase_update_raspi” for the filter, but this is not, what I want (and what not needed reading the docs), since I would have to set the filter for all automations/scripts.

Do you have any idea?

Can you explain why you can’t adjust the automation?

In my view it’s not a good idea to filter something from the logs, in the future you might have an automation that needs to be fixed.

Can you show the entry from the log file itself? What you are showing is the “nice” entry, the real entry is normally
xxx already running. all lowercase and a dot at the end, so try to change the filter to

 logger:
  filters:
    homeassistant.components.automation:
      - "*already running*"

Hi,

this is the “real” log:

2021-10-26 20:52:59 WARNING (MainThread) [homeassistant.components.automation.firebase_update_raspi] Firebase Update Raspi: Already running

To be honest, this is a bad example. I have very complicated routines for my room climates, which can be adjusted manual and per app and these climates are connected to time-based routines, window sensors, user location (home/not home) and therefore, it happens often, that the automations are triggered multiple times in a view seconds. These logs blow up the log overview, so I am not able to determine “real” important warnings.

Ok, then it sounds like a bug. Open up an issue on GitHub.

The default mode for all automations is single. In single mode, if an automation is busy executing its action and it’s triggered again, it will ignore it and report the incident with a warning message “Already running …” just so you are aware it happened.

Sometimes one is not aware that an automation might be re-triggered while it’s busy so it’s useful to be warned that it has occurred. In that case, one might want to change the automation’s mode to something more suitable.

In other situations, one is aware that it might be re-triggered while busy, considers that to be normal, and doesn’t need to be reminded of it when it happens. In that case, you can suppress the warning message by simply adding the max_exceeded option to the automation:

max_exceeded: silent

So if you know that it’s normal for automation.firebase_update_raspi to be re-triggered while it’s busy, simply add the line shown above.

5 Likes

Thanks a lot! Of course, the usage of max_exceeded: silent is much more sufficient and meaningful. So, I know, for which automations/scripts it might happen, that they will be triggered multiple times, so I can prevent them from logging.

1 Like

Glad to hear it helps to solve your problem.

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.

@123, thank you for this tip—it’s really helpful! For instance, I have setup several “group” automations in which I synchronize the state of a light and several switches that can turn it on and off, and always got these warnings. Your hint solved that elegantly!

Example automation for a bedlight that can be turned on off by

  • a 433 MHz RF switch on a Sonoff RF Bridge
  • a real switch on its wall plug
  • its light entity in HA
alias: Gruppe Schlafzimmer Bettlampe
description: Zusammenfassung der Bedienelemente für Schlafzimmer Bettlampe
triggers:
  - entity_id:
      - switch.schlafzimmer_bettlampe
      - switch.rf_bridge_1_rfbridge1_2
      - light.schlafzimmer_bettlampe
    from:
      - "on"
      - "off"
    to:
      - "on"
      - "off"
    trigger: state
conditions: []
actions:
  - target:
      entity_id:
        - switch.schlafzimmer_bettlampe
        - switch.rf_bridge_1_rfbridge1_2
        - light.schlafzimmer_bettlampe
    action: homeassistant.turn_{{ trigger.to_state.state }}
mode: single
max_exceeded: silent

As one can easily see, this will always re-trigger itself while performing its action, and thus produced the warnings. On the other hand, it is really helpful should you need to sync many switches for the same light(s), for instance in a large hallway. With your tip max_exceeded: silent added, this can now work flawlessly. (Using HA 2024.12.0 currently.)