Foscam camera with lots of controls

This app works for Foscam type:
F19828P

This app doesnt (yet) work for Foscam type: (ill try to add at least partial functions for these)
F18918

This week i bought a Foscam camera (FI9828P V2) and i found out that allthough it was quite easy to implement the camera itself, it was difficult to create controls in HA. mainly through commandline switches and curl commands.

so i have been working on it to create an Appdaemon App in combination with a few input booleans, input select and input sliders.

let me show you a picture:

all functions should work for a lot of foscam cams.
i posted the app with the configparts for appdaemon and HA on github.

https://github.com/ReneTode/My-AppDaemon/tree/master/foscamapp

i found out that there are more CGI types for foscam available. could be that an update for the cam is needed (if available)
to test if this app works for your camera you could try this first:
http://CAM_IP:CAM_POORT/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=YOUR_USER_NAME&pwd=YOUR_PWD
it should give back info.

if that works this app should also work

8 Likes

This is what I have been looking for. Could you give me details on how I would get this to work for me?
Also would this work for more the one camera?

1 Like

first you need to install appdaemon.
after that you can copy the app to your appdir and use the yaml i gave to implement into your own yaml.

it should work with more cameras.
all you then need to do is create all the input sliders, input selects and input boolens twice.
you could use input_slider.foscam_zoom for the first and input_slider.foscam2_zoom for the second (for example)

link to appdaemon

https://home-assistant.io/docs/ecosystem/appdaemon/installation/

Great. I already have appdaemon installed. Using it for HADashboard.

1 Like

great then all you need to do is save the foscam.py in your app dir,
add the config to your appdaemon.cfg and add the yaml to your HA yaml

1 Like

Excellent, thanks!

1 Like

I did all that. Got everything in HA but I’m not able to control the camera or change anything.

grr, changed my reply instead of a new one.

# Apps
[hello_world]
module = hello
class = HelloWorld

[foscam]
module = foscam
class = foscam
host = ""
port = ""
user = ""
password = ""
sensor_update_time = 10
motion_sensor = "sensor.foscam_motion"
recording_sensor = "sensor.foscam_recording"
soundalarm_sensor = "sensor.foscam_sound_alarm"
up_down_slider = "input_slider.foscam_up_down"
left_right_slider = "input_slider.foscam_left_right"
infrared_switch = "input_boolean.foscam_infrared"
auto_infrared_switch = "input_boolean.foscam_auto_infrared"
motion_switch = "input_boolean.foscam_motion_detect"
zoom_slider = "input_slider.foscam_zoom"
preset_points_select = "input_select.foscam_preset_points"
start_cruise_select = "input_select.foscam_preset_cruise"
stop_cruise_switch = "input_boolean.foscam_stop_cruise"
brightness_slider = "input_slider.foscam_brightness"
contrast_slider = "input_slider.foscam_contrast"
hue_slider = "input_slider.foscam_hue"
saturation_slider = "input_slider.foscam_saturation"
sharpness_slider = "input_slider.foscam_sharpness"
default_pic_settings_switch = "input_boolean.foscam_default_picture_settings"
mirror_switch = "input_boolean.foscam_mirror"
flip_switch = "input_boolean.foscam_flip"
snap_picture_switch = "input_boolean.foscam_snap_picture_now"
save_snap_dir = /mnt/usbdrive/pi/foscam_snap/

thats my bad.
you copied before i changed it.
you need to lose all the "
is it possible you have also this there:
disable_apps = 1
that has to be set to 0

and obviously you have to fill in host, port, user and pw.

ok. I dont have disable_apps.
And I need to remove all " ?

yeah, this:

motion_sensor = “sensor.foscam_motion”

needs to be

motion_sensor = sensor.foscam_motion

that was a failure i detected afterwards

All done. Do i need to restart HA and Appdaemon?

no, no restarts needed.
it should work if it is all right.

if not i want to know if you have errors in your error log.
and i like to know which foscam type you have.

Still not working. Where do i find the error log?

in your configfile you have set where your logs are saved.

Foscam HD960P FI9828P is the one I’m trying

then we must get it to work, because its the same as i have :wink:

lol. You want the HA log file?

no the appdaemon log