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

I just set this up with my Foscam 8918. I can get a live feed in the ST app, but the “Take” button turns blue when I press it and never seems to actually take a snapshot. The “on” button remains greyed out at all times until i click it, when it turns into a “…”. Additionally, none of the pan/tilt controls seem to work. I have rebooted the camera, and I am confident the credentials are valid given the live stream. Any help would be appreciated.

Your camera is having trouble communicating with the hub ina timely fashion so the commands are being dropped. This could be a network issue or hub or camera issue. Reboot all three and try it. Use a LAN IP to start before moving to public

I added the device handler, created my device per your instructions, opened the device on my app and edited it to add the IP/ports/username/password, etc, but it keeps saying I haven’t filled out all the required fields, even though I have. All fields are filled out, and it’s not telling me what field isn’t filled out. So essentially it’s useless so far. How am I supposed to know what it is that it doesn’t like? It’s not highlighting anything in red.

Ok, so I found buried in the thread to set port to 080 to get it save settings. Ok. Now I get ‘camera unavailable’ when trying to connect. Port/IP are set correctly, etc. These are INSTEON HD Cameras which are just rebranded Foscam’s.

1 Like

I checked the device in my smartthings web panel and saw it had a deviceid of null. I recreated the device with id 2000, but it is still exhibiting the same behavior. My camera and hub are on the same lan, and the camera has a strong wireless connection. The Smartthings panel reports a status of ACTIVE, but the device shows OFF in the ST app. Thanks for the help.

Make sure your on the latest DH code.

I just replaced my aging 9831W with a new Foscam R2 and have had a b**** of a time getting the arming/disarming of the camera working. All other features of the camera are working fine. I changed the IP/Port, ensured port forwarding, like I say, everything is working EXCEPT arming and disarming the camera. Works fine in the Foscam APP. There appears to be an issue with CGI code for the Foscam R2. Whenever the following command is run it causes an error (confirmed in a browser as well):

http://XXX.XXX.XXX:88XX/cgi-bin/CGIProxy.fcgi?usr=XXXX&pwd=XXXXXX&cmd=setMotionDetectConfig&isEnable=0
error Camera responded with result -3 -> Access denied

Other commands work perfectly, IE:

http://XXX.XXX.XXX:88XX/cgi-bin/CGIProxy.fcgi?usr=XXXX&pwd=XXXXXX&cmd=getInfraLedConfig
info Polled: LED On

I changed the following lines in your DH to get it working. Not sure if this is a bug with the R2 or what the issue is.

Lines 544 & 555:

