Utility Meters - Configuration for include directories

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)

Thanks, 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.

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…

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.”