Can Anyone Point Out Why My !include_dir_merge_named Configuration Doesn't Work?

I am trying to figure out how to use !include_dir_merge_named. I have watched hours of videos and read a bunch of tutorials, but I still don’t understand why my configuration doesn’t work. Homeassistant keeps giving me this error: “Setup failed for packages: Integration not found.” Here is my configuration yaml and a yaml that I created for Victron. They’re still very basic as I’m trying to get it set up before I dive too far into adding things.

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text-to-speech
tts:
  - platform: google_translate

#automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
packages: !include_dir_merge_named packages

api:

########## VICTRON ##########
victron:
  modbus:
  - name: victron
    type: tcp
    host: 10.10.7.91
    port: 502
    sensors:
      - name: victron_battery_voltage
        unit_of_measurement: V
        slave: 100
        address: 840
        data_type: uint16

      - name: victron_battery_current
        unit_of_measurement: A
        slave: 100
        address: 841
        data_type: int16

      - name: victron_battery_soc
        unit_of_measurement: P
        slave: 100
        address: 843
        data_type: uint16

      - name: victron_pv_dc_current
        unit_of_measurement: A
        slave: 100
        address: 851
        data_type: int16

It works when I have those lines of code in my main configuration.yaml, but when I add !include_dir_merge_named packages and put the victron.yaml in the packages folder, I get the error above. I think once I see this working, I’ll be able to use the same format for all of the other yamls in the packages folder. So far I also have one for cameras, but that doesn’t load either.

stream:
ffmpeg:
  ffmpeg_bin: /usr/bin/ffmpeg
camera:
  - platform: ffmpeg
    name: Misc-Camera
    input: -rtsp_transport tcp -i rtsp://100.66.202.43:8554/misc-camera

My configuration.yaml is in the homeassistant directory, and inside of that directory alongside configuration.yaml, is my packages folder, and inside of that are the other yamls.

Put it under the home assistant key.

homeassistant:
  customize: !include customize.yaml
  packages: !include_dir_named packages

That’s because that’s where they belong

You can’t “define” sensors in a theme, a theme is primarily intended for CSS, of your Frontend UI

So same goes for your stream camera etc,

Upps sorry i missed the “packages” part :relaxed:

When I change my code to this:

homeassistant:
  # Loads default set of integrations. Do not remove.
  default_config:

  # Load frontend themes from the themes folder
  frontend:
    themes: !include_dir_merge_named themes

  # Text-to-speech
  tts:
    - platform: google_translate

  #automation: !include automations.yaml
  script: !include scripts.yaml
  scene: !include scenes.yaml
  packages: !include_dir_merge_named packages

  api:

Homeassistant no longer loads at all. If I comment it out and reload, the dashboard loads back up again. Still without the Victron stuff though.

I have this for my packages

homeassistant:
  customize: !include customize.yaml
  packages: !include_dir_named packages

I got my configuration to work. I changed the !include_dir_merge_named to !include_dir_named, and changed all of the indentation of my victron.yaml.

configuration.yaml

homeassistant:
  packages: !include_dir_named packages
  customize: !include customize.yaml

victron.yaml

########## VICTRON ##########
# packages/victron.yaml

modbus:
  - name: victron
    type: tcp
    host: 10.10.7.91
    port: 502
    sensors:
      - name: victron_battery_voltage
        unit_of_measurement: V
        slave: 100
        address: 840
        data_type: uint16

      - name: victron_battery_current
        unit_of_measurement: A
        slave: 100
        address: 841
        data_type: int16

      - name: victron_battery_soc
        unit_of_measurement: P
        slave: 100
        address: 843
        data_type: uint16

      - name: victron_pv_dc_current
        unit_of_measurement: A
        slave: 100
        address: 851
        data_type: int16

Thank you for the help.