I have some sensors and i tried to move them into a separate command_line.yaml, using
command_line: !include command_line.yaml
The file contains:
- sensor:
command: curl --silent http://192.168.99.197/statusvars.js | awk -F \; '{print $6}' | cut -d '=' -f2 | sed "s@'@@g"
name: Helialux Profile
unique_id: helialux_profile
- sensor:
command: curl --silent http://192.168.99.197/statusvars.js | awk -F \; '{print $10}' | cut -d '=' -f2 | cut -d ',' -f1 | sed "s@\[@@g" | sed "s@\]@@g"
name: Helialux White
unique_id: helialux_white
unit_of_measurement: "%"
- sensor:
command: curl --silent http://192.168.99.197/statusvars.js | awk -F \; '{print $10}' | cut -d '=' -f2 | cut -d ',' -f4 | sed "s@\[@@g" | sed "s@\]@@g"
name: Helialux Red
unique_id: helialux_red
unit_of_measurement: "%"
- sensor:
command: curl --silent http://192.168.99.197/statusvars.js | awk -F \; '{print $10}' | cut -d '=' -f2 | cut -d ',' -f3 | sed "s@\[@@g" | sed "s@\]@@g"
name: Helialux Green
unique_id: helialux_green
unit_of_measurement: "%"
- sensor:
command: curl --silent http://192.168.99.197/statusvars.js | awk -F \; '{print $10}' | cut -d '=' -f2 | cut -d ',' -f2 | sed "s@\[@@g" | sed "s@\]@@g"
name: Helialux Blue
unique_id: helialux_blue
unit_of_measurement: "%"
But iam getting the following error:
Invalid config for [command_line]: expected a dictionary for dictionary value @ data['command_line'][0]['sensor']. Got None
extra keys not allowed @ data['command_line'][0]['command']. Got 'curl --silent http://192.168.99.197/statusvars.js | awk -F \\; \'{print $6}\' | cut -d \'=\' -f2 | sed "s@\'@@g"'
extra keys not allowed @ data['command_line'][0]['name']. Got 'Helialux Profile'
extra keys not allowed @ data['command_line'][0]['unique_id']. Got 'helialux_profile'. (See /config/configuration.yaml, line 16).
According to the docs, it seesm to be fine (example):
command_line:
- sensor:
command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
name: HA release