[HN Gopher] Show HN: Makejinja: Automatically generate complex H...
       ___________________________________________________________________
        
       Show HN: Makejinja: Automatically generate complex Home Assistant
       configurations
        
       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.
        
       Author : mlenz
       Score  : 9 points
       Date   : 2023-02-03 18:12 UTC (4 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | MattDemers wrote:
       | Happy to see this, mostly because HomeAssistant stuff is nowhere
       | near consumer-ready. I barely have the Docker knowledge to get it
       | working in the first place on my NAS, and even just doing basic
       | automations assumes you know much more coding/process stuff than
       | the typical normie.
        
         | chomp wrote:
         | > mostly because HomeAssistant stuff is nowhere near consumer-
         | ready
         | 
         | 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.
        
           | MattDemers wrote:
           | >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.
        
         | mlenz wrote:
         | While they try to move basic config to the UI, most stuff still
         | requires yaml in the end. So I also think they still have a
         | long way to go to appeal to regular users. makejinja also
         | assumes that you know some 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.
        
           | Semaphor wrote:
           | Most? I guess it depends, I almost exclusively use YAML
           | because I find it easier (mainly because I can copy & paste),
           | but almost every time I could also use the UI.
        
             | mlenz wrote:
             | UI support has vastly improved in recent versions and you
             | are now able to get a pretty good setup without using yaml
             | at all. Some quite interesting integrations however do
             | still require it (e.g., trend, bayesian), so yaml is needed
             | if you want to utilize home assistant to the max.
             | 
             | The things I mentioned are niches however, so I assume for
             | the ,,regular" user almost everything can now be setup via
             | the UI.
        
       | kkfx wrote:
       | I always ask myself anytime I have to deal with my HA or k8s
       | stuff why the hell people want to shot themselves in the genitals
       | with YAML crap instead of using a damn programming language for a
       | damn personal config.
        
         | mlenz wrote:
         | I totally agree, yaml is just messy when used for anything near
         | complex. This is also why most automations in my home assistant
         | setup are written in Python using AppDaemon. But I did not find
         | anything good for dashboards, so I tried to reduce duplicate
         | code as much as possible using makejinja.
        
         | japanuspus wrote:
         | My impression is that most people doing heavy automatisation in
         | Home Assistant are using Node Red or AppDaemon [1] almost
         | exclusively.                   [0]: https://community.home-
         | assistant.io/t/home-assistant-community-add-on-node-red/55023
         | [1]: https://community.home-assistant.io/t/home-assistant-
         | community-add-on-appdaemon-4/163259
        
       ___________________________________________________________________
       (page generated 2023-02-03 23:02 UTC)