Help with Command Line - HTTP Get Request to Phoenix Contact SPS

Hello together,
I am brand new with home assistant and I need some help to understand how it works.
As mentioned above i would like integrate my Phoenix Contact ILC SPS into Home Assistant. I did the same 5 years ago with IP Symcon and some PHP Scripts but now i want change to home assistant.
I think it should not be so complicated because you can easily change or read a value from the SPS with a simple HTTP Get Request.

HTTP Get Request to Read:

HTTP Get Request to Write:

Example Write:
This would switch on the Light “Couch”.

This would switch off the Light “Couch”.

This would read the actual status of the variable from the SPS.
This is important, because I could also switch the light On/OFF (change the status) with a real hardware push-button.

What would be the right way to switch the light ON/OFF and also get the actual status from the SPS? Is a command_line_switch the right way? How could i get the actual status and how can i set it to the switch in HA? Is it possible to use a template for the variable name, maybe i could use the name or the entity_id?

This is what i did in the configurations.yaml:

  - platform: command_line
        friendly_name: "Couch-Licht"
        command_on: curl -s
        command_off: curl -s

Wäre dies eine Lösung?

Many thanks for your response and time, I really appreciate this…

Best regards