I’m using this modular way to include a components (which is great)
packages: !include_dir_named pkgs
Until now I’ve used group which worked with lovelace (there was an automatic translation)
Once I’ve moved to native lovelace (using yaml), adding “view” to each component does no work any more. (Lovelace looks only into a the global file called config/lui-ovelace)
Is it possible to have lovelace to work like group work in a modular way?
the full example of my configuration file can be seen here
But just to clarify…your groups that you defined as views are useless now since lovelace uses it’s own config files and ignores the “view: true” in groups.
@finity this is not exactly what I’m looking for.
I think @lolouk44 understand my point and my understanding that it is not possible.
The point is to add the “view” folders into each of the components which does not work like other yaml
and not to have another split of view
though I am with @finity here and use includes for most anything in yaml mode Lovelace, I am willing to take your challenge it would be an option for what you want. The thing is I am completely in the dark what that would be… talking about components confuses me somewhat. What exactly are you trying to realize? Please expand on that further, so we can help (if possible of course)
Ok, sorry for not being clear
Let me give an example what works (for groups) and does not work for lovelace view
In my configuration file I have this lines
"
packages: !include_dir_named pkgs
"
This line force the configuration file to read the yamls files from pkgs folder
Each file includes every aspect this component (sensors, custom, group view etc)
I call each file a component because it is a self contained element
The packages do still work, and are very useful. Its the group: that isn’t used in Lovelaceany longer.
Lovelace needs a paradigm shift…
So start using views with !includes for most anything and forget about groups. (I still have them in my packages because I also use non_lovelace)
the View should be declared in a !included view file, as @finity showed you, and not as part of a package. It is the starter for Lovelace, referenced in ui-lovelace.yaml. The main advantage in my use case is that that file is hot-plugged…you can change it and it will show immediately after a refresh. That won’t work when using packages (I think, have never tried it), if declaring views in packages would work at all that is.
What I would like to have is that the “packages” model would be integrated into lovelace in the same way.
I would like to add this line to lovelace yaml
packages: !include_dir_named pkgs
and view and group (old) will be taken from the same file.
This way copy a single file (component) will copy all the information about this component (this was all the point in packages model)
It seems that Lovelace works differently (in a good way, e.g. Not require restart for example) but I would really like the full integration and not to have a separate file for Lovelace and original yaml
Do you think that it worth a feature request?
The whole idea behind Lovelace is/was to separate the front end / presentation from the back end / entities definition logic. You’re basically asking to revert that design decision.
Not necessarily, I am looking at this from a different angle (user not developer). You can keep the implementation separation. I’m suggesting to add a Lovelace section in each YAML file. This way each logical section could have all the definitions needed for a component point of view. This is exactly the point in the package design which is a good thing and ignored by the Lovelace dev team.