Backup program for automation

Hello everyone, I have been trying for a few days now to create a program that, whenever I open an automation, first writes a backup to a text file in a location on my hard drive (I currently do this manually every time, so that if I notice after a while that something is really wrong, I can just go back). I don’t think it should be that difficult, but I just can’t seem to get it to work. Does anyone have an idea for this? Thanks for every response.

Needs to be a feature in ha, automations have version history like a git repo. Why not open a feature request.

My HA automatically makes a daily backup to my NAS.

So i always have a backup of the automation.yaml (which holds all automation).
I.o.w. I can go back just by looking at that file :thinking:

You have two more options today:

  1. Make an HA config backup.
  2. Use git, which is a version control system exactly for this purpose.

Or you just make copies of the automation and disable it.
Or if it’s just an action or trigger that has changed, you make a copy of that and disable it in the automation.

If making changes I just disable whichever bit I need to change and add a new bit to test. That way if it does not do what I want I just delete the new bit and enable the old bit

Start using git… You can install git on your HA machine and initate a repo. All chamges will be recorded and you can choose commit an push the changes to a private repo once they are ok!