I had an issue recently where I was trying to add a widget to my Android phone which called a script I have in Home Assistant. ALL my scripts were showing apart from this one, and I couldn’t figure out why it was missing.
After a while investigating I realised that the “service” name did NOT match the entity name / script name, so it was called something random, not what I was expecting based on its name / entity name.
Pretty sure it was a script I renamed ages ago but it’s kept the “service” name as it was on creation.
Can the “service” be renamed after initial creation?
So to reproduce:
- Create a script with name “my_script_number_1”.
- Rename the entity / name of the script to “my_script_number_2”.
- Open up Developer Tools > Services and try to find “script.my_script_number_2”. It doesn’t appear in the list, but “script.my_script_number_1” does (despite being renamed and no longer existing under that name).
Is this just how things work? Should a script always be created fresh rather than renaming? Or is this a bug I should raise with service names not getting renamed under the hood?
Thanks!