We have moved at community.getvera.com

Author Topic: Foscam HD plugin  (Read 29122 times)

Offline tomvanbreda

  • Newbie
  • *
  • Posts: 15
  • Karma: +2/-0
Re: Foscam HD plugin
« Reply #45 on: May 27, 2015, 03:28:36 am »
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?

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>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>1</ntpState>
    <ddnsState>0</ddnsState>
    <url>xxxxxxxxx</url>
    <upnpState>0</upnpState>
    <isWifiConnected>0</isWifiConnected>
    <wifiConnectedAP></wifiConnectedAP>
    <infraLedState>0</infraLedState>
</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
« Last Edit: June 08, 2015, 02:37:22 pm by tomvanbreda »

Offline Randmness

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: Foscam HD plugin
« Reply #46 on: May 27, 2015, 06:39:17 am »
Impressive. I will have to try that out today.
Developer of Smart Abode: Vera UI5/UI7 Control via an Android Wearable
https://play.google.com/store/apps/details?id=automation.com.veracontroller

Offline Randmness

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: Foscam HD plugin
« Reply #47 on: May 27, 2015, 09:55:21 am »
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.
« Last Edit: May 27, 2015, 09:58:04 am by Randmness »
Developer of Smart Abode: Vera UI5/UI7 Control via an Android Wearable
https://play.google.com/store/apps/details?id=automation.com.veracontroller

Offline ianfischer2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Foscam HD plugin
« Reply #48 on: May 27, 2015, 01:57:03 pm »
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.


Offline Randmness

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: Foscam HD plugin
« Reply #49 on: May 27, 2015, 02:13:18 pm »
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.) 
« Last Edit: May 27, 2015, 02:22:12 pm by Randmness »
Developer of Smart Abode: Vera UI5/UI7 Control via an Android Wearable
https://play.google.com/store/apps/details?id=automation.com.veracontroller

Offline ianfischer2

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Foscam HD plugin
« Reply #50 on: May 30, 2015, 11:57:26 am »
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?

Offline ceefin

  • Full Member
  • ***
  • Posts: 141
  • Karma: +7/-0
Re: Foscam HD plugin
« Reply #51 on: June 03, 2015, 09:10:20 am »
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.

andreimios

  • Guest
Re: Foscam HD plugin
« Reply #52 on: June 03, 2015, 10:08:18 am »
Hi ceefin,

Quote
@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.

 
Quote
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 -

Offline ceefin

  • Full Member
  • ***
  • Posts: 141
  • Karma: +7/-0
Re: Foscam HD plugin
« Reply #53 on: June 03, 2015, 06:16:57 pm »
You are saying that implementation file was deleted after you removed it form advance settings for your camera?

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.

Offline kendad

  • Full Member
  • ***
  • Posts: 129
  • Karma: +1/-4
Re: Foscam HD plugin
« Reply #54 on: June 04, 2015, 12:48:06 am »

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 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.

Offline scorp10

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Foscam HD plugin
« Reply #55 on: June 26, 2015, 06:25:54 am »
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?

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>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>1</ntpState>
    <ddnsState>0</ddnsState>
    <url>xxxxxxxxx</url>
    <upnpState>0</upnpState>
    <isWifiConnected>0</isWifiConnected>
    <wifiConnectedAP></wifiConnectedAP>
    <infraLedState>0</infraLedState>
</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

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!

Offline tomvanbreda

  • Newbie
  • *
  • Posts: 15
  • Karma: +2/-0
Re: Foscam HD plugin
« Reply #56 on: June 26, 2015, 08:26:42 am »
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, "</motionDetectAlarm>")
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

Offline vituz

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Foscam HD plugin
« Reply #57 on: July 29, 2015, 03:56:52 am »
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?

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>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>1</ntpState>
    <ddnsState>0</ddnsState>
    <url>xxxxxxxxx</url>
    <upnpState>0</upnpState>
    <isWifiConnected>0</isWifiConnected>
    <wifiConnectedAP></wifiConnectedAP>
    <infraLedState>0</infraLedState>
</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

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.

Offline tomvanbreda

  • Newbie
  • *
  • Posts: 15
  • Karma: +2/-0
Re: Foscam HD plugin
« Reply #58 on: August 19, 2015, 03:12:36 pm »
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.
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?

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>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>1</ntpState>
    <ddnsState>0</ddnsState>
    <url>xxxxxxxxx</url>
    <upnpState>0</upnpState>
    <isWifiConnected>0</isWifiConnected>
    <wifiConnectedAP></wifiConnectedAP>
    <infraLedState>0</infraLedState>
</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

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.
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.
« Last Edit: August 19, 2015, 03:18:10 pm by tomvanbreda »

Offline tedp

  • Sr. Member
  • ****
  • Posts: 288
  • Karma: +6/-2
Re: Foscam HD plugin
« Reply #59 on: October 10, 2015, 12:54:41 pm »
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!