HomAut
August 8, 2019, 8:36am
1
My configuration.yaml
switch: !include_dir_named switches
in the directory switches I have switching.yaml
- platform: command_line
switches:
myswitch:
command_on: "gpio -1 22 write 0"
command_off: "gpio -1 22 write 1"
command_state: "gpio -1 22 read"
The config_check gives me an error
Invalid config for [switch]: required key not provided @ data['platform']. Got None. (See /var/lib/hass/configuration.yaml, line 25)
I saw some inconsistency on the
The first sentence uses a minus in front of platform, but the following examples are not having that.
The question is
What it should be the correct formatting for a dir_named structure.
VDRainer
(🍻)
August 8, 2019, 8:55am
2
Not sure, but i think with dir_named , the filename is used for the entity.
I’d prefer packages
configuration.yaml
homeassistant:
...
# Packages
packages: !include_dir_named packages
Then, in the packages folder you can create your yaml files like
sensor:
...
switch:
...
automation:
...
IMO the best way to keep track of your config.
HomAut
August 8, 2019, 11:06am
3
I fully agreed with you. Today I accidentally delete all files. By packages is also much simpler to maintain.
HomAut
August 16, 2019, 12:13pm
4
A bit bumping the question. I was away for a week and I couldn’t find a solution. Meanwhile I had an upgrade to 0.97.4 and the configuration testing is not appearing as before.