Is it possible to call a service with service data in a command line swtich?

wake_on_lan:  

switch:
  - platform: command_line
    switches:
     noah_computer:
      command_on: wake_on_lan.send_magic_packet
        data:
          mac: "78-24-AF-8F-9D-57"
      command_off: "/usr/bin/curl -X GET http://192.168.3.170:7760/suspend"  

I am unable to call an define the wake_on_lan.send_magic_packet service. It works in the service developer tool, but unable to validate the configuration.

Error loading /config/configuration.yaml: mapping values are not allowed here
  in "/config/configuration.yaml", line 92, column 13

The commands must be shell commands. However, you could use the curl to call the api to run the service .

Thanks! That worked!

1 Like