Other type of virtual switch?

I defined several 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: "Verlichting gang"

Now, I have to define other virtual switches but where command_on en command_off are in fact the same. So it is not really a switch but more a button.

Does another type of virtual switch exist or do I stay with the same definitions (with same command_on and command_off)?

Maybe you want a button then?

Yes, but how do I have to define this ?

Or maybe I have to switch to rest command, but it is not clear for me how to do this.

I define this in my configuration file (and restart HA)

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

How do I call this in my button ?
Sorry, it’s all new for me…

Found it, put it in a script :slight_smile: