Open sam-ward opened 3 weeks ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (script
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
script documentation script source (message by IssueLinks)
Similar thing happens even if you stick entirely to GUI, i.e. if you rename a script, the service action that the script provides keeps the old name. The only workaround I could find is recreating the script from scratch with the new name which then also creates the action under the new name.
Duplicate of https://github.com/home-assistant/core/issues/115334
The option "rename" changes what is called "alias" in YAML of the service.
Mind that there is also an entity for the service which can be (re-)named independently.
The problem I am seeing is that despite renaming the alias, and renaming the entity, at the UI layer atleast (I’m not sure if it’s deeper), it appears to only recognises the ID (if that’s the correct term, the 0 indent line of the scripts.yaml) of the script in the automation editor, developer tools, and auto complete.
On Sun, Sep 15, 2024, at 12:39 AM, Martin Kutschker wrote:
The option "rename" changes what is called "alias" in YAML of the service.
Mind that there is also an entity for the service which can be (re-)named independently.
— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/124550#issuecomment-2351054712, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF2YVEAFSRN7CGOTMASYIDZWRRE7AVCNFSM6AAAAABNCDHFLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRGA2TINZRGI. You are receiving this because you authored the thread.Message ID: @.***>
The problem
This may be expected behavior, but it caught me out today so I thought i'd log it. I went through the exercise today of migrating my scripts (and automations) from yaml files to the editor using the migrate button. The process was:
But what I found was that despite renaming the script, the script could only be referenced in an automation with its "original" old name (with the _2 suffix), and there didn't appear to be any mechanism to effect the rename as desired.
In the end to achieve the desired result I manually edited scripts.yaml file and changed (what I am assuming is) the script ID and used the developer tools to reload the scripts (in hind sight I could have also copied the script again to the desired name and deleted the _2 instance).
As I said i'm not sure if this is expected behavior, but it is certainly confusing behavior that you can not rename a script in-spite of the UI appearing to allow you to do so. Its also confusing because the same process does work on the automations.
What version of Home Assistant Core has the issue?
core-2024.8.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
script
Link to integration documentation on our website
https://www.home-assistant.io/integrations/script/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response