Camera buttons with command url

Hi all,

This is my first post so be gentle…

I have an old camera that streams to the home assistant. It was pretty easy to set up:

yaml:

camera:
  - platform: mjpeg
    name: Garage
    still_image_url: http://10.152.1.12/snapshot.cgi?user=LOGIN&pwd=PWD
    mjpeg_url: http://10.152.1.12/videostream.cgi?rate=0&user=LOGIN&pwd=PWD
    verify_ssl: false

And than i wanted the up down left right button. I found a post on Foscam This looked very promesing…

Only problem i dit not know how to integrate it with my system. I found out that i can control the cam with switches. I just added the switch commmand_line like this:

yaml:

switch:
platform: command_line
  switches:
    garage_motion:
       command_on: 'curl -k --tls-max 1.2 "http://10.152.1.12/decoder_control.cgi?command=2&user=LOGIN&pwd=PWD"'
       command_off: 'curl -k --tls-max 1.2 "http://10.152.1.12/decoder_control.cgi?command=1&user=LOGIN&pwd=PWD"'

This is only the UP button for the other movements i only need to change the number next to command=

The number 2 is up and the number 1 stops the movement.

Is there somebody that can help me with this challenge?