Problems with Foscam FI8910W

Dear all, I bought a Foscam FI8910W IP camera, and I followed the instruction provided here to add it to my Home Assistant system:

I can see the “camera.ip_camera” entity now among currrent entities, and I added it to the home Screen.

Anyway, I cannot see anything and instead I only have a window saying: “IP Camera(Error loading image)”

I must specify that if with my browser I go to the same ip, I can see the camera OK, no problem, as I already set it up with the FOSCAM software.

Does anyone else had the same problem / solved it?

I ended up using the generic MJPEG camera support. My config looks like this:

# Front Inside Camera
- platform: mjpeg
  mjpeg_url: http://192.168.1.7/videostream.cgi?user=hass&pwd=REDACTED
  name: Front of House

You’ll get errors in your log, but you can ignore them and the camera works.

Has there been any expansion for the Foscam component? I have two FI9821P that worked as ‘foscam’ and two FI8904W that I had to use ‘mjpeg’ for and am getting an enormous amount of error (as expected).

Either expand ‘foscam’ or is there a way to fix the errors?

I’ve got a Foscam FI8010E which is the wired version of the Foscam first mentioned. (Non-Wireless) I’m having the same issue. I had to run the camera as a mjpeg platform to make it work. Which this kind of stinks as the cam is very choppy this way. Vs real time.

Any updates on expanding the Foscam platform?

Im trying to add a Foscam FI9828W too. Having no luck to get it to work with Home Assistant.
Tried the Foscam and the Mjpeg method and nothing works.I get this error:
17-01-25 20:08:18 requests.packages.urllib3.connectionpool: Failed to parse headers (url=http://192.168.1.7:8151/videostream.cgi?rate=0&user=xxx&pwd=xxx)

Here is an example of my line for my foscam FI9821P (top) and FI8904W & FI8906W (bottom):

camera 2:
 platform: foscam
 ip: 192.168.2.4
 name: Kitchen Cam
 port: 18810
 username: !secret camera_username
 password: !secret camera_password

camera 3:
 platform: mjpeg
 mjpeg_url: http://192.168.2.115:18811/videostream.cgi?user=Redacted&pwd=Redacted
 name: Front Porch Cam

This isn’t HA as much as it is the library they are using for this. As far as I know, the issue at the library is still open.

I have a pair of 8918Ws which are essentially the same and ironically did a bunch of work on them yesterday to get curl commands working to move them to presets.

One of the things that reduced (maybe ended) these errors for me was adding the authentication type.

# Front Inside Camera
- platform: mjpeg
  mjpeg_url: !secret cam1_url
  authentication: digest
  name: interior street facing controllable

The URL I use is identical to @Corey_Johnson; I found it at iSpy’s site which is a great repo for direct URLs for many camera types. https://www.ispyconnect.com/sources.aspx

Also, when working on my presets project, I found this which is going to help a lot of you guys out if you want to access features via curl commands!

As far as some of the other info “errors” that you get from HA on the Foscams, since they don’t affect actual operation, I’ve been filtering them with the following:

logger:
  default: error
  logs:
    homeassistant.components.media_player.firetv: fatal
    homeassistant.components.media_player.cast: fatal
    homeassistant.components.cameras: fatal

For me, some of these components generate errors that aren’t anything that affects their actual operation; for instance, I have a UHD TV with Cast built in. This is great and when it’s on, the media player shows up fine but when the TV is off I get connection errors. Since I know this is in the process of being fixed (possibly in .37), I’m just suppressing them for now. If something nasty happens, I’ll still get an error. This is a personal choice; I’m not saying you should just ignore errors in your log. But if you know what they are and if you know they are not critical, this is a way to filter them out.

Hope this helps; I didn’t see a lot of Foscam info when I first came here so I wanted to try to add to the knowledge base.

3 Likes

Thanks Robert,
That got me up and running. Now I just have to figure out if I can get the pan/tilt and zoom to work with HA

Give me a little time and I’ll put up what I did with presets; really the only difference would be looking up which command number and CGI to put in the URL. And you should be able to get that from the CGI PDF I posted.

Here’s what I came up with for the preset commands

Go to preset 1 - http://CAM_IP/decoder_control.cgi?command=31&user=USER&pwd=PASSWORD
Go to preset 2 - http://CAM_IP/decoder_control.cgi?command=33&user=USER&pwd=PASSWORD
Go to preset 3 - http://CAM_IP/decoder_control.cgi?command=35&user=USER&pwd=PASSWORD
Go to preset 4 - http://CAM_IP/decoder_control.cgi?command=37&user=USER&pwd=PASSWORD
Go to preset 5 - http://CAM_IP/decoder_control.cgi?command=39&user=USER&pwd=PASSWORD

I also have a cam that faces a window so I turn off the IR otherwise the reflection washes everything out.

Turn off IR lamp - http://CAM_IP/decoder_control.cgi?command=95&user=USER&pwd=PASSWORD

I created scripts for each one to send these commands via cURL here’s an example of one of them:

#!/bin/bash

curl -k "http://CAM_IP/decoder_control.cgi?command=31&user=USER&pwd=PASSWORD"

and changed the owner of the scrip to the HA user. I call them with a shell command.

3 Likes

Thanks Robert, Going to give it a try this week.

1 Like

Hey maucollu,

i have the same problem with the Foscam FI9851. Can´t get it to work. Did you solve your problem?

No, I never solved it… :frowning:

I was just doing some research into pan and tilt indoor cameras that work with HA and it looks like Foscam is a good option. However, there is a question as to which model to go for, as some seem problematic (as this thread highlights) and some of the older models are selling out while there are new ones that haven’t been mentioned.

As best I can tell:

Working:

  • Foscam C1
  • FI8010E - as mjpeg
  • FI8904W - as mjpeg
  • FI8906W - as mjpeg
  • FI8909W - as mjpeg
  • FI8918W - as mjpeg
  • FI9821P - as foscam
  • FI9828W - as mjpeg?
  • FI9828P - works with fancy controls

Not working, yet:

  • FI8910W
  • FI9851?

Unknown:

  • Foscam R2
  • FI8908W
  • FI8910W
  • FI9816P
  • FI9826P
  • FI9831P

But there is also the FI9816P. Has anyone got this working? The reviews aren’t encouraging on Amazon, but then neither are those for the FI9821P. I assume it doesn’t matter too much as Home Assistant will be doing all the work.

i dont know about that specific cam, but i recently bought a C1 lite for 26 euro
it has the same CGI so i can control it on the same way as the F19828P (without PTZ off course)
so the most important is to find out which type of CGI the cam uses.

i will try to find out a list later on.

edit: changed CGG to CGI

I would try MJPEG Generic on this with the following URL:

http://IPADDRESS:PORT/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=[USERNAME]&pwd=[PASSWORD]&

Or FFMPEG with this:

http://IPADDRESS:PORT/videostream.asf?user=[USERNAME]&pwd=[PASSWORD]

You should be able to see something in a browser if you try these URLs and replace the capitalized variables with your actual info. If you do, then it should work in HA as well. At least the first one; you’ll have to set up FFMPEG to use the other one, of course.

1 Like

Thanks for the advice.

So it seems you can use the pan and tilt through CGI even if it is only using the mjpeg. Good to know.

Do the W and P models make much of a difference when using them through HA?

If you can find a reference of the CGI commands like I did with the 8918w, you can create scripts and use cURL commands to move the cams, at least to the presets if nothing else. I’m doing it myself with an input select.

Not sure, but I wouldn’t think so.

1 Like

I can confirm that the FI8909W is also working flawless in Hass (stream only). Config used:

camera:

1 Like

This may be for older firmware but the cgi command format is different from what is listed above for PTZ presets.

For Horizontal Patrol:

curl -k "IP:PORT/decoder_control.cgi?user=<user>&pwd=<password>&command=28"

For presets:

curl -k "IP:PORT/decoder_control.cgi?user=<user>&pwd=<password>&command=31"

Substitute the command for multiple odd numbers to get different presets (31, 33, 35, 37…)