Then within each one of those folders is a file per component type like sensor.yaml, binary_sensor.yaml, alert.yaml, etc. which contains definitions of that type of thing for that particular named set of functionality.
@CentralCommand Thanks, that’s an interesting way to split it. Gives me another idea how to set this up.
@jazzyisj That’s the way I’m doing it right now, but the files get bigger and bigger. In three files I have more than 1000 lines, it get’s confusing more and more… So I’m looking for a way to declutter it. Seems the new template “feature” doesn’t make it any easier…
EDIT: should add, that I’m currently have to write some kind of documentation, as my wife rightly points out, what if I’m not around… So clear and easily readable packages would be very welcome…
I guess I left out the fact that my automations and scripts both live within their own directories with subdirectories that match the packages to keep them organized. I like to keep separate files for each automation and script (or group of small automations/script). Makes them easier to find. Most of my actual package files are quiet manageable since I’ve organized it this way.
I was going to try that myself but then I realized the attribute wouldn’t display where the name usually would.
I think Thomas’s template entity row plugin is a good method replace the friendly_name functionality. I only have a couple of places in my front end that are impacted though so it’s an easy fix for me.
Nvm. I’m dumb. The name attribute is still a template. All my template sensors works with the new format.
apparently it can be done. It bewilders me though why such a core configuration variables for almost any integration in HA should be moved to hand made attributes on this new template: integration.
More flexibility ? No, because it has always be an optional variable? Confusing? yes, because by default the new default variable name: creates the object_id, which is very counter intuitive, coming from the legacy friendly_name, and which was there to do just the opposite, allow the user a friendly_name different from name/object_id…
That’s how name works in every other integration. This is nothing new, just new to templates.
It won’t. Balloob has been against it even in the old integrations, that’s why some template integrations do not have a friendly_name_template. Just use the method I listed. Friendly name is an attribute, so list it in attributes.
I don’t understand why you’re still upset. You have the ability to do what you want but you still don’t like it. Common man, it’s the same thing just configured differently.
No, thats not what I referred to. I was comparing the new config with the now legacy config, where name: didn’t exist as a config variable (so what you state is not correct), and we only had the optional friendly_name:. Of course the sensor_name created the slug, so thats not new
yes, too bad really, and Ive never understood that, but I wasn’t talking about friendly_name_template, but about friendly_name. I do see we now can have friendly_name_template, but, considering Balloob heavy position against that, I sincerely hope the feature is here to stay, and not an oversight on his part.
If only we could use packages…But thats a another FR closed, though the discussion hasn’t stopped
@CentralCommand , can you provide an example of how to got this to work in your tamplate.yaml file? I’ve got all of my configuration broken down like this using the !include xxxxx.yaml files to keep everything organized. When I try to do this with a template.yaml file it’s not working. I get the following:
Invalid config for [template]: [binary_sensor] is an invalid option for [template]. Check: template->binary_sensor.
Making a template dir is a work around, it’s not the equivalent as simply allowing them to be merged form a single package file which appears to be the expectation from more users than not
Do either of those messages say that it’s being removed? Do either of those messages say it’s deprecated? Do any of the blogs say that they are deprecated? No.
No, it’s inherently implied by the fact that you’re recommending people not use it. If it was so star spangle bannered, you would continue to recommend it a way forward.
I organize mine this way as well, with everything related to a particular “feature” (like my Roomba or Frigate, for example) in its own package file, including any sensors, input helpers, automations, etc…
So using the new template format (or trigger templates in general) would completely break my organization.
I found this thread because I was also trying to replace some of my ‘legacy’ sensors in a package with the ‘modern’ sensor.
I was actually trying to get the new Statistics Graph Card to work but a sensor was not showing up. Apparently, specifying “device_class: temperature” was not enough; it also needed “state_class: measurement”. But that’s not available in the legacy.
Does anyone have any insight into how to add a “state_class: measurement” to a legacy template sensor?
Until the new template sensors will be available in packages (if they ever will be), you can cjstomize the entity to add the attribute, e.g. from my system:
From a purely objective point of view I really don’t see any rational argument for them not being.
Clearly there may be very good technical reasons but that would then just beg the question how did they ever get past any kind of architectural discussion?
I’d be interested to know what percentage of HA users use packages.