Problem is, that apparently this format is deprecated, here the current format: Template - Home Assistant
For example, instead of friendly_name and value_template, I want to use name and state as reported in the documentation.
I tried to adapt the configuration but it is not working, and all the examples I found online they still use the old format, or they use the new format but they donât link to an external file for the sensors.
Anybody has a working example?
If you are attempting to use the new format but in the sensor domain then thatâs a mistake. The new format is used with a new domain called template.
These âstylesâ are all mixed throughout all the yaml. E.g. sensor, light, binary_sensor, template, automation, are all lists and script (canât think of others off the top of my head) is keyed.
If you name them all it doesnât even compile the configuration.
If you are referring to the last paragraph of the link, it doesnât use !include several times like in your example, it mixes !include_dir_merge_list and !include, each used once.
include vrs include_merge_dir_lists is just how they compile the included file(s) into the main file. You can use both as !include. This must only work on the automation section.
EDIT: Nevermind, just checked the code, it just doesnât work on the template section.
I donât think thatâs correct. You canât use an !include if you are including multiple files with lists like in my example. Your first post looks like the way to go.
Can you paste the code you are referring to from your link? I couldnât find your example anywhere in the page.
The example doesnât have to match exactly⌠itâs just how include works. Include just takes a file and plops the contents as yaml into the field. Splitting 1 section between two files is possible with naming, the example is at the bottom. Youâre confusing !include and !include_merge_lists as mutually exclusive, which they are not.
This is the example:
# My own handmade automations
automation manual: !include_dir_merge_list automations/
# Automations I create in the UI
automation ui: !include automations.yaml
while this is entirely possible
# My own handmade automations
automation manual: !include_dir_merge_list room1/
# My own handmade automations
automation manual2: !include_dir_merge_list room2/
# My own handmade automations
automation manual3: !include_dir_merge_list room3/
# My own handmade automations
automation manual4: !include some_other_automations.yaml
# Automations I create in the UI
automation ui: !include automations.yaml
I didnât test the first example block from the documentation, but the configuration from your second block of code doesnât compile if you replace automation with template, probably the files linked have a different structure, dunno.