My configurtation.yaml looks like this:
[much stuff cutted out]
switch: !include ulink-switches.yaml
- platform: mqtt
name: "ca-remote-rs-tx"
state_topic: "home/ca-remote/rs-tx"
command_topic: "home/ca-remote"
qos: 0
payload_on: "online"
payload_off: "offline"
ulink-switches.yaml’s content is:
- platform: mqtt
name: "ulink-living-shutdownbutton-shutdown"
state_topic: "home/living/ulink-shutdownbutton/state0"
command_topic: "home/living/ulink-shutdownbutton"
qos: 0
payload_on: "on"
payload_off: "off"
retain: true
You see I want to include my external config file ulink-switches.yaml in the component section “switch:”. I want to include the specified file and after this I want to define some more switches.
This does not work:
Sep 9 13:23:19 homeautomation hass[8907]: #033[31m2017-09-09 13:23:19 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
Sep 9 13:23:19 homeautomation hass[8907]: in “/home/pi/.homeassistant/configuration.yaml”, line 159, column 12#033[0m
Sep 9 13:23:19 homeautomation hass[8907]: #033[31m2017-09-09 13:23:19 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/pi/.homeassistant/configuration.yaml: mapping values are not allowed here
Sep 9 13:23:19 homeautomation hass[8907]: in “/home/pi/.homeassistant/configuration.yaml”, line 159, column 12#033[0m
Sep 9 13:23:19 homeautomation hass[8907]: Config directory: /home/pi/.homeassistant
I tried it this way too:
switch:
!include ulink-switches.yaml
- platform: mqtt
name: "ca-remote-rs-tx"
state_topic: "home/ca-remote/rs-tx"
command_topic: "home/ca-remote"
qos: 0
payload_on: "online"
payload_off: "offline"
There is an additional newline after “switch:”. Here, home assistant tells me “could not find expected ‘:’”.
It’s my understanding that home assistant includes the external file as it is at the position where !include stands. Home Assistant tells me “mapping values are not allowed here”.
Is it possible at all to include my config file this way? Is there some one to show me the right way?
Thanks for helping me!