Show HN: Makejinja: Automatically generate complex Home Assistant configurations (github.com)
makejinja can be used to automatically generate files from Jinja templates. This allows you to load variables from external files or create repeating patterns via loops. A very interesting use case for this tool is generating config files for Home Assistant: Using the same language that the built-in templates use, you can greatly simplify your configuration. When creating for example dashboards, it allows you to create a view for each room based on a single common template, dramatically reducing the maintenance overhead of complex dashboards. I originally developed this for my smarthome setup, but thought it may be useful for others as well!
A concrete example for Home Assistant can be found in the tests directory: https://github.com/mirkolenz/makejinja/blob/main/tests/data
For more information like detailed features or installation/usage instructions, please visit the GitHub repo.
13 comments
[ 4.5 ms ] story [ 45.0 ms ] threadI know Node Red but I consider all visual tools as a nice way to complicate things not to simplify so I never used it. Actually my HA is in an org-mode file tangled in the right place, but just the recent template syntax change was a painful waste of time to update especially since after some update my Victron/MQTT integration have change sensors names for unknown reasons ad I have to craft a monster just have proper p.v. production logs in the energy dashboard... Oh, sure I can even ignore HA but that's is, a giant crapload of YAML...
If you try it out and face some issues, feel free to open an issue. Maybe I can do a few things to make this tool easier to use for users without a programming background.
The things I mentioned are niches however, so I assume for the „regular“ user almost everything can now be setup via the UI.
I don't think that's quite accurate, normal people probably won't be able to set up complex automations, but having used Control4 and HomeAssistant's configuration tools, both are somewhat equivalent in difficulty, with C4 having a slight edge because there's a lot of hardware vendors who deeply integrate with it. A lot of the families I've done home automation for would have been able to consume HomeAssistant without any issues. There was one person who had a high end setup involving whole home video involving matrix switches that I am hesitant to make that claim for.
Important to know that most "normies" that consume home automation have a tech representative who deals with their setup.
I wouldn't have assumed that; I was more thinking the "got some Hue bulbs for Christmas and someone pointed them to HA" kind of thing. Thanks for pointing it out.
I've run into, twice in the past year, some kind of update or config change (that says valid) that made the UI inaccessible and had to quickly spin up a new VM and restore my backup.
E: many people will be better served by Alexa/Google/Apple hubs with matter integration that support everything with a polished Ui. Those with super techy inclinations - or propensities towards tinkering will want something like HA
I don't use Apple stuff anymore either because it's too restrictive for my usecases. I use FreeBSD and ungoogled Android now.
I don't want HA to go the same way. Of course what they do is up to them but I don't think everything should necessarily be for everyone. If FreeBSD (or Linux)+KDE was for everyone for example, it would no longer be for me.