I’m rebuilding my Home Assistance instance from scratch (using a VM in VirtualBox) and want to split the configuration from the start.
I had an earlier attempt using packages as I like the idea of functional grouping so that I can have different integrations in one yaml file. But I deleted a test configuration a few months ago and now can’t get this to work. This is what I have done:
Split the original configuration.yaml that included everything into various yaml files
Created a folder /config/packages and moved the various yaml files into that folder; e.g. sensor.yaml
Added the following to the configuration.yaml file
sensor:
# Extract temp and humidity info from Xiaomi BLE sensors that connect to various ESP32s around the house
#
# Office sensor
- platform: mqtt
state_topic: "tele/tasmota_16CDAC/SENSOR"
name: "Office temperature"
unit_of_measurement: "°C"
value_template: "{{ value_json['ATC-34ef40']['Temperature'] }}"
When checking configuration.yaml I get the following error message
expected a dictionary for dictionary value @ data['packages']['sensor']
The content in sensor.yaml works with the same indentation in the original configuration.yaml so I have no idea where I go wrong. Firstly I 'd like to understand the error message and secondly how to resolve it
Yes, the sensor.yaml file is in the packages directory. Reading more on Packages - Home Assistant there’s a statement I don’t quite understand relating to
This uses the concept splitting the configuration and will include all files in a directory with the keys representing the filenames. A key should be followed by a value but where would I specify this value?
If you use !include_dir_merge_named then you have to remove the “sensor:” from your sensor.yaml. Not sure if this even works with packages as it wouldn’t make any sense.