I have a PTZ cam on my front door with position presets set up.
Normally the cam position is set to watch over the porch area. I want the cam to move to the door view whenever this door is opened. This door has a sensor for my Elk alarm panel.
So when this sensor is tripped, the cam should move to the preset viewing the door. When the door sensor is reset, after 2 minutes it should go back to the porch view.
I suppose I should create a scene and add a luup statement to set position 1 (door) upon the sensor trip. Then move back to position 5 (porch). Assuming this is the best way, I need help to make this luup statement. I do not know how to write it.
Can someone help me with this statement? Or is there a better way to do this?
Anyone providing help would need to know what type of camera(make/model) you are using.
Also, do you know how to control the camera manually. For example, is there a URL that you can enter to cause the camera to go to the desired preset, or can it only be controlled via a proprietary app form the manufacturer?
This is an IPUX ICS 2330 cam. I also run BI and via it’s GUI I can PT and go to presets. In Vera I use the Generic cam plugin and modifies a Dlink cam xml file so in Vera I have PT functions working. But no presets.
I am not aware of a URL call to control presets with this cam. I don;t have a cgi command list for this cam either.
I can also use IP CAM Pro on my iPad to view, and control PT and presets. On my Android, I use the BI client which also gives controls fine.
You’ll need to find the direct url call to set the preset on the camera or via BI. Than you can either modify the xml file or use a scene to call the preset.
function HTTPGet(URL)
local status, result = luup.inet.wget(URL, 3)
end
HTTPGet("http://192.168.122.xxx:xxx/cgi/admin/ptctrl.cgi?action=move&Cmd=Position1")
Optional - Create trigger for scene X (i.e. motion detector 1 is tripped). Otherwise, you need to run the scene manually.
First, thank you much, AgileHumor, for working with me on this.
I did exactly as you posted and manually ran the scene. Still no cam movement. If I put this into Test Luup code, it runs and comes back Message sent successfully. But still no movement. Again, it does work instantly when done in a browser (Chrome).