I have Foscam FI9826P camera with PTZ function connected to my vera edge UI7 (latest update) with Foscam HD app. I positioned my camera so I can see my front door as well as door which leads to my garden.
In foscam I’m able to set the preset, in my case the preset 6 means camera positions it self to watch the front door and the preset 7 positions camera to monitor the garden door.
Both doors have fibaro door sensors.
So this is what I would like achieve:
When front door is opened send command to my camera to go to preset 6 and start recording.(camera will turn to left)
When garden door is opened send command to my camera to go to preset 7 and start recording.(camera will turn to right )
Any ideas how is this could be accomplished? I believe this will involve some coding and I’m really struggling with it…
I have this code in a scene that is run when the back door opens in a non-home mode…
local status, result = luup.inet.wget(‘http://[camera_ip]:[camera_port]/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=BackDoor&usr=[user_name]&pwd=[user_password]’)
My preset is just named ‘BackDoor’ - you’ll need to change that value to whatever you named yours (from the sound of it, 7, but you can use more descriptive names in the web interface)
You’ll also need to change the camera_ip and port values to fit your camera.
I use the code to look at the doors if anything gets tripped, as it can see the front and back door from where it sits. I also have a ‘TopMost’ preset that I send the camera to when we’re home, so it’s not sitting there staring at us when it doesn’t need to be.
just tried your code, changed the IP Port added my username and pswd, specified the preset name but for some reason nothing happens, below in red is what i have changed.
I have tried to run code manually in “Test Luup code (Lua)” as well as in a scene but specified to run in any mode instead of only away but still nothing happens.
local status, result = luup.inet.wget('http://[[glow=red,2,300]camera_ip[/glow]]:[[glow=red,2,300]camera_port[/glow]]/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=[glow=red,2,300]BackDoor[/glow]&usr=[[glow=red,2,300]user_name[/glow]]&pwd=[[glow=red,2,300]user_password[/glow]]')
Am I doing something wrong? Any ideas why it is not working?
Also just to clarify my camera is connected through wifi, but i assume this shouldn’t make any difference.
Excellent works like a charm. Thank you very much for your help, I new it is something stupid that I have missed.
Last question, how about the Zoom in and Zoom out function is this something we can control through vera? If so, would you be so kind to post a code for that as well.
There are some other commands that allow you to set the zoom speed and stop the zooming, which presumably would allow you to set the zoom speed to slow, tell the camera to start zooming in, then after X number of milliseconds, tell the thing to stop. That’s beyond the scope of my experience, but something you can experiment with if you want.
I got the FI9826P aswell and got it to work in my Vera Edge
I used the files:
device_file = D_DigitalSecurityCamera2.xml
device_json = D_DigitalSecurityCamera2.json
And I got picture Yeah but when i use the code:
local status, result = luup.inet.wget('http://xxx.xxx.x.xxx:xx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Achterdeur&usr=[Username]&pwd=[password]')
in the Advanced Editor and save the scene the I get an Error in lua for scenes and events and it does not work.
How did you guys got this to work.
I’m also looking for a code/scene to turn the cam towards the frontdoor or backdoor when trigger a or b is triggert. Please help me to get this to work.
[quote=“Totalremote, post:7, topic:189687”]And I got picture Yeah but when i use the code:
local status, result = luup.inet.wget('http://xxx.xxx.x.xxx:xx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Achterdeur&usr=[Username]&pwd=[password]')
Are you including the [] in the code? I just used those as placeholders. Assuming your username was user1 and your password was abc123, the code should look like this:
local status, result = luup.inet.wget('http://xxx.xxx.x.xxx:xx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Achterdeur&usr=user1&pwd=abc123')
As for your code/scene, you’ll want to set it up as a scene based on an event (e.g., front door opening, back door opening), then include the above wget call to the camera to tell it which preset point to go to in the scene’s luup code definition area.
[quote=“ceefin”][quote=“Totalremote, post:7, topic:189687”]And I got picture Yeah but when i use the code:
local status, result = luup.inet.wget('http://xxx.xxx.x.xxx:xx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Achterdeur&usr=[Username]&pwd=[password]')
Are you including the [] in the code? I just used those as placeholders. Assuming your username was user1 and your password was abc123, the code should look like this:
local status, result = luup.inet.wget('http://xxx.xxx.x.xxx:xx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Achterdeur&usr=user1&pwd=abc123')
As for your code/scene, you’ll want to set it up as a scene based on an event (e.g., front door opening, back door opening), then include the above wget call to the camera to tell it which preset point to go to in the scene’s luup code definition area.
Hope that helps![/quote]
I did not use de [ ] in the code.
I got an scene set up where a sensor triggers when opening a door
Then as action the cam takes a picture
And finisch the scene with a luup code like this code.
But nothing . No motion
I got all the code right including the right IP, port, username and password. and no I’m not offended I now how easy this mistakes are made
But still not luck, also now the app FoscamHD keeps hanging. In the blue line on the top of the screen the text FoscamHD : Starting up… is not starting right.
So mabye that’s the thing. of the Vera Support it is thne
Same here.
Same UI7 from january and foscamHD app 1.1 and yes also got a video feed through the vera interface. Asked vera support to remove the foscamHD app because this keeps running although I removed the app. Strange thing.
Also, did you followed the below instructions after installing the Foscam HD app to vera?
Foscam HD Camera Plugin
This plugin adds support for pan, tilt and presets. This plugin is suitable for all the HD cameras, including FI9821W, FI9818W, FI9801W, FI9802W and FI9805W.
Install your camera manually selecting “Other Ip Camera” and introduce the following URL when requested :
CAMERA_IP/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=YOUR_USERNAME&pwd=YOUR_PASSWORD
Wait for the camera to be added;
Instal the plugin;
In “Advance settings” add “I_FoscamHD.xml” in “impl_file” input field;
Reload LuaUPnP engine.
Yes did it.
I’m beginning to think mabye it’s the firmware of the ip cam. It’s been 5 months sinds you got it to work. Can you tell me your firmware version of the cam please.
Got it to work
First total reset of the cam then made an 2nd user in de cam with operator rights.
Also activated the vera wifi network and connected the cam on that network instead of the home wifi network.
Now the luup code works fine.
2 sensors - front/backdoor - makes the cam turn towards the doors when tripped. Thanks fot the help.
Maurice @ www.totalremote.nl
Best Home Automation shopping experience. Shop at Ezlo!