Config help - Newb

I am brand new to all this coding and language. I am trying my best to figure this out as I go but I am noticing some issue. I was wondering if anyone could help my clean up my Configuration.yaml.

type or paste code he# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
system_health:
frontend: 
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate


sensor: !include sensor.yaml
group: !include group.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switch: !include switch.yaml
zone: !include zone.yaml

homeassistant:
  customize: !include customize.yaml


google:
  client_id: !secret google_id
  client_secret: !secret google_api

alarm_control_panel:
  - platform: manual
    name: STHM
    code: !secret sthm_code
    arming_time: 30
    delay_time: 20
    disarmed:
      trigger_time: 0
    armed_home:
      arming_time: 0
      delay_time: 0

sensor:
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /home
      - type: disk_use
        arg: /home
      - type: disk_free
        arg: /home
      - type: memory_free
      - type: memory_use
      - type: memory_use_percent
      - type: processor_use
      - type: processor_temperature
      - type: network_in
        arg: eth0
      - type: network_out
        arg: eth0  
      - type: ipv4_address
        arg: eth0
      - type: ipv6_address 
        arg: eth0
      - type: swap_use_percent
      - type: swap_use
      - type: swap_free
      - type: last_boot

  - platform: weatheralerts
    state: OH
    zone: 22
    county: 133  

  - platform: discord_game
    token: Token
    image_format: png            # optional, available formats are: png, webp, jpeg, jpg
    members:
      - person1
      - person2
      - person3

  - platform: steam_online
    api_key: APIKEY
    accounts:
      - player1
      - player2
      - player3
  
  - platform: template # Current Steam game (account 1)  
    sensors:
      steam_game1:
        friendly_name: "Game"
        value_template: "{{ states.sensor.steam_[player1].attributes.game }}"

  - platform: template # Current Steam game (account 2)
    sensors:
      steam_game2:
        friendly_name: "Game"
        value_template: "{{ states.sensor.steam_[player2].attributes.game }}"

  - platform: template # Current Steam game (account 3)
    sensors:
      steam_game3:
        friendly_name: "Game"
        value_template: "{{ states.sensor.steam_[Player3].attributes.game }}"

  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'    re

I tried using the sensor.yaml but could never get it to work so that is why I have sensors at the bottom. I thought maybe they all needed to go under the

homeassistant:

but I get the error β€œextra keys not allowed @ data” with no reference to fix it. I removed all my private Keys, API, Tokens (Not that new lol). Anyways Thanks for any help!

You already have that, you can’t put

sensor:

further down - see this article.

There’s no reason you can’t move that section, without the opening sensor: line, to sensors.yaml

I understand. That was my confusion. I wasn’t sure if the !includes should go under the β€œhomeassistant:” area or just above like I have them. Also, I cannot get the link to work for that article. Thanks so much for the response.

Take a look at packages , search HA help pages .
I never touch the configuration.yaml any more, it’s simple:

homeassistant:
  name: Home
  #-- Location stuff
  latitude: <secret>
  longitude:<secret>
  elevation: <secret>
  unit_system: metric
  time_zone: Europe/London
  #-- Include list of all config yaml files under ./packages
  packages: !include_dir_merge_named packages
  #-- Customize UI
  customize:  !include customize.yaml

so in my config dir, I have a packages dir and I put everything in there. Allows me to include or share configs. My tree looks like this

daz@Pi:~/HASS_DOCKER/config/packages $ tree
.
β”œβ”€β”€ hvac
β”‚   β”œβ”€β”€ control
β”‚   β”‚   β”œβ”€β”€ bath.yaml
β”‚   β”‚   β”œβ”€β”€ boiler.yaml
β”‚   β”‚   β”œβ”€β”€ heating.yaml
β”‚   β”‚   β”œβ”€β”€ shower.yaml
β”‚   β”‚   └── water.yaml
β”‚   β”œβ”€β”€ thermostats
β”‚   β”‚   β”œβ”€β”€ top.yaml
β”‚   β”‚   β”œβ”€β”€ kitchen.yaml
β”‚   β”‚   β”œβ”€β”€ lounge.yaml
β”‚   β”‚   └── conservatory.yaml
β”‚   └── trvs
β”‚       β”œβ”€β”€ energenie_7922.yaml
β”‚       β”œβ”€β”€ energenie_8005.yaml
β”‚       β”œβ”€β”€ energenie_8008.yaml
β”‚       └── energenie_8206.yaml
β”œβ”€β”€ lighting
β”‚   β”œβ”€β”€ tablelamp_bedroom.yaml
β”‚   └── tablelamp_lounge.yaml
β”œβ”€β”€ plugs
β”‚   β”œβ”€β”€ energenie_1.yaml
β”‚   └── energenie_2.yaml
β”œβ”€β”€ security
β”‚   └── cameras.yaml
└── system
    └── sysmon.yaml
1 Like

You’ll want to read https://www.home-assistant.io/docs/configuration/splitting_configuration/

The splitting basically happens in the relevant section.