core icon indicating copy to clipboard operation
core copied to clipboard

Home assistant deletes traces from running automations

Open Gaff opened this issue 1 year ago • 3 comments

The problem

Conside this scenario:

  1. I write an automation than run every minute that (sometimes) waits for 15 minutes then turns on a light.
  2. 15 minutes later light in my house comes on.
  3. I go into HASS, it says "tiggered by automation X"
  4. I look at the traces for automation X, but it just shows the last 5 minutes of traces where nothing happend.
  5. WTH?!?!

This is because home assistant only keeps a certain number of traces, and if you have a time based automation you tend to have a lot of empty traces.

Possible workaround:

Make the default number of traces 10 or 100? Is there any reason for the limit to be so low? Memory I guess?

Possible fixes:

  • Use a time based history (keep traces for up to 6 hours and in any case always keep the last 5)
  • Make the cache based on some sort of priority
  • Don't trace very dull runs, or don't count them towards the cache limit
  • Never delete any traces while they are still running

Dull runs could be things such as "Stopped because only a single execution is allowed", or runs that don't get past "wait" steps.

What version of Home Assistant Core has the issue?

core-2024.5.0

See also:

This feature enhancement request for something similar: https://community.home-assistant.io/t/make-traces-persist-longer-or-make-how-long-they-last-configurable/302348

Gaff avatar May 09 '24 08:05 Gaff

Yes, I would also like better customization.

Maybe also a global option to set the number of traces, and setting a value in the automation overrides the global value. That would have made my beginnings in HA much easier.

I work in my automations with many triggers within an automation. I would like to be able to configure the traces like this: Info, Warning, Critical.

Info: All the spam that ends up in the traces now, even if nothing was executed because the remaining conditions were not met.

Warning: Small errors, for example, if conditions do not work because they are configured incorrectly.

Critical: Everything that prevents or disturbs the complete automation.

I hope you understand what I mean. That would definitely help.

NordFreak avatar Jul 14 '24 13:07 NordFreak

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

There hasn't been any activity on this issue recently.

This is still an issue!

Would be great if one of the experts could say what type of fix they might accept? I might be able to implement it myself...

Gaff avatar Oct 15 '24 20:10 Gaff