[OBSOLETE] Foscam Camera Device Handler Universal DTH with Motion Detection - SD (FI89xx), HD Ambarella FI98xx, FI99xx, Cx, Gx, Rx, Ex, Zx, Fosbaby

Sweet Jody & @RBoy first time I’ve ever gotten my foscam to work.

great you have @jody.albritton to thank for finding this bug

@RBoy What Foscam camera model are you guys using ? Also, is the operation reliable for commercial deployment? For a local business for example?

9821V2. It really comes down to how it works with your setup. I use it as part of a security system to arm/disarm the camera at scene’s and on events and it works reliably for me. But then again it depends upon what feature you’re using and how your setup works. As @jody.albritton pointed out there are bugs in the system which causes issues for some folks depending upon your configuration, handset, OS etc.
I don’t rely on the screenshot (even thought it works for me 90%+ of the times, sometimes it timesout) but mostly rely on the monitoring arm/disarm features to start recording, taking pictures etc. I’ve never had a single issue with that functionality. You can @jody.albritton base code and see how stable the communication is for you.

@RBoy Thanks. If i configure the camera to take pics whenever a door is open…then where will the pics be saved??how do i access them ??

Well it depends on how you configure it. This is the way my modified code works is with the following options:

  1. Turn on the Camera Switch or Alarm Mode activate the motion detection feature on the camera. You can configure the camera to take a picture, record a video and send eMail when motion is detected through the preferences. In this case the picture, video etc will be stored based on the camera was initially configured through it’s web interface (SD card or FTP)
  2. If you’re activate the “take picture” command directly through the UI or activate the Alarm “Strobe” through smartapp it will take a picture and show it on your ST app (again I see a 90% success rate here depending upon the connection and platform stability). If you activate strobe in addition to taking the picture it will also activate the motion detection on the camera. Now again if the camera was configured initially to save the picture to a FTP or SD card the picture will be stored there in addition to showing up on the ST app. To me saving it to the FTP or SD card is fail safe option and I always enable it.

@RBoy I got my Foscam today and integrated it with SmartThings… Thank You… I noticed that the drop cam smart app for triggering snapshots works , but is not very reliable . Is it expected to be more reliable using your smart app (will be testing tonight)? Secondly, is there an option to record video upon a trigger and save the video file somewhere which can be accessed later? (ex: when door opens). Lastly, @625alex do you think we can have a pan button on the Action Dashboard - which will trigger the camera to pan for one cycle and stop? . Your help is appreciated…

This is doable if you create a set of virtual momentary switches and associated smart app that would move your camera based on these switches. Then you can add the virtual switches to the dashboard.

As a feature, camera tilts would be weird because it is not a supported or universal capability.

1 Like

That’s a really neat idea @625alex. and I guess by positioning them correctly on the dashboard it could emulate the 4 way buttons. I guess similarly one could use the virual switches to activate cruise also (you can anyways activate alarm monitoring using the alarm interface).

If you want to go all the way, you should also be able to change icons via CSS into direction arrows. I will be doing that for my TV controls.

Im using a Foscam 18910W with internal IP. I installed the code and entered in the info. Nothing is happening. No preview. No image if I say take picture. Any button I hit doesn’t respond. Any suggestions?

@625alex Thanks for the suggestion. I think I am going to have one button for now to activate cruise…That way I can get a glimpse of the entire area, if I want to… @RBoy I still have to try your smart app. But did you get a chance to evaluate whether we can initiate a video recording on the Foscam for lets say 60 seconds, when an event occurs…I think it will be a useful feature to have…

@RBoy Can you please tell me what would the command in the smartapp be to activate the camera patrol…? I was going through the device type… But wasn’t able to determine that… would it be camera.cruisemap1() to start cruise and then camera.stopcruise() to stop it …or something else? Thanks!

yes that’s correct @ashutosh1982 and assuming that you’ve configured cruisemap1 to your desired cruise in preferences.

As for video recording, yes it should work - there’s an option in preferences to enable video recording while motion detection is on.

@OMFGitsJUSTIN check the live logging in the IDE and post what you see for the foscam when you press a button.

12:57:45 AM EST: debug /cgi-bin/CGIProxy.fcgi?usr=&pwd=&cmd=snapPicture2
12:57:45 AM EST: debug Executing hubaction on 192.168.1.11:1234
12:57:45 AM EST: debug Device Network Id set to c0a8010b:0a2f
12:57:45 AM EST: debug Taking Photo
12:57:30 AM EST: debug /cgi-bin/CGIProxy.fcgi?usr=
*****&pwd=*********&cmd=setMotionDetectConfig&isEnable=1
12:57:30 AM EST: debug Executing hubaction on 192.168.1.11:1234

Thanks @625alex and @RBoy … I made a smart app that uses a virtual switch to move between two Preset values - Preset 1 is one extreme and Preset 2 is other extreme of the pan range… When I turn the switch on then the camera pans to preset1 (which is to left) and when i turn the switch off it pans to preset 2 (which is to the right) - This way I am also able to limit the range of panning in Foscam (since it does not support a range in degree of motion)… Its working great…And I have this virtual switch right next to the camera on the Action Dashboard…and direction of the switch matches the direction of the pan…which is cool… Its really easy for me to have a quick check if I want to…it gives a complete view of my house in few seconds…!!! and i can switch between viewing my front door vs my patio door , with the same camera… Alternately, I can trigger the camera to point to a certain door if there is an event on that door…then take pictures or record video…

@RBoy I am unable to find commands to record video on the device type…can you please provide some guidance? Should I use the alarmOn() command? and then configure the foscam to record video on alarm? I may be answering my own question, but there is no harm in getting a second confirmation :smile:

1 Like

That is correct @ashutosh1982, you use the alarmOn() to activate the motion detection which will automatically start recording BUT you have to enable video recording in the references first. I’m assuming you are using the modified code on my server.

I see you’ve used port 1234 in your configuration - have your configured your camera to use port 1234 also? I don’t see your camera responding so it’s likely a communication issue

its a different port but I changed it for security reasons. So the port really isn’t 1234. Its a different number.