Automations : Unable to delete an automation bec. is not in automation.yaml file

Hello.

Got an automation that I can't delete.
Got a message "only automation in automation.yaml can be deleted"...

Where is this automation located ?

Try to see if there is an automation present in the packages folder

Nothing in packages folder...

The automation yaml file is somewhere in your configuration.

If you are on Windows, use AstroGrep to find the automation in your YAML files. That will show you which file contains the automation.

Someone decided a few months ago that ALL automations should be created in the UI, and they will be in automations.yaml.

But some of us who have been writing automations in YAML since many years ago had also put them into automations.yaml. They don't mix well.

The solution is to separate them. GUI generated automations in automations.yaml and the manually created automations in another folder.

Here's how I do it. In my configuration.yaml:

automation: !include gui/automations.yaml # this is only for GUI-Automations, do not touch this file!
automation manual: !include_dir_merge_list manual_automations/

Then all of the manually-created automations go into my manual_automations folder.

Scenes and Scripts have the same issue.

After separating your GUI and manualy-created automations, you still can't edit the manually-generated automations in the Home Assistant UI. You have to use a text editor.

In terminal I did find / -name automations.yaml...

Result is only the official file

And my configuration.yaml is standard

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# sensor: !include_dir_merge_list sensors
template: !include templates.yaml

mqtt:
  sensor: !include mqtt.yaml
# sensor: !include rpiecu.yaml

homeassistant:
  packages: !include_dir_named packages
  allowlist_external_dirs:
    - "/config/www"

If it's in automations.yaml, it's OK to delete it.
The automation may begin with "- id:" or with "alias:" You can delete everything up to the next automation.

It is not in automation.yaml

This is my problem

I have parsed all the directories to find the title of the automation and it is not found.
I also copied the automation.yaml file and serch into it, same.

Its very strange that HA can find something we can't...

Well...

After so many tests and search... I finally restarted HA and... The automation is now deleted from the list.

Thanks to all of you for your help.