Split config file error

Hi everyone,

I’m trying to split my config across multiple files but I get an error:
image

image

image

Why??

Thank you!

There is no curtains: integration. Unless this is some sort of custom integration.

Did you perhaps mean to use cover:?

Also, please don’t post pictures of text. It is a lot easier for us to help you if you post the actual text properly formatted for the forum.

Ok, sorry

I thought I could give any name to the files. With cover.yaml it works.

If I had a custom integration, can’t I name my file blabla.yaml?

In your opinion, is it better to use packages or separate files for split code?

It’s not the filename. You can make that whatever you want: It’s the key before that. Think about what you had before you started splitting things up.

Unless it’s some special custom integration, as Tom said, then it’s a different issue.

In my house there is
1 bathroom,
1 laundry room,
1 kitchen,
1 bedroom.
What do you think is the best way to better organize the configurations? I still have to configure all the sensors.

First I wanted your advice to organize the configuration files…

I read the package docs:
I think…

packages/

  • kitchen/
    • configuration.yaml
    • automations.yaml
    • scripts.yaml
  • bedroom/
    • configuration.yaml
    • automations.yaml
    • scripts.yaml
  • living_room/
    • configuration.yaml
    • automations.yaml
    • scripts.yaml
  • laundry_room/
    • configuration.yaml
    • automations.yaml
    • scripts.yaml
  • garage/
    • configuration.yaml
    • automations.yaml
    • scripts.yaml

Do you think that might make sense?

I will have a complex setup

Question:
then I can call other entities for example for automations: if the bathroom light is on, turn on the kitchen light

That’s a very subjective question. I can’t answer that, sorry. Personally I have some packages by function/purpose.

Thank you!

configuration.yaml

# Text to speech
tts:
  - platform: google_translate
  
sensor:
  !include sensor/rifiuti.yaml
  !include sensor/systemmonitor.yaml

rifiuti.yaml


  - platform: template
    sensors:
      rifiuti:
        friendly_name: "Rifiuti"
        value_template: >-
          {% set giorno_settimana = now().strftime('%A') %}
          {% if giorno_settimana == 'Monday' %}
          ...........other code....
          {% endif %}

systemmonitor.yaml:

  - platform: systemmonitor
    resources:
      - type: processor_use
      - type: disk_use_percent
        arg: "/"
      - type: disk_free
        arg: "/"
      - type: memory_use_percent
      - type: ipv4_address
        arg: eno1
      - type: processor_temperature
      - type: last_boot

I’m trying to split the sensors into multiple files but I’m getting errors on verifying the home assistant configuration

Error loading /config/configuration.yaml: in “/config/configuration.yaml”, line 26, column 3: Unable to read file /config/sensor/rifiuti.yaml !include sensor/systemmonitor.yaml.

why??

Slow down a bit. This is not valid syntax. Go read the documentation slowly (again), revert everything, make one change and get that working. Then make the next. Don’t move on until you’ve sorted out one issue.

You probably want !include_dir_named packages.

Rethink this. Simple things that are understood are also easier to maintain. Does it need to be complex?

You can’t give a path, only a directory or just a filename — and you must use the right directive to go with it. Read Packages - Home Assistant.

Thanks, I finally read the doc and put everything on sensor.yaml and put the comments. Maybe that’s the right thing to do.