Foscam GCI for automation

Hi!
Just found the cookbook exaple of using CGI to control Foscam cameras using HA. I have no experience at all so this is a question for someone that might have used it

I have a Foscam FI9826P in each room in the house. Its a PTZ model. According to the CGI manual it should be possible to control the cameras PTZ by sending the camera to a predefined position.
Could this be used together with a window sensor in HA? When the window sensor trigger, the camera moves to the position that cover that window and start recording?

Hope this make some sense for someone

Yes, as long as you have the cgi command that will work in your browser then you can create a shell-coomand to use in HA with that information. Then just call that command in your automation.

Thanks. Foscam has published all cgi commands that work for the different models. Ok will be interesting to learn a new thing