and finally the error when i check the config. I know i am overengineering this splitting the config - but i have to understand how it works to enable me to make the right decisions later.
Invalid config for [input_datetime]:
expected dictionary for dictionary value @ data['input_datetime'].
Got
[
OrderedDict([('dark_mode_start', None), ('has_date', False), ('has_time', True), ('initial', '23:30:00')]),
OrderedDict([('dark_mode_end', None), ('has_date', False), ('has_time', True), ('initial', '07:00:00')])
]. (See ?, line ?).
Tried so many combinations of indents, hyphens, so over to you guys.
Worked a treat with no other changes. Thanks - really apprecaite the quick response. But how would i know this? It was the only thing i hadn’t tried. When do i use
It can be a bit confusing / overwhelming at first (it too me a while to get my head wrapped around it), but it depends on what you’re including and what you’re putting in the files. Just look at the examples on that page. After you study them a bit the light bulb should go on.
BTW, I tend to use packages. Much more flexible and allows you to group things more logically.
If the things being split out if left in the configuration.yaml are all divided up by a preceding hyphen (-) for each entry then you use the “_list” variant. If they are divided up as each item without a hyphen you use the “_named” variant.
examples of “_list” items are automation, sensor & switch
examples of “_named” items are group, script & shell_command
I use a combination of !includes & packages because it makes the most logical sense to me and allows me to use packages in the way they were originally intended - by allowing you to group different domains that are used in a “system” into a single file. Like if you have an “alarm system” that uses automations, scripts, booleans, switches, lights, etc you can group all of those things within the package so you don’t need to open multiple files to modify them. And still helps you to break up your config into more manageable bite sized pieces.
If there are things that aren’t part of a larger logical “system” then I just use different includes.
And for one-off things (like life360, zwave, zigbee, mqtt, etc) that only require a single instance in the config then I just leave all of those in the main configuration.yaml file.