Home assistant never alters your yaml. This is a policy. Even when integrations are imported into the UI automatically after an update it is left up to you to remove the redundant yaml.
You will need to use VSCode’s bulk find and replace feature. Click somewhere in your automation file then Ctrl+f
Took me about 2 minutes do do all my automations and scripts.
Make sure you have a backup of your files before starting in case something goes wrong.
After making the changes make sure to do a config check before reloading or restarting and check the log file for errors.
Make sure you have the “match whole word” option selected.
Note: all of these have two spaces at the beginning of the find and replace words. They just don’t show up on the forum.
It is important to do it in this order:
Find trigger:
replace with triggers:
can be done all at once
Find platform:
replace with trigger:
can be done all at once
Find action:
replace with actions:
can be done all at once
Find service:
replace with action:
can be done all at once
Find condition:
replace with conditions:
single step this one.
Be careful with that last one (conditions). It has the potential to find false positives if you don’t use lists for single conditions. It is best to use the find button and check each one before using the single replace button. e.g.
a false positive will be detected here:
condition:
condition: time # do not change this one
weekday:
- tue
However it would not falsely detect this one:
condition:
- condition: time # the '-' will protect this from find (no two spaces in front)
weekday:
- tue