Command_line switch not working - getting mapping values ar not allowed here

Hi,
im trying to send a message to a webserver via command_line switch.
Im getting the following Error:

(MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 110, column 13
here are the lines of code i’m using:

switch: 
  platform: command_line
  switches:
    door:
      command_on: "/usr/bin/curl -X GET http://192.168.0.66/open.php"

Have you got more than one switch statement? If you have just number them …

switch 25:

no, only one at the moment

Which line is it complaining about?

try like mine

    command_off: 'curl -k "http://localhost/action/frontgate.php"'

Hi, got it to work now. Seemed to be a problem with the name.

For anybody that finds this thread like I did, it definitely seems to be an issue with the naming.

This works:

switch 1:
  platform: command_line
  switches: 
    rokutv: 
      command_on: >-
        curl -d '' http://RokuTV-IP-Here:8060/keypress/PowerOn
      command_off: >-
        curl -d '' http://RokuTV-IP-Here:8060/keypress/PowerOff
      friendly_name: RokuTV

While this does not, due to the underscore:

switch 1:
  platform: command_line
  switches: 
    roku_tv: 
      command_on: >-
        curl -d '' http://RokuTV-IP-Here:8060/keypress/PowerOn
      command_off: >-
        curl -d '' http://RokuTV-IP-Here:8060/keypress/PowerOff
      friendly_name: RokuTV
1 Like