From:
delayBetween([hubGet("cmd=setMotionDetectConfig
To:
delayBetween([hubGet("cmd=setMotionDetectConfig1

After making these changes I can now arm/disarm my camera. I am not sure if this is a bug in the firmware where the “1” is needed or this is the new command on newer models? I got details from here: http://www.developerdan.com/foscam-client/Foscam.html#getMotionDetectConfig1

Thanks

In addition to the motion alarm enable/disable issue, the R2’s have a number of additional features that get overwritten whenever the camera is enabled/disabled in the ST app.

1- Sound detection

The R2 has 5 different sound sensitivity levels (same as motion), Lowest, Lower, Low, Medium, High. If I change these in the official Foscam app, they are defaulted to “Low” whenever I enable the camera in ST. Could we have options to control the Sensitivity in the DH the same as motion?

2- Push Notifications

The R2 also has the ability to send push notifications in the official app (or by accessing the camera web interface). The Push notification “checkbox” is always removed whenever I enable the camera via ST. Could this be ignored in the DH or have the option to enable/disable in the settings?

Appreciate the amazing work you’ve done for those of us using Foscam cameras and hope these suggestions will be considered (especially sound since the HVAC unit turning on/off sets off a sound alarm. This R2 is crazy sensitive to noise).

Thanks again

1 Like

My camera keeps disconnecting when going to a preset or trying to PTZ the camera within ST. If no movement, camera works fine, but any movement in camera will disconnect the video. Any solutions?

Will keep in the pipeline for R2 specific customizations. In general Foscam audio are VERY sensitive. By default the DH sets the audio sensitivity to lowest because of this issue.

Thanks it appears on my R2, it defaults to “Low” (the default) which probably explains the sensitivity although the 9831W shows “Lowest” like you mentioned. Based on update notes from other iOS apps, developers mention "Fixed motion on/off for Foscam Ambarella devices (R2 and C2) so it appears the C2 is also affected but I cannot confirm as I do not have this model.

Thanks again

1 Like

Edit Xtrophy found this first too

I have finally figure out my Alarm arm/disarm issue with my C2 and FI9900P. I’m betting it works with all the camera’s having issues too.

At some point Foscam changed the commands from

cmd=setMotionDetectConfig&isEnable=0

to

cmd=setMotionDetectConfig1&isEnable=0

i edited the device handler for the misbehaving cameras and everything works again

edit 1: of course now the motion detection doesn’t work at all. Smart thing shows the switch as enabled but it does nothing. I have a feeling that they also changed the detection area command as well.

edit2: It has something to do with the dection areas being cleared when the detector is toggled.

/cgi-bin/CGIProxy.fcgi?usr=USERi&pwd=PASS&cmd=setMotionDetectConfig1&isEnable=1&snapInterval=1&sensitivity=3&linkage=14&triggerInterval=10&schedule0=281474976710655&schedule1=281474976710655&schedule2=281474976710655&schedule3=281474976710655&schedule4=281474976710655&schedule5=281474976710655&schedule6=281474976710655&x1=2000&y1=2000&width1=5000&height1=7000&threshold1=52254&sensitivity1=30396&valid1=0

Sets a detection block but it doesn’t enable it.

EDIT3

&valid1=1

enables the motion detection zone

EDIT$

Here is the code to automatically set the full frame as a detection zone

/cgi-bin/CGIProxy.fcgi?usr=USERi&pwd=PASS&cmd=setMotionDetectConfig1&isEnable=1&snapInterval=1&sensitivity=3&linkage=14&triggerInterval=0&schedule0=281474976710655&schedule1=281474976710655&schedule2=281474976710655&schedule3=281474976710655&schedule4=281474976710655&schedule5=281474976710655&schedule6=281474976710655&x1=0&y1=0&width1=10000&height1=10000&threshold1=0&sensitivity1=1&valid1=1&x2=0&y2=0&width2=0&height2=0&threshold2=0&sensitivity2=0&valid2=0&x3=0&y3=0&width3=0&height3=0&threshold3=0&sensitivity3=0&valid3=0

2 Likes

So some folks have been asking how to configure the motion detection area and enter that string in the camera settings page. So here’s are the instructions:






I got this reply from Foscam support:

Hi Xtropy, Amba S2L cameras like R2 has different CGI command than with FI9831W. Please use the correct command (setMotionDetectConfig1)

I’m working on connecting a Foscam F19821 camera using your Foscam device handler.

I’m able to connect to the cam both over my local network and remotely via port forwarding in a browser. I’ve setup port 88 for http and 8888 for https. I’ve forwarded all 3 ports, 88, 8888, and 888 (Onvif) to the camera.

In the Camera configuration in, I’m starting off with the internal ip address and port 88 but I’m getting camera not found.

Am I missing something?

[edit] Interesting development…I can snap pictures from both internal an external and they display in my client properly. It can also detect motion. th eonly thing I can do is see the live feed.

Thanks,

  • Marc

Have you found the area in RBoy’s code to change to fix this issue? I didn’t realise that the setMotionDetectConfig1 fixed the switch but didn’t actually enable motion detection. Would really like to get this corrected and wondering if you could advise the lines of code we need to change to fix this issue?

Figured it out. If you add the following information to line 544, things start working again:

cmd=setMotionDetectConfig 1&isEnable=1&valid1=1&width1=10000&height1=10000

Also in the same line change the setAudioAlarmConfig &sensitivity value from 0 to 4 to put the sound alarm to the lowest value

Now I have Motion working and my sound alarms are not going off every hour.

For reference the GetMotionDetectConfig1 values for the R2 are:

<CGI_Result>
    <result>0</result>
    <isEnable>1</isEnable>
    <linkage>8</linkage>
    <snapInterval>1</snapInterval>
    <triggerInterval>10</triggerInterval>
    <isMovAlarmEnable>1</isMovAlarmEnable>
    <isPirAlarmEnable>0</isPirAlarmEnable>
    <schedule0>281474976710655</schedule0>
    <schedule1>281474976710655</schedule1>
    <schedule2>281474976710655</schedule2>
    <schedule3>281474976710655</schedule3>
    <schedule4>281474976710655</schedule4>
    <schedule5>281474976710655</schedule5>
    <schedule6>281474976710655</schedule6>
    <x1>0</x1>
    <y1>0</y1>
    <width1>0</width1>
    <height1>0</height1>
    <threshold1>0</threshold1>
    <sensitivity1>0</sensitivity1>
    <valid1>1</valid1>
    <x2>0</x2>
    <y2>0</y2>
    <width2>0</width2>
    <height2>0</height2>
    <threshold2>0</threshold2>
    <sensitivity2>0</sensitivity2>
    <valid2>0</valid2>
    <x3>0</x3>
    <y3>0</y3>
    <width3>0</width3>
    <height3>0</height3>
    <threshold3>0</threshold3>
    <sensitivity3>0</sensitivity3>
    <valid3>0</valid3>
</CGI_Result>

Whereas for the 9831W there are a lot less:

<CGI_Result>
    <result>0</result>
    <isEnable>1</isEnable>
    <linkage>8</linkage>
    <snapInterval>1</snapInterval>
    <sensitivity>0</sensitivity>
    <triggerInterval>10</triggerInterval>
    <schedule0>281474976710655</schedule0>
    <schedule1>281474976710655</schedule1>
    <schedule2>281474976710655</schedule2>
    <schedule3>281474976710655</schedule3>
    <schedule4>281474976710655</schedule4>
    <schedule5>281474976710655</schedule5>
    <schedule6>281474976710655</schedule6>
    <area0>1023</area0>
    <area1>1023</area1>
    <area2>1023</area2>
    <area3>1023</area3>
    <area4>1023</area4>
    <area5>1023</area5>
    <area6>1023</area6>
    <area7>1023</area7>
    <area8>1023</area8>
    <area9>1023</area9>
</CGI_Result>

Probably take a while to get all this setup/working in the DTH so wanted to post a workaround for now

1 Like

Thanks, will build it into the next release. Am also working with Foscam to get the latest changes to the SDK.

Hi, is the live ST feed working for your 9900p? I can’t get my live feed to work but I’m able to take snapshots and receive motion detection alerts.

Yeah, live video works for me