Camera Pan and Tilt

Hello, I am new to coding and Openhab as well.

I am trying to control my Foscam ip camera from Openhab, but no success so far. IP camera has a SDK it says the formation rule to control it as it goes:

value / description
0 / up
1 / Stop up
2 / down
3 / Stop down
4 / left
5 / Stop left
6 / right
7 / Stop right

I created a camcontrol.items such as (only up command for example purpose):

Switch up "Up" { http=">[ON:POST:http://<mycameraip>/decoder_control.cgi?command=0&user=admin&pwd="] }

And sitemap such as:

Switch item=up

Though, I am not sure if this is the right way to do it. Maybe I should use Setpoint instead of the Switch? So far, I had no success controling it.

Has anybody tried that?
Thanks in advance!

I know this is an old post, but I wanted to do exactly the same thing with what is probably the same or similar camera, and I just succeeded.
You were very close to the solution; you just need to add basic HTTP authentication and you are done. You can also remove the user and pwd parameter from the request as they serve no purpose in this case.
So a Switch item would look like:

Switch camUp "Up" { http=">[ON:POST:{Authorization=Basic dXNlcjpwYXNzd29yZA==}] >[OFF:POST:{Authorization=Basic dXNlcjpwYXNzd29yZA==}]" }

I dont think you can use a Setpoint because the camera pans until a stop command is issued; you can’t just tell it to pan until a desired position.

Hope this helps.