craig59
(Craig Rayner)
December 11, 2024, 10:49pm
1
Hi,
I am moving all of my utility meters from the UI to YAML, and would like to split them up into smaller files for easier management. I am doing this because I find the yaml files provide easier inbuilt documentation.
This does not work:
utility_meter: !include_dir_merge_list utility_meters
but this does work:
utility_meter: !include utility_meters.yaml
Am I doing something wrong with the directory split. I have exactly the same syntax for sensors split into directories and it works fine.
Any advice appreciated.
(untested) Try this:
utility_meter: !include_dir_named utlity_meter
where “utlity_meter” contains tree-like structure of folders & files, each may contain several entries or just one entry:
energy_1:
source: ..
cycle: ...
energy_2:
source: ...
cycle: ...
(imho, this way of using packages should be for a whole config, not utility_meter only, described here )
craig59
(Craig Rayner)
December 12, 2024, 12:42am
3
Ildar_Gabdullin:
!include_dir_named
Thanks, but does not work.
craig59:
but does not work.
Thanks, but what exactly “does not work”?
Be less cryptic if you need get help.
Try “include_dir_merge_named” in my example.
Just checked this scenario, it works.
craig59
(Craig Rayner)
December 12, 2024, 1:18am
5
Ildar_Gabdullin:
include_dir_merge_named
include_dir_merge_named does work for me as well. but the original !include_dir_named in the original answer does not work. Incorrect syntax.
So, the issue is solved then…
JohanS12
(Johan S12)
December 21, 2024, 6:06pm
7
How did you get this work?
Could you show examples?
Edit 1:
I got this work with a single include line on configuration.file.
Is the Utility Meter such an integration that does not allow multiple “include” lines on the top level?
“Some integrations support multiple top-level !include
statements.”