Packages question

After using home assistant for a year now I finally got to the point where my config file is now almost unmanageable and therefore I want to split it with the packages machanism.

However I have some problems with it, even an easy extraction doesn’t work. My configuration.yaml starts with

# Configure a default set of integrations for Home Assistant to load
# see https://www.home-assistant.io/integrations/default_config/
default_config:

# Enable configuration through packages
homeassistant:
  packages: !include_dir_merge_named packages/

and I have one package (elias_alarm.yaml) with the following content:

input_boolean:
  elias_alarm_switch:
    name: Elias Wecker einschalten
    icon: mdi:alarm-check
input_datetime:
  elias_alarm_time:
    name: Elias Wecker Uhrzeit
    has_date: false
    has_time: true
    icon: mdi:alarm

This works when it is in configuration.yaml, but with packages I found the following in the log:

2020-07-02 10:01:15 ERROR (MainThread) [homeassistant.config] Package input_boolean setup failed. Integration elias_alarm_switch Integration 'elias_alarm_switch' not found. (See /config/packages/elias_alarm.yaml:1). 
2020-07-02 10:01:15 ERROR (MainThread) [homeassistant.config] Package input_datetime setup failed. Integration elias_alarm_time Integration 'elias_alarm_time' not found. (See /config/packages/elias_alarm.yaml:6). 

Can someone explain what I am doing wrong here?
Kind regards, Christian

Use !include_dir_named instead of !include_dir_merge_named

!include_dir_merge_named will make home assistant think that your primary keys (input_boolean: and input_datetime:) are the names for each package, but you want the entire package to be the contents of that file (and any others you add to that directory, presumably).

1 Like