Can't delete a script / Can't see a script in the UI

In trying to create a script I appear to have got myself into a bit of a hole with 2 problems:

I have a script that is saying “Only scripts inside scripts.yaml are editable.”
I deleted the script in scripts.yaml but it is still appearing in the UI.

If also have a script where I deleted it, but if I try to recreate it with the same name it appears in scripts.yaml but not in the UI.

If I delete the script from scripts.yaml and try to recreate it in the UI with the same entity id I get “You can’t save this script because the ID is not unique, pick another ID or leave it blank to automatically generate one.”

I have tried reloading scripts and restarting - I cannot delete one of them and I cannot get the other to appear.

1 Like

Did you ever find the solution.
This occurred after I tried to give the Script a new Entity Name & Location.

Yes, I did stumble onto a solution. Unfortunately I thought I’d posted an answer somewhere else where I’d asked the question (like reddit) at the time but I can’t find it so I’m now a little hazy on how exactly I did it.

As I remember, I managed to find the script with the conflicting ID and renamed it something else ‘offending_script_2’, I then re-created the removed script in scripts.yaml with the - i.e.

offending_script:
  alias: Offending Script
  sequence:
  - delay: ''
  mode: single

This gave me back the ability to edit it in the UI and delete one of them.

Hope that helps point you in the right direction :slight_smile:

I was able to remove these orphan scripts with developer tools.

  1. Go to developer tools
  2. Select states tab
  3. Search your script e.g. script.
  4. Click info icon of state
  5. Go to settings tab
  6. Click Remove
2 Likes