I’m not sure why your config won’t load your old scripts.
I just tested it on my system and it worked fine.
I have my “old” scripts in a folder structure but I don’t think that should make any difference at all
## only used for the testing of the GUI editors
automation: !include automations.yaml
script: !include scripts.yaml
## All of my regular automations and scripts go here
automation old: !include_dir_merge_list automations/
script old: !include_dir_merge_named scripts/
I put a test script into scripts.yaml and it shows up in my states list.
well this I do not have, I do have my scripts and script_old in the same /config directory (as I have automations and automation old. But automation works
Your directory structure is as this?
# for the old file
/config/scripts/script_old.yaml
But you should be able to locate and call the “old” file names whatever you want as long as you reference them correctly in the !include statement.
But TBH, I never use the UI editor to write any scripts or automations. I just set it up to test it to help others with questions. Those files are usually empty unless I am testing things.
Because automations are a list and scripts are named.
you can see the difference in how you enter them into the config by looking at the first character for a new entry. if the first character is a dash (-) then the entries are a list. If there is no dash then the entries are named.
Don’t ask me why there is a difference in how they are entered. I’ve asked before and basically the answer was “that’s how the developer decided to do it”.
try moving the code indentation back two spaces in the script file that’s not working. Make the first line up against the left margin and then move everything back to follow it’s lead.
I kind of remember having issues with that until I figured out the “secret”.
Hi, after the last update to 0.105.5 my scripts disappeared from my UI and the service scripts.turn_on seems disappered too.
Have someone the same issue? Con share your experience?
I like the editor, is nice to make fast changes on the fly, and the future is for sure all in editor and no more yaml.
SO I wish to bring all script/automation there, but for some is still not possible, so I will keep both, until the editor can handle all type
Well…I made some assumptions that the automation editor and script editor work flow would be the same.
That assumption was completely incorrect!
Apparently the way the script editor works is different than the way the automation editor works when related to the old existing stuff in your config.
The docs for the automation editor says you can keep your old existing automations separately from your automations created by the editor by adding an “extender” name onto the existing “automation:” entry. the docs recommend adding “old” onto it like “automation old:”.
But that doesn’t work at all for the script entry for scripts added using the UI scripts editor.
I just tested adding a script in the UI editor and using the equivalent config for the one recommended for automations and it ended up killing all of my old scripts.
So, yeah, the bottom line is don’t do that.
What’s strange is that you can add the “script old:” entry and it will still reference all of the included files in the “script old:” and also in the “script:” locations just fine.
BUT as soon as you create a script in the UI editor that then gets added to your “scripts.yaml” file then none of the scripts located in the “script old:” location are recognized any more.
Reloading scripts or restarting HA won’t fix it either. The only way I could get my old scripts back was to remove the “script: !include scripts.yaml” entry and point it to my old scripts again using “script: !include_dir_merge_named scripts/” and after a restart everything was back to normal again.
I think I’m going to make this post it’s own thread so others know about this weird behavior.
Maybe it’s worth a bug report based on the feedback that the other thread gets.