!include for switches

Hi all,

I’m new with HA, but willing to learn, so I browsed and watched a couple of hours on YT.
I wanna start good, so splitting up my config is where I start and fail, so help is needed already.

my config end with:

automation: !include automations.yaml
group: !include groups.yaml
switch: !include switches.yaml

and in the same folder as configuration.yaml I have switches.yaml

in switches.yaml it I have the following:

  - platform: buienradar
      - symbol
      - humidity
      - temperature
      - windspeed
      - pressure

When I restart my HA it states:
The following components and platforms could not be set up:
Please check your config

What am I doing wrong here because the same happens when I try customize or camera, I’m planning on using these also.


Probably because switch is not a component.

Change it to sensors.yaml

You are directing hass into you switches.yaml file and then have a sensor inside. If you want to have your sensors in a separate file make a sensors.yaml file for them. Then in your main config file add sensor: !include sensors.yaml

I made sensors.yaml. and pointed to there in the end of my config.
sensors: !include sensors.yaml

When restarting my HA it states:
Config Validating
Config error. See dev-info panel for details.


Invalid Config
The following components and platforms could not be set up:
Please check your config

----Config Validation is fixed, sensor was also in config removed and 1 error gone.-----

Do you have a sensor: in your sensors.yaml file? It is not needed. Each sensor can start with - platform with two spaces of indentation.

Read this page carefully.

That’s what I did.

So let’s start in the beginning:

customize: !include customize.yaml

in customize.yaml
friendly_name: Lux

Save -> restart and it doesn’t start

homeassistant (0 spaces)
customize: incl (2 spaces)

in customize.yaml
sensor.fibaro ( 2 spaces)
friendly_name (4 spaces)

Please follow this, it will help us help you.

Specifically code syntax