Split Configuration help

Hi,

Hoping someone can assist me, as im having a total facepalm moment.

I am wanting to properly deploy split configuration in my HAS instance, and what I thought I had done previously being right, however, it appears not to be

What I had done was, created a folder called “includes” and then created sensors.yaml, media-players.yaml, switches.yaml etc

I then called each of these from the main configuration file

However, what I found when I recently attempted to add things to sensors.yaml (thinking all sensors go in the one file) and things wouldn’t work!

I have read and read the splitting configuration documentation, but I don’t know why I cant fully comprehend it – sorry!

I am thinking, that each item needs its own yaml file? So for example, I would have a directory called components say, then inside that have subfolders called

Media Players
Sensors
Lights
Climate
Switches

Then inside those folders, have the yaml files, dependent on the component type, so hue would go into the lights folder, efergy and speedtest in the sensors folder and so on

Octoprint.yaml - for my ocoprint instances
hue.yaml - for all things hue
wemo.yaml – for my wemos
efergy.yaml – energy gateway
spotify.yaml – spotify
speedtest.yaml
Yamaha.yaml – for my Yamaha AVR
kodi.yaml – for my kodi instances
evovac.yaml – for my robot vac

and so on and so on…

Then, in configuration.yaml, I would add the line

sensor: !include_dir_merge_list components/sensors
switch: !include_dir_merge_list components/switches
light: !include_dir_merge_list components/lights

Have a look at how I’ve done it:

1 Like

Thank you

I am starting to try this in my setup, starting with the “media_players” component

I have created a folder called /includes/media_players

In that folder, i created three files
kodi.yaml - https://pastebin.com/QCDKGfKq
samsung_tvs.yaml - https://pastebin.com/pLLtGWYr
yamaha.yaml - https://pastebin.com/kGrEMzzr

Then, in my configuration.yaml, i changed the media_players: to

media_player: !include_dir_merge_list /includes/media_players

However, it does not seem to load them, what would i be missing here?

Remove media_player: from each of your files
Also check your indentation in each fine, you need to bring the whole block back

thanks, done that, still wont load them it seems

image

Worked it out, had to remove the / in front of includes