Messing up with an invalid configuration.yaml

Since some days I am getting errors in my config - image
I don’t know what to do. I have split up my config as @Frenck did it moving a lot of stuff into my package folder… I worked like a charm. But now I got lost … not knowing where to look for…
Here’s my configuration.yaml:

homeassistant:
  # Load packages
  packages: !include_dir_named packages

a look into my package structure:

And one more thing:
Obviously I have an error in an automation… (which is basically located in my automations folder, but also sits in i.e. the irrigation package.
The error is:
ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: invalid template (TemplateSyntaxError: unexpected char "'" at 10) for dictionary value @ data['action'][1]['data_template']['value']. Got None. (See ?, line ?).

Any help would be greatly appreciated!
Cheers,

You are not the only one with this problem I got exactly the same errors…

To figure out which automation is giving you trouble start commenting them out, one after another, until the error goes away. The last one you commented out will contain the error. Then post that automation so someone can look at it for you.

Thanks for that hint… I went through all my automations (30!) and found the one, that messed up. Somehow I must have deleted a ’ ’ ’ char… :crazy_face: Now trying to figure out why my configuration does not load properly…

1 Like

I might start with the recorder definition as all the other problem areas listed depend on the recorder operating successfully.

Just on a side note, why are you even using packages? I doesn’t look very organized to me. Sorry, no offence. :slight_smile:

Packages should be a second way, to declutter your config, but if you use packages, you should use them more “in itself”. :slight_smile:

What you’re doing, is moving everything to a package file, that isn’t necessary and won’t work in your favor. :slight_smile: What you would like to do, is put things together and bundle up a nice package. Frenck btw doesn’t even use packages. :wink: And last but ot least, I’m quite sure, you don’t even use packages correctly, as iirc a package file needs to end with _package.yaml.

Right now you’re simply moving the files from the root directory to a subfolder called packages.

Why am I saying this: I get the feeling, you’re not familiar with splitting config files and use packages. Maybe it would help to get the idea behind package files and then start again, taking advantage of package files as intended.

If this sounds interesting to you, just let me know, so I’ll post my idea of using packages. :slight_smile:

2 Likes

Hi @paddy0174,
thanks for the hint … and I don’t feeling offended :wink: What @frenck is concerned: I just dived into a config that can be found in here: Frenck’s config sample which is probably not the one he still uses and adopted lot of that stuff… maybe based on older insights…
I just wanted to reduce the size of the configuration.yaml entries by moving the typical parts out of it and moved all of that stuff to my “packages” folder which is loaded automatically. Some of the files in there point to other folders in my config also there loading subsequent files and folders. But you are right, that some of those are quiet “dumb” and only reference a single config entry like “logbook:”… I started with the creation of the packages folder, because I integrated the irrigation implementation of @kloggy into my smarthome. This one for sure is a package with its own automations, scripts, etc..
So what would you recommend? Moving all those dumb parts back to configuration.yaml?

@micque: deleting the HA db which had grown to more than 2 GB helped me out - now everything works like a charm :slight_smile:

1 Like

The irrigation one is an example of a package. For your “base” configuration, I’d suggest splitting out the major domains into either their own file, or files within a folder. I have sensors and automations in separate files in subfolders, (via !include_dir_merge_list (docs)) with smaller domains such as binary_sensors currently in a single file:

# configuration.yaml
default_config:

group: !include groups.yaml
automation: !include automations.yaml
automation old: !include_dir_merge_list automations
calendar: !include calendar.yaml
script: !include scripts.yaml
camera: !include cameras.yaml
sensor: !include_dir_merge_list sensors
switch: !include switches.yaml
climate: !include climate.yaml
binary_sensor: !include binary_sensors.yaml
proximity: !include proximity.yaml
light: !include lights.yaml

# small entries like mqtt, recorder, media_player etc follow below...