Sometime recently it seems that HASS has taken to rewriting my automations.yaml file (and maybe others) straight after I upload it… My file is generated by ansible, and the “diff” shown on upload is now full of changes, rather than just showing the changes I made. This makes the system pretty unusable for me…
I have seen individual automations get rewritten if I use the editor in the front-end, which I tried once or twice as a quick fix. I have no interest in using the UI editor, even in yaml mode, as most of the automations are generated.
Is there some way to prevent this from happening?
I’ve backed out to 2024.5.5, but that is the same. What version do I need to use to fix this issue? Hopefully I can back out to it while I take another look at alternatives to HASS? Too many things are now “new and improved” and moving away from being primarily controlled by yaml config. A great shame
I used to do that originally, but things like traces only worked for the main automations file, so I had to merge everything into a single file. Maybe that’s no longer the case and I can return to using the files in a directory like I used to…
Thanks for the suggestion, I will reconfigure and test.
It seems to be the ordering of the automations, still keeping my formatting of everything.
Interestingly I’ve generated and uploaded the single file of automations under a different name, but not yet told HA to use it. That file has been re-ordered too. So, unless it’s rewriting all yaml files that appear in the directory, something very odd is going on. Unless ansible or it’s diff is playing up, but I run that 100’s of times per day, and nothing else is misbehaving.
I need to look for a pattern in the changes etc.
And will still look at using the split files, as that’s the way I have them stored anyway, the ansible just merges them by including each in a template file.
Weird. That does not happen for me when I edit the automations.yaml file directly (my preferred way to create automations), or when I use the UI automation list to look at automation traces.
And it looks like an inexplicable ansible issue… I generated the file to /tmp and a second run gives different results!
That’s more worrying for me, but again odd that it’s not happing elsewhere. There was an OS update to Rocky 8.10 a couple of weeks ago, so newer versions of things may have “improved” ansible in some way.
I’m glad that it’s not HA though.
Must still investigate if the split config works with traces etc, as it would be nice to get that part sane again.
But as it’s gone 2am here, probably something for later.
And for anyone who runs into the same issue, it seems that ansible templating (python / jinja2, like HA) using the difference function now changes the resulting list order each time it’s run, which it did not do before. So make to handle this somehow. For me, sorting the results works great.
It’s not how many you have but what you do with them. Theoretically you could put all your automations in one. It would be a nightmare to debug though.
LOL… I only have 269 automations Many can be combined, but are indeed kept separate for debugging and control. At the moment all in one file because of previous issues, but this mornings task is to put the source files back as individual files in HA if indeed tracing etc now works on them.