V6 recall PTZ preset through http

petecam
edited March 2024 in General

I am trying to recall PTZ presets from one of my cameras through http...

basically I have a few buttons programmed in home assistant, and each button sends a http command to securityspy, which than recalls the corresponding preset.

This used to work prior to version 6, but I think the syntax has changed, and I can't get it to work anymore.

I used the URL Generator command to get the auth key, and pasted together a URL that I found in the manual :

http://10.0.1.10:8000/ptz/command?cameraNum=3&command=14&auth=<long auth key here>

but it does not seem to work. When I paste the above url in safari, I am redirected to the login screen.

If I however use this URL : http://10.0.1.10:8000/video?cameraNum=3&auth=<auth key>, it displays the camera feed fine...

So I'm doing something wrong, can anybody help ?

Comments

  • The long auth keys generated by the "URL Generator" are only good for the specific URL that they are attached to. You can't take this auth key from one URL and plug it into another - it won't work. This is an intentional design decision to make these keys as secure as possible, restricting access to one specific resource only.

    However, there is another way to provide an "auth" parameter that is less secure (because it actually encodes the username and password into the URL), but it will work for your purposes. This is described in the "Authentication in URL" section of the Web Sever Specification document. Basically, it's the Base64 representation of the string "username:password" without the quotes.

  • Thanks, that worked perfectly !