Hello! I’m transitioning from Hubitat to HA. So far it has been a good experience. I’m trying to create my first package but im not sure what the best practices are for filesystem structure. is there a way to make this structure work or do i need to reorganize the files/folders?
I haven’t used pacvkages this complex, but it looks like you are including automations, scripts and sensors twice. Once as an include and once as a package.
Thats basically a requirement if you want to use a mix of YAML and GUI stuff since the GUI automatinos for example are stored in the automations.yaml file.
I just had another look at the image above and yeah, it’s a bit wrong. The package files would have headers for automation:, script: etc. but not actual files.
So what I was getting at was that you still need the overall automations.yaml file for GUI stuff on top of the package files. The image above (which I missed originally) has sub-files for each domain rather than file headers.
Sorry, I’m a software developer/engineer by trade, so I get a little carried away with maintaining things in code. I guess the easier way to understand what I’m trying to accomplish is that I would like to maintain anything I make/configure/customize/etc for my HA in source control. I’d like to set up a git repo for each package under the packages directory. this will allow me to 1) run git clone to “install” packages 2) version control my HA config(s) and 3) commit changes as needed for new or deprecated functionality.
Well you need to include both the files that the GUI saves to and the files in the packages…
ie:
configuration.yaml
homeassistant:
customize: !include customize.yaml # Customization file done in YAML
packages: !include_dir_named packages # package setup done in YAML
automation: !include automations.yaml # this is where the GUI saves to
group: !include groups.yaml # also where the GUI saves to...
I think that’s where I was stuck… !include_dir_named packages doesn’t work for me. When I was testing I was able to get the inputs.yaml (helpers) to show up using !include_dir_list packages but that was the only thing that showed up in the UI. either I’m using the wrong syntax or I’m using the wring !include method? Here is a link to the branch that I’m working on for my setup.