Foscam HD plugin

Hi Ian
I am using a Vera 3

Hi Andrei
I checked to implementation file in Firefox and Chrome and the live view does not display.

:slight_smile: It works perfectly in Internet Explorer.

Regards
Tom

I will check try this again tonight. I have using the Foscam98HD plugin, which with the exception of presets and motion sensing, works.

Tomvan,
Would you be able to explain how you got the motion sensors to work?

Hey Andrei,
The plugin seems to work well for me. The pan/title and presets all appear to work. I am noticing that sometimes, the image fails to load though (broken image link.) Not sure why this is happening (It happens on the Live view and thumbnail pages.)

Whenever I goto Recorded, I see the following:
You must log in before you can view the camera records. Login

Hi Randmness,

I’m seeing the same issue with the error telling me to login to see recorded events.

if you look on the left hand side where it normally says ‘log out’ it actually says ‘login’. if you select that, and login to your portal, it will allow you to see the recorded events.

hope that helps,

ian

[quote=“Randmness, post:43, topic:185859”]I will check try this again tonight. I have using the Foscam98HD plugin, which with the exception of presets and motion sensing, works.

Tomvan,
Would you be able to explain how you got the motion sensors to work?[/quote]

Hi Randmness
I use the following command from the Foscam SDK:
http://cameraIP:port//cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=
This returns the following (you can check it in a browser):
<CGI_Result>
0
0
1
0
0
0
0k
0k
1
0
xxxxxxxxx
0
0

0
</CGI_Result>

IOAlarm will return 0 if disabled, 1 if no alarm and 2 if an alarm is detected.

I then use luup.inet.wget with the above URL in a scene (which I trigger periodically) to get the response, parse it and depending on the response change the status of a Virtual Motion Sensor.

Regards
Tom

Impressive. I will have to try that out today.

Has anyone had any problems with their Vera locking up after switching to this plugin?Since switching, my Vera keeps becoming unresponsive (about 5x in the last 12 hrs.) It’s generally shortly after accessing the feed (no recording or snapshots are initiated.)

I run a Veralite with the latest UI7 build. I can try to debug this later this evening.

HI Randmness,

Lets compare notes tonight - i though i was going crazy, but that was the first thing i noticed… about 5-7 times a day my VeraEdge locks up with the new plugin. so yes, i’m having the same issue as you. it will eventually self recover, but even still… EXTREEEEMLY sluggish at times.

I’ll be doing some more testing tonight and will share my results.

Sure.

I didn’t connect the dots until I was unable to log in this morning. I tried again an hour later and saw multiple “Unable to connect to device” messages in the alerts menu (about 8 in the span of a couple hours) for the camera.

At one point last night, I did have to reset my Foscam (power cycle), as I couldnt connect to it directly at all. It’s currently set up through a wifi connection with my router, so maybe I’ll hardwire it via ethernet, and try the plugin again.

Looking through my alert history, I am seeing other connection errors for the camera (back when I was using I_Foscam98HD.xml), but in considerably less frequency (maybe once a day vs several in an hr.)

Hi everybody,

so here are the results from my testing of the new plugin:

Working:

  • Camera control (pan / tilt) functionality from Browser / phone app. I dont have any issues with diffrent browsers, they all seem to work pretty good!
  • recording works - its capturing 15-20 seconds of video when triggered to record
  • live video works better than before the new plugin (shows actual live video now)

Not Working:

  • When i added a 3rd camera, it was a little more difficult to get the video working. the camera URL would not produce a screenshot in the VeraEdge - but if i went to the URL directly - it would give me a screenshot. (not sure if this is really a foscam issue - seems more like a Vera UI issue)

  • the new camera i added last night - does NOT have the presets options or pan /tilt controls (the first 2 cameras do that were already established when you upgraded the plugin) its just the new camera that doesnt’

  • the BIGGEST issue is that ever since we added the new plugin, the controller gets sluggish and non-responsive at times. i have had to manually reboot the controller at least once a day since the new plugin was updated.

  • where as the pan / tilt function works - its extreemly sluggish. when sending a command for ‘pan/tilt’ via the Vera UI - it can take anywehre from 30-90 seconds for the camera to move (this might be compounded by the delay in video from the camera back to Vera UI)

Request / questions:

  • is there a way to configure how much video is recorded when the ‘record’ option is triggered?
  • is there a way to set a ‘rolling record’ where it will record the entire time i’m not home? (ie change to ‘away mode’ via VeraEdge, and it triggers the camera to constantly record?)
  • are we able to zoom yet? or is that a future enhancement?

So I got this plugin to work with one of my foscam units. I’m overall pleased with the ability to make the thing move (albeit sluggishly).

I have a couple of these PTZ cameras, though, and found that trying to use the plugin with both ended up breaking the live feed from one where I have a different port defined in the camera setup. @mcv.andrei - have you accounted for the port setting in the code - I couldn’t find anything, but that doesn’t mean it wasn’t in DirectStreamingURL or VideoURLs or the other vars.

Also, I removed the impl_file setting for the camera that didn’t work, only to find that the impl_file field disappeared after I had done so? I rebooted my vera, but it still has the command buttons on the image overlay, and the impl_file field is still gone.

Hi ceefin,

@mcv.andrei - have you accounted for the port setting in the code - I couldn't find anything, but that doesn't mean it wasn't in DirectStreamingURL or VideoURLs or the other vars.

When you add the camera manually, you must add the camera’s snapshot URL. The UI will parse it and will add in IP variable “IP:PORT” if the port is specified. The plugin use the value from here, that is why you didn’t saw the port in code.

Also, I removed the impl_file setting for the camera that didn't work, only to find that the impl_file field disappeared after I had done so? I rebooted my vera, but it still has the command buttons on the image overlay, and the impl_file field is still gone.

You are saying that implementation file was deleted after you removed it form advance settings for your camera?
Regarding the commands buttons, it’s normal to be there. These buttons are linked to “Commands” variable and if “camera_up,camera_down,camera_left,camera_right,” values are found, then the controls will remain there. Try to remove the values and the commands will disappear.

Best Regards,

  • Andrei -

I removed the implementation filename I_FoscamHD.xml from the form field and hit enter. After I did that, the form field is no longer present on the page, should I want to re-add it.

I’ll look into the port thing. The one I was having problems with is the 1st camera I added to vera when I set it up in December, so I might have gone a different way about it.

I experienced the same thing. I removed the “I_FoscamHD.xml” entry from the “impl_file” box and backed out of the Advanced Settings. When I went back into Advanced Settings the “impl_file” box is no longer there. I have no way to enter the Implementation file name now.

[quote=“tomvanbreda, post:46, topic:185859”][quote=“Randmness, post:43, topic:185859”]I will check try this again tonight. I have using the Foscam98HD plugin, which with the exception of presets and motion sensing, works.

Tomvan,
Would you be able to explain how you got the motion sensors to work?[/quote]

Hi Randmness
I use the following command from the Foscam SDK:
http://cameraIP:port//cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=
This returns the following (you can check it in a browser):
<CGI_Result>
0
0
1
0
0
0
0k
0k
1
0
xxxxxxxxx
0
0

0
</CGI_Result>

IOAlarm will return 0 if disabled, 1 if no alarm and 2 if an alarm is detected.

I then use luup.inet.wget with the above URL in a scene (which I trigger periodically) to get the response, parse it and depending on the response change the status of a Virtual Motion Sensor.

Regards
Tom[/quote]

Could you please post your code for this function? As i’m struggling with the same problem and would like to try to use th ellup code to get the XML tag value of the alarm. But I’m a lupp novice, so I’m unable to successfully extract the IOAlamr tag value. Thanks!

See lua code below that I use in a scene (replace x and y with your values)

local cameraURL = “http://x.x.x.x:x/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=x&pwd=x”

  • yardID is the ID of the Virtual Motion sensor.
    local yardID = y

  • Get the camera device state
    local status, response = luup.inet.wget(cameraURL,5)

  • These two lines determine the position of the alarm data in the response
    local alarm = string.find(response, “”)
    local position = alarm - 1

  • Get the atarmState and add 0 to alarmState to convert it to an integer
    local alarmState = string.sub(response, position,position) + 0

  • if motion alarm set virtual motion sensor to tripped
    if alarmState == 2 then
    luup.call_action(“urn:dcineco-com:serviceId:VMotion1”,“SetTripped”,yardID)
    end

[quote=“tomvanbreda, post:46, topic:185859”][quote=“Randmness, post:43, topic:185859”]I will check try this again tonight. I have using the Foscam98HD plugin, which with the exception of presets and motion sensing, works.

Tomvan,
Would you be able to explain how you got the motion sensors to work?[/quote]

Hi Randmness
I use the following command from the Foscam SDK:
http://cameraIP:port//cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=
This returns the following (you can check it in a browser):
<CGI_Result>
0
0
1
0
0
0
0k
0k
1
0
xxxxxxxxx
0
0

0
</CGI_Result>

IOAlarm will return 0 if disabled, 1 if no alarm and 2 if an alarm is detected.

I then use luup.inet.wget with the above URL in a scene (which I trigger periodically) to get the response, parse it and depending on the response change the status of a Virtual Motion Sensor.

Regards
Tom[/quote]

Dear Tomvanbreda,
I see that you managed to get motion sensor to work on the foscam. I got everything working with this plugin except for the motion sensor.

Could you please describe the procedure for a complete non-expert (I just got my micasaverde)? Or is that too complicated?

E.g. Where did you put this command: http://cameraIP:port//cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=

How do you access and use the luup.inet.wget?

I would really appreciate it.

Thank you very much.

Hi Vitaz
Sorry for the late reply, but I only saw your post today.
The http://cameraIP:port//cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd= was just to illustrate the Foscam SDK command to check if the motion sensor is tripped.

[quote=“vituz, post:58, topic:185859”][quote=“tomvanbreda, post:46, topic:185859”][quote=“Randmness, post:43, topic:185859”]I will check try this again tonight. I have using the Foscam98HD plugin, which with the exception of presets and motion sensing, works.

Tomvan,
Would you be able to explain how you got the motion sensors to work?[/quote]

Hi Randmness
I use the following command from the Foscam SDK:
http://cameraIP:port//cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=
This returns the following (you can check it in a browser):
<CGI_Result>
0
0
1
0
0
0
0k
0k
1
0
xxxxxxxxx
0
0

0
</CGI_Result>

IOAlarm will return 0 if disabled, 1 if no alarm and 2 if an alarm is detected.

I then use luup.inet.wget with the above URL in a scene (which I trigger periodically) to get the response, parse it and depending on the response change the status of a Virtual Motion Sensor.

Regards
Tom[/quote]

Dear Tomvanbreda,
I see that you managed to get motion sensor to work on the foscam. I got everything working with this plugin except for the motion sensor.

Could you please describe the procedure for a complete non-expert (I just got my micasaverde)? Or is that too complicated?

E.g. Where did you put this command: http://cameraIP:port//cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=

How do you access and use the luup.inet.wget?

I would really appreciate it.

Thank you very much.[/quote]
I created a scene with a Schedule of every 10 seconds.
The I placed the code (see post 56) in the section “Also, execute the following Luup code:”

Note: I use a Virtual Sensor plugin.

Hello,

I’m trying to hook up my Foscam HD camera to my Vera, and after following instructions it comes up as an “undefined device”. I’m attaching the device info that is generated.

I tried the file from the app store, as well as the latest I_FoscamHD.xml file from this thread.

I can confirm that the jpg retrieval URL works and provides a valid image from my camera (Foscam FI9853EP)

I’m not sure if this thread is still active, but it seems that many people have had success with it and am wondering what I’m missing.

A more general question: what do the plugins offer if there is no need for pan/tilt/zoom given there is a standard URL to retrieve an image?

Thank You!