It would be better if we can support packages inside packages in configuration. I have a use case where i want to include multiple packages which are similar to each other as a package like below.
Atleast in my case i was treating the packages as directory instead of just a single file. This allowed me to store the package information nicely in multiple files as it becomes difficult to manage a big file.
How many scripts and automations can you have for a single fan?
Edit - not to mention that you can still put the automations and scripts in separate files anyway, you just put the key at the top of the file instead of using an include from the previous file.
I can have around ten - fifteen scripts for a single fan.
not to mention that you can still put the automations and scripts in separate files anyway, you just put the key at the top of the file instead of using an include from the previous file.
Can you please elaborate on this?
and one more quick question. Can we define script or automation key multiple times in a package like below?
Hi Mutt,
As far as i know i can only define automation and script key once. This will create conflict if multiple automation keys are defined for a single package.
Let me explain my current full configuration.
I have defined multiple packages in inside a packages.yaml like below.
File: configuration.yaml
I like this organizational scheme because this way i can disable a single package like alarms by just commenting out the alarms line in packages.yaml Instead of deleted a whole set of files in case i would have used include_dir_merge_list which includes whole directories and sub-directories.
Can you please suggest a better way in which i can keep in organizational scheme, i which i want to keep each individual fan settings in its own folder (As explained in description of feature request) without the support of packages inside packages?
Hi mf_social,
If i go with this organization scheme then i will lose the feature where i can disable the entire group like fan or fan1 by just disabling one line as explained in my comment to Mutt above. Please let me know in case you don’t understand it.
May be i am really pushing here but we can’t disable all the fans directly. I wanted to expose the fans as package instead of individual fan as package.
One more thing i failed to mention earlier that i like to keep the scripts and automation also in separate files like below.
packages/fans/fan1/scripts/script1.yaml
packages/fans/fan1/scripts/script2.yaml
packages/fans/fan1/automations/automation1.yaml
packages/fans/fan1/automations/automation2.yaml
Usually people write packages because they describe a particular functionality, entity or usage case. ie they encapsulate a particular need of the person writting the package.
I’ve never seen people do it the way you describe and to be honest I dont see any benefit.
If I have a fans.yaml package then everything I need for the fans is in there.
Input booleans, switches, input numbers, input timedates, scripts and automations and even customisations. Because they all go together.
I do have a couple of packages with broader reach (light automations when I’m out, heating, occupancy, common lighting controls (brightness changes throughout the day).
If i need to ‘comment out’ an automation - i do just that
If I want to ‘temporarily’ remove a package - I just rename it to *.hold or something.
I obvoiusly don’t understand your need / usage as it makes no sense to me and probably not to most others which is why they are confused and why you have 0 votes as of todays date.
Yeah ? still not getting it.
I just have an enable input boolean for each ‘fan’ in this case
You have to work with what’s available and I think (in this case) what is available is more than enough.
yes you can, i just explained that.
It means though (as you are an ‘outlier’ case) that you may have to do a bit more work.
But from this, I don’t think packages are for you
What editor do you use ?
If you use notepad++ or VBC then commenting 1 line is as easy as commenting out 100 and the reverse too.
Mutt,
I understand that we can do it by renaming the directory as .hold or something similar. Yes, it looks like my use case is outlier case. I can do all of this with the current implementation of the packages as well. Even i am doing that as now.
My understanding of a package was like packages in any other language like python where we can include a package inside a package or extend a package. Looks like that is not case in home assistant. packages in home assistant is more like single dimensional.
I use Configurator to edit my configurations.
I will close this feature request as there is not much interest in request. My use case is probably a outlier case. Thanks you to mf_social and Mutt for help.
No, not directory, the *.yaml file you wish to ignore
It took the devs a long time to get us from a monolithic architecture to the breakouts for automations, scripts, sensors etc and then on to packages.
Your analogy of a a single dimension array is a bit off as I consider it a single dimension array of single dimension arrays (containg everything else OTHER than more packages)
You can’t assume that every language has ALL the same features as ‘some other languague’ and that is the case here. I have to say that your choice (of python) is particularly appropriate as I consider python’s implementation of arrays ‘more than a bit lacking’
I hope you find a compromise that you are happy with but 99.9% of people are happy with the current implementation and your use/case is not even in the remaining 0.1%