Rest command working but error in log?

Hello,

I defined a lot of virtual switches like this :

switch:
  - platform: command_line
    switches:
        spots_hallway:
          command_on: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3"
          command_off: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=1&EVT=3"
          friendly_name: "Lichten gang"
        spots_alllights_inside:
          command_on: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=7&CHA=10&EVT=3"
          command_off: curl "http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=7&CHA=11&EVT=3"
          friendly_name: "Lichten binnen"
...

Calling them via a button (or script) works fine :

  - type: button
    tap_action:
      action: call-service
      service: rest_command.spots_dimlightsliving
      service_data: {}
      target: {}
    show_state: false
    name: Spots
    show_name: false
    icon: mdi:light-recessed

But in the log I see these errors…

Schermafbeelding 2022-01-22 173029

Any idea ?

Your topic title is a little bit misleading. You are using the command line switch platform, not the rest switch platform (or rest command integration).

You could try this instead:

Could you elaborate a little…

I will start, even if it is wrong :wink:

#rest_command:
  spots_hallway_on:
    url: http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=0&EVT=3
  spots_hallway_off:
    url: http://192.168.1.3:80/postEvent.html?action=input&STM=0&MOD=5&CHA=1&EVT=3

In switch.yaml :

  - platform: command_line
    switches:
        lights_hallway:
          friendly_name: "Verlichting gang"
          turn_on: 
            service: rest_command.spots_hallway_on
          turn_off: 
            service: rest_command.spots_hallway_off

@tom_l Don’t forget me :wink: