Foscam F18910W Openhab setup

2,005 views
Skip to first unread message

Jarod Peters

unread,
Sep 5, 2014, 10:47:53 AM9/5/14
to ope...@googlegroups.com
Has anyone been able to successfully pull in a live stream of their webcam into openhab's sitemap?  If so could someone please be willing to share their URL that they used and the items and sitemap files?  I can get a live image/snapshot but I cannot get it to do live video feed as I have been reading that others were successful but there were no examples on how this was accomplished.

Stefan Mensink

unread,
Sep 5, 2014, 12:09:52 PM9/5/14
to ope...@googlegroups.com
I've run into the same issue with the foscam FI9826W.

While a still image works just fine, I just can't get a livestream to work.

I've even tried to transcode through vlc because my cam outputs h.264. I can't find anywhere on the wiki which video formats are supposed to be supported.


Alex Jongman

unread,
Sep 5, 2014, 4:53:18 PM9/5/14
to ope...@googlegroups.com
I managed to get the live stream, but it will not be shown with the Android app and there seems to be some bug's in the openhab UI (I'm using greent) because the image item sometimes doesn't show.
Here is my sitemap item:

Image url="http://webcam_ip_address:80/videostream.cgi?user=username&pwd=password"

Stefan Mensink

unread,
Sep 5, 2014, 5:22:16 PM9/5/14
to ope...@googlegroups.com
I see you defined it as an image. My best guess is your webcam outputs an mpjeg stream, which openhab obediently proxies.

Jarod Peters

unread,
Sep 5, 2014, 8:46:10 PM9/5/14
to ope...@googlegroups.com
It doesn't appear that my foscam outputs in mpjep stream.  What do you do if it streams in a different format?


On Fri, Sep 5, 2014 at 4:22 PM, Stefan Mensink <stefan....@gmail.com> wrote:
I see you defined it as an image. My best guess is your webcam outputs an mpjeg stream, which openhab obediently proxies.

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/PwviU89oqS0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Alex Jongman

unread,
Sep 6, 2014, 3:22:55 PM9/6/14
to ope...@googlegroups.com
There aren't much options to change the format. 
As far as I know there is only a jpeg-video stream returned by the videostream.cgi and an asf-stream returned by videosteam.asf (see also: http://www.foscam.es/descarga/ipcam_cgi_sdk.pdf )

Have you tried to access the webcam using the cgi url's in the browser first? 

Jarod Peters

unread,
Sep 7, 2014, 9:23:57 PM9/7/14
to ope...@googlegroups.com
I have done this and can get these links working through a browser but do not ever get a picture/video stream through openhab, it just has a huge blank square with nothing in it.

Ben Jones

unread,
Sep 7, 2014, 9:43:49 PM9/7/14
to ope...@googlegroups.com
I have the same camera and the only way I could get it to stream inside my openHAB UI was to install 'motion' on my Ubuntu home server and do the following;

Configure motion for my Foscam with;

netcam_url http://<%foscamhostname%>/videostream.cgi?user=<%username%>&pwd=<%password%>
netcam_keepalive on

control_port
9280
webcam_port
9282

# the following are just simple python scripts which send REST API updates to openhab so
# I can track motion events in my rules (not necessary)
on_event_start python
/home/ben/services/motion/living_motion.py 'ON'
on_event_end python
/home/ben/services/motion/living_motion.py 'OFF'


Then add the following at /opt/openhab/webapps/static/living.html;

<html>
       
<head>
               
<style>
                        body
                       
{
                                margin
: 0px;
                                padding
: 0px;
                       
}
                        img
                       
{
                                width
: 100%;
                                height
: 100%;
                       
}
               
</style>
       
</head>
       
<body>
                <img src="http://
<%motionhostname%>:9282" />
       
</body>
</html>


Finally in my sitemap;

Webview url="https://<openhabhost>:8080/static/living.html" height=12 visibility=[PresenceBen_WifiHome==ON]


Which is only visible when my phone is on the home WIFI network, since this view doesn't work when accessing externally.

So it is a bit of a convoluted setup, but it works! Plus you can use the 'motion' detection features to track presence in openHAB etc.

You can arm/disarm detection using simple HTTP posts from openHAB;

Switch          Camera_LivingArmed            "Living Room Armed"                  <camera>         (CamerasArmed)            { http=">[ON:GET:http://<motionhostname>:9280/1/detection/start] >[OFF:GET:http://<motionhostname>:9280/1/detection/pause]" }


So for example I only arm my motion detector in the living room when the security system is armed. Then if the camera detects any motion I play a loud barking dog track through my Squeezeboxes throughout the house! Scares the sh!t out of the cat, but hopefully any would-be intruders as well!!

Jarod Peters

unread,
Sep 7, 2014, 10:28:13 PM9/7/14
to ope...@googlegroups.com
Wow, that is a very creative way to go about it.  I will look into this setup until there is a better resolution because I would like access to my cameras when I am away but if this is the only way right now I will go about this way but may change if there are any other ideas out there.

Ben Jones

unread,
Sep 7, 2014, 10:30:26 PM9/7/14
to ope...@googlegroups.com
Yep - if you figure out how to stream a live feed externally I would be very interested!

Michael Belleville

unread,
Mar 31, 2015, 8:57:44 PM3/31/15
to ope...@googlegroups.com
Thank you Alex for this url:
Image url="http://webcam_ip_address:80/videostream.cgi?user=username&pwd=password"

With that I am able to get a nice stream in the web UI.  However, as you mentioned Alex, I get nothing in the android app.  Any idea why this is?

It seems with this feature:

streams should be proxied through openhab so that they are viewable externally.  does this need to be configured?  has anyone gotten it working with the fi8910w?
Reply all
Reply to author
Forward
0 new messages