Yes, but you also mentioned you “messed around” with manual/UI editing, so did you save it as a separate “something.script” ?
Also make sure you deleted ALL cache in browser, etc., And i.e restart Core, if you haven’t already
BTW: What do you use to “Edit” your script.yaml ? , do you see any “additional” script-files in /config or /config/scripts ?
PS: You also didn’t mentioned whether you had “additional” folder for scripts ( stated in your configuration.yaml )
I don’t understand, what are you saying exactly? I do have only one file where scripts are defined (the default scripts.yaml), but the ghost script does not exist in that file.
Folks, this looks like a bug. I did not edit anything directly in yaml, neither in the ui editor, nor using the file editor. I changed the entity name, automations immediately found out the old script does not exist, they let me found the new one with new entity name, however, the list of scripts contain the old one that goes directly to this error. Scripts.yaml contain the old entity name. So I renamed the entity directly again in the script.yaml and it opens. This is apparently a bug.
Came here because of the same problem. And I didn’t understand the explanation. I can change the entity_id everywhere via UI entity list. And now scripts are the only ones, where I get into trouble if I do this? Really don’t get it.
If I got it correctly, the point is that you have the option to change entity id in general, ervywhere but if you want to change id of the script, do it there. I understand it from the developers perspective, keep option everywhere. I think they should consider a warning popup windows when you are changing entity id for a script
Yes and no. Yes there are differences between yaml from automations and scripts. But in the end of the day, they are technically more or less the same. But e.g. for automations I can change entity_id. And for every other entity as well. So if we are talking about “year of harmonization”, I don’t get, why this problem is “not a bug, but design” for scripts. For me it is not typical for HA entity handling and not fitting to automation and other areas. Perhaps not a bug, but at least a historical gap.
Not sure someone mentioned this already, this is how i get rid of the duplicate script.
Short version
If you change the script name, a duplicate script appears and you can delete the old one on the “entities” tab.
Long version
Settings / Automations & Scenes / Scripts / 3 dots at the back of a script / Show info about script / Tab: Entity setting / Entity id: change this value
If you restart Home Assistant (Settings/System/Restart) a 2nd script with the same name appears in the scripts list. The new named entity id you can edit / use now.
How to delete the old one.
Settings / Devices & Services / Entities / Search Entities: "old entity name whom gives the error “Only scripts inside scripts.yaml are editable.” / has a red “restored” icon at the back / select and delete.
ok and again. I duplicated a script and edited it as I wanted. Then I renamed the old script as “deprecated” and renamed the new one I just created by the duplication to have the same name as the one I currently call deprecated. I used GUI only and I am once again in that mess that clicking on a new script opens the old one. If this is by design, it’s wrong design.
The short version is to delete the entity. The “design” is that by renaming the script, you do not rename the entity. Each script is also an entity and renaming scirpts do not rename entities. By renaming script, you detach it from the entity, which leads to this mess. I think that proper design would be to not allow users do this mess through the GUI. That’s actually the reason why complex systems such as HA move from yaml to gui, to avoid mistakes.
@frenck would you open this case within your developer team? I think that @arganto made a good point that the handling of entities related to scripts is not consistent with other parts in HA such as automations. Thank you