WTH is HA reformatting my jinja code

One thing that bugs me out is the constant reformatting of jinja code in automations/scripts/template entities. I would love for the code to stay formatted as is. Especially for larger jinja template code this really messes with readability and is one big downside of using the UI over YAML.

This one is very difficult.

My understanding is that HA stores the jinja we code as json. As it presents it back to us, it can’t give us ‘our’ formatting. I hope someone else follows this with better info as my ‘explanation’ is very basic.

Super annoying. I don’t use it, but I sometimes help people who do use the UI with Jinja. It’s a pain to format it. It would be great if it could just retain the original format.

It seems to be because you use GUI mode or maybe it is called storage mode.
I now use YAML only mode and it does not reformat my YAML anymore.

I know, which is why I phrased my last sentence like I did.

1 Like