!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:

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

When I restart my HA it states:
INVALID CONFIG
The following components and platforms could not be set up:
switch
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.

Thx

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.

and

Invalid Config
The following components and platforms could not be set up:
sensors
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:

Homeassistant:
customize: !include customize.yaml

in customize.yaml
sensor.fibaro_system_fgms001_motion_sensor_luminance:
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