I’ve been trying to add a new script via the HA UI. Every time I created one and hit save it appeared to save fine, but it never actually saves. It won’t appear in the list of scripts, and if I tried to run it after saving I get a not found error.
Thinking it might be because I used to have some scripts manually created I deleted the line script: !include_dir_merge_named configuration/script from my configuration.yaml and “Scripts” tab disappeared completely from the UI. I got the tab back again by adding script: back into my configuration.yaml but it’s working no better than before.
Am I missing some bit of config required to move over the UI managed scripts?
If you created a scripts directory within the configuration directory (i.e. the directory that contains the configuration.yaml file) then it should be this:
my_yaml_ones can be any text you want, that’s just an example.
Fwiw I bet if you looked in /config you’d find that the scripts you’ve been making are in /config/scripts.yaml. However since you are not including that file in your configuration nothing happens when you click save. It just ends up reloading all your other scripts and misses that one.
My configuration.yaml is many years old at this point and I keep finding I’m missing bits that are now provided in the default config. I should probably rebase on top of the default configuration.yaml at some point .
That fixed my problem though, cheers! You were right about a scripts.yaml existing with all the ones I’d attempted to make too. The decision to save to config/scripts.yaml regardless of config, but not load from it seems odd. The error here was very opaque and it feels very easy to put yourself into this invalid state. Maybe it’s time I finally found some time to make a HA PR and at least improve the error message or docs a little.