Cannot Delete Scripts or Automations

Hello all-

I am having an issue that I cannot seem to fix. I have been searching high and low and nothing seems to work.

I installed an integration through HACS called weatheralerts. It didn’t really work for what I thought it was so I removed it. However, it created some automations and some scripts that I cannot remove. When I click on the script edit button, I get a popup that says “Only scripts inside scripts.yaml are editable.” The automation edit button has a line through it and says something about read-only.

I have rebooted multiple times and I still cannot delete these entries. Any ideas? Surely I am not stuck with them.

Thanks,
Scott

Check if it installed yaml packages and delete them.

It installed a file in packages folder, but I have deleted it but I still can’t delete the scripts and auitomations.

Did you restart after deleting it?

You can run grep to search all yaml files for any mention of yourscript or automation.

I have rebooted multiple times. I give up.

Haven’t tried grep yet, but I did use Visual Studio Code Server and global search and it did not return any instance of the script and/or automations. Would grep do a deeper dive?

I think I may have figure it out. I think my browser was caching the files. I opened HA in Incognito mode and all but one disappeared…

Yep, I cleared the cache and all the automations and scripts that should have been deleted are now gone. All except one. I cannot find mention of it in any yaml files so I will keep digging.

Thanks,
Scott

1 Like

Yeah I cannot delete one automation for some reason. It appears it does not a have an id. I tried to add it using developer tools but it created a duplicate. I have used grep to try and locate it with no results. I have even looked in the core.entity_registry in the storage folder and still came up empty.

Anyone have a clue where this dang thing may be referenced at?

Probably a waste of time, but post your configuration.yaml file, and what is the entity ID of the automation that won’t go away.

Do you see the automation in config, automations?

My configuration.yaml:

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

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
scene: !include scenes.yaml
group: !include groups.yaml
sensor: !include sensors.yaml
script: !include scripts.yaml

# Setup Pushover Notification Service
notify:
  - name: pushover
    platform: pushover
    api_key: 
    user_key: 
  - name: office_speaker
    platform: tts
    tts_service: tts.google_translate_say
    media_player: media_player.office_display

It is not in confi or automations that I can see (or search).

When I click on the information icon in automations, I see the following:

This entity (‘automation.weather_alerts_notification_1’) does not have a unique ID, therefore its settings cannot be managed from the UI.

I found the entity in the Developer Tools and added an id, but when I click the edit button, I get the error about only editing from automations.yaml

It has to be something simple (or not) :slight_smile:

Aww, didn’t see that. Thank you.

I am a total noob in HA. I am migrating/testing from Hubitat so most of this is so new to me. I will have to read up on the secrets.yaml

Use
api_key: !secret pushover_api_key

and then create a secrets.yaml containing
pushover_api_key: <your api key>

Do you see the automation in configuration, automations?

Try this:

In the configuration, automations, click on the edit icon for the automation you want to delete.

When the edit window opens, click on the hamburger menu on the top-right. This should give you a “delete automation” option.

1 Like

@stevemann this is what I have:

This is a what I get when I click the edit icon:

So I can’t get to the Delete Automation at all.

What was the grep command you used to search for it? Are you searching subfolders?
Do you have Samba share loaded? If yes, I use a PC program- AstroGrep which makes grep searches super simple.

@stevemann I don’t remember the grep command I used. Probably not the right one as Linux alludes me.

I downloaded the app you suggested. I found the entry in two different files. core.restore_state and home-assistant_v2.db

I searched in the default configuration folder and subfolders. Should I search somewhere else?

Scott

No, that should be the only places to find where the automation is coming from. In my experience it has to be in a yaml file. The .db file is your entity history and can safely delete it. And some do when it gets really big. I don’t know what core.restore_state is, so I can’t advise on it.

I would try to delete it from the restore_state file.

It’s in json so you will need to make sure you maintain the file structure or you will break HA.

Make a backup of the file before you edit it and also stop HA before editing it.

When done restart HA and hopefully it will be gone.

I’ve never run across an integration that writes yaml files that I recall. That sucks.

You said it was the “weatheralerts” integration? Do you have a link to the repo?

It is in HACS Integrations and it is called Weatheralerts. It contains a yaml file to place into the packages directory. It created some “automations” and “scripts” within the yaml file. I think I will give it another shot again at some point, but I want to wrap my head around the yaml file editing part more sicne you can’t do it in the UI. Last night we had 3 tornado warnings and I would really like to integrate something into my system. I just think this integration was more than I needed and a little overkill. May change my mind later though.

As far as the issue I was having, the automation I could not delete, finally went away on its own. It was weirdness for sure.