Splitting up the config

In an attempt to create some order in my system, I have begun splitting it all up:

group: !include groups.yaml
automation: !include_dir_merge_list automation/
script: !include scripts.yaml # script: !include_dir_merge_list scripts/
scene: !include scenes.yaml
switch: !include switch.yaml
cover: !include cover.yaml
sensor: !include_dir_merge_list sensors/
notify: !include notify.yaml
input_boolean: !include_dir_merge_list booleans/
binary_sensor: !include_dir_merge_list binary_sensors/
input_number: !include_dir_merge_list input_numbers/
input_select: !include input_select.yaml
input_text: !include input_text.yaml
light: !include lights.yaml
rest_command: !include rest_configs.yaml
timer: !include timers.yaml
zone: !include zones.yaml
counter: !include counters.yaml

The split up automations work fine, but nothing else. I don’t get any errors but scripts, input_numbers etc. are not available to me when split using !include_dir_merge_list.

Is there a reason for this that I am missing?

IMHO It’s not worth the effort. HA developers decided to drop YaML configuration files in favour of a hidden .storage directory, integrations and UI editors. For example input_* can easily be created using the UI (“Helper”) and AFAIK not make it into your input_numbers/*.yaml files.

So, what’s the advantage?

Lets see you directory structure

Also, yaml isn’t being scrapped:

Here you go.

You have to use the correct include type based on what the field expects. Then inside your files, you have to make sure your yaml is correct as well.

input_booleans are not a dir_merge_list. They would be a dir_merge_named.
input_numbers are not a dir_merge_list. They would be dir_merge_named.

tbh, I think you should manage your input_* through the UI.

As for the rest, it’s going to be a case by case basis and I can help you with which include you should use. I can also help you identify which one to use, but the docs also tell you this info as well.

Actually, it is, as mentioned in the blog post:

Yaml isn’t being removed.

True.

But deprecated for configuration. Which is okay (especially as i don’t contribute to the project), but it renders efforts in splitting up (obsolete) configuration useless IMHO.

Now, back to topic.

what are you talking about? It’s not deprecated for configuration. Read the ADRs please, stop spreading this wrong information.

1 Like

Thank you, Petro.

That explains a lot.

If the ‘helpers’ could be filtered and sorted, like scripts are, I probably wouldn’t need to do this.

I’m also migrating, bit by bit, to a new server, and with the UI there’s no easy way to this.

There’s a bar at the top of he UI where you can type. It will filter them. You can also use the entities list and apply the same filters that scripts have. So I’m not really sure what you mean by this comment.

Either way, take the time to look at the tutorial on splitting up your config to learn which one to use.

This:

Doesn’t exist for helpers:

This means that I can’t filter helpers by area.

Ah, only area would apply there, probably an oversite. In that regard, you’d go in via the area itself and look at the attached entities.

Yes, not ideal.

That’s my main motivation for splitting it up. Searching the helpers only works for the entity, not the area, so doesn’t act as a filter.

you can still apply these filters on the entities page. Type input_number in the entities list and sort by area.

Thank you. This works for input_numbers.

Please can you point me to the docs with this info?

I did

Yes, I’ve read that but couldn’t find that info.

I’ll read again.

Thank you.

If you don’t know types you aren’t going to know what to use. You have to be able to distinguish between a listed configuration (list) and a named configuration (dictionary). The docs do not tell you how to distinguish them, it tells you which ones to use.

listed configuration (list)

some_field:
- internal_contents1:
  internal_contents2:
  internal_contents3:

- internal_contents1:
  internal_contents2:
  internal_contents3:

named configuration (dictionary)

some_field:
  name1:
    internal_contents1:
    internal_contents2:
    internal_contents3:
  name2:
    internal_contents1:
    internal_contents2:
    internal_contents3:
1 Like

OK. I’m getting it.

How do I determine the ‘type’?

I appreciate you taking the time with this. It’s been holding me up.