Foscam camera with lots of controls

Great. Got it working :slight_smile:

2017-04-30 08:58:30.276191 INFO Loading Object foscam using class foscam from module foscam
2017-04-30 08:58:30.280595 WARNING foscam: Entity input_select.foscam_preset_cruise not found in Home Assistant 

The only thing is I dont have any preset cruise settings so I did not put the code in and its giving me a warning.
Thanks Rene I had to install with pip3 install untangle outside the virtual environment.

1 Like

in the app you could disable the line:

    self.start_cruise_select = self.args["start_cruise_select"]

just write an # in front of it and the warning dissapears

Thanks again Rene. Now I guess I just make a complete copy for my next camera?

1 Like

now all you need is a complete set from all the HA entities with the figure 2 behind it.
then you can copy the part from the appdaemon.cfg like this:

[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 = /your_path/foscam_snap/

[foscam2]
module = foscam
class = foscam
host = 
port = 
user = 
password = 
sensor_update_time = 10
motion_sensor = sensor.foscam_motion2
recording_sensor = sensor.foscam_recording2
soundalarm_sensor = sensor.foscam_sound_alarm2
up_down_slider = input_slider.foscam_up_down2
left_right_slider = input_slider.foscam_left_right2
infrared_switch = input_boolean.foscam_infrared2
auto_infrared_switch = input_boolean.foscam_auto_infrared2
motion_switch = input_boolean.foscam_motion_detect2
zoom_slider = input_slider.foscam_zoom2
preset_points_select = input_select.foscam_preset_points2
start_cruise_select = input_select.foscam_preset_cruise2
stop_cruise_switch = input_boolean.foscam_stop_cruise2
brightness_slider = input_slider.foscam_brightness2
contrast_slider = input_slider.foscam_contrast2
hue_slider = input_slider.foscam_hue2
saturation_slider = input_slider.foscam_saturation2
sharpness_slider = input_slider.foscam_sharpness2
default_pic_settings_switch = input_boolean.foscam_default_picture_settings2
mirror_switch = input_boolean.foscam_mirror2
flip_switch = input_boolean.foscam_flip2
snap_picture_switch = input_boolean.foscam_snap_picture_now2
save_snap_dir = /your_path/foscam2_snap/

Ok. Working on it now.
Not to be picky but where is the โ€œcโ€ in sharpness coming from?

from the fact that i am dutch and we dont have sh but sch in our language :wink:
its a failure i make sometimes.

ill take it out, you can do so too :wink:

lol. I just cant seem to find where it is.

in the name from your HA input_slider:

foscam_sharpness:
    name: Scharpness
    initial: 50
    min: 0
    max: 100
    step: 1
    icon: mdi:image-filter

Added in for the second camera. The grouped camera2 shows up as unknown in HA and will not display on the page. Getting this in apperror.log

2017-04-30 10:03:22.026539 WARNING ------------------------------------------------------------
2017-04-30 10:03:22.027467 WARNING ------------------------------------------------------------
2017-04-30 10:03:22.027829 WARNING Unexpected error during exec_schedule() for App: foscam2
2017-04-30 10:03:22.028279 WARNING Args: {'id': UUID('0ce8e6fb-9c48-4cf9-a050-a65cd8f2ad6c'), 'basetime': 1493561002, 'offset': 0, 'timestamp': 1493561002, 'interval': 10, 'name': 'foscam2', 'kwargs': {'interval': 10}, 'callback': <bound method foscam.get_sensors of <foscam.foscam object at 0x7f857d1b00>>, 'repeat': True, 'type': None}
2017-04-30 10:03:22.028623 WARNING ------------------------------------------------------------
2017-04-30 10:03:22.034512 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 341, in exec_schedule
    "kwargs": args["kwargs"],
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 268, in dispatch_worker
    for arg in config[name].keys():
  File "/usr/lib/python3.4/configparser.py", line 937, in __getitem__
    raise KeyError(key)
KeyError: 'foscam2'

you probably have a 2 to many

in both parts it needs to be

module = foscam
class = foscam

Think Iโ€™m good here? Just removed my user and password to post here.

[foscam2]
module = foscam
class = foscam
host = 192.168.1.7
port = 8151
user = XXXXXX
password = XXXXXX
sensor_update_time = 10
motion_sensor = sensor.foscam_motion2
recording_sensor = sensor.foscam_recording2
soundalarm_sensor = sensor.foscam_sound_alarm2
up_down_slider = input_slider.foscam_up_down2
left_right_slider = input_slider.foscam_left_right2
infrared_switch = input_boolean.foscam_infrared2
auto_infrared_switch = input_boolean.foscam_auto_infrared2
motion_switch = input_boolean.foscam_motion_detect2
zoom_slider = input_slider.foscam_zoom2
preset_points_select = input_select.foscam_preset_points2
start_cruise_select = input_select.foscam_preset_cruise2
stop_cruise_switch = input_boolean.foscam_stop_cruise2
brightness_slider = input_slider.foscam_brightness2
contrast_slider = input_slider.foscam_contrast2
hue_slider = input_slider.foscam_hue2
saturation_slider = input_slider.foscam_saturation2
sharpness_slider = input_slider.foscam_sharpness2
default_pic_settings_switch = input_boolean.foscam_default_picture_settings2
mirror_switch = input_boolean.foscam_mirror2
flip_switch = input_boolean.foscam_flip2
snap_picture_switch = input_boolean.foscam_snap_picture_now2
save_snap_dir = /your_path/foscam2_snap/

  foscamsettings2:
    name: Back Foscam
    entities:
      - input_boolean.frontcamera2
      - input_boolean.foscam_snap_picture_now2
      - input_select.foscam_preset_points2
      - input_select.foscam_preset_cruise2
      - input_slider.foscam_up_down2
      - input_slider.foscam_left_right2
      - input_slider.foscam_zoom2
      - input_boolean.foscam_motion_detect2
      - sensor.foscam_motion2
      - sensor.foscam_sound_alarm2
      - sensor.foscam_recording2
  foscampicturesettings2:
    name: Back Foscam picture settings
    entities:
      - input_boolean.foscam_mirror2
      - input_boolean.foscam_flip2
      - input_slider.foscam_hue2
      - input_slider.foscam_brightness2
      - input_slider.foscam_contrast2
      - input_slider.foscam_saturation2
      - input_slider.foscam_sharpness2
      - input_boolean.foscam_default_picture_settings2
      - input_boolean.foscam_auto_infrared2
      - input_boolean.foscam_infrared2

  cams2:
    name: Back Camera
    view: yes
    entities:
      - group.foscamsettings2
      - group.foscampicturesettings2
      - camera.back_door_camera

Think it might be my second camera is too old? Its a FI8918.
Here is the apperror.log

2017-04-30 12:17:03.625759 WARNING ------------------------------------------------------------
2017-04-30 12:17:03.626427 WARNING Unexpected error during loading of foscam:
2017-04-30 12:17:03.626829 WARNING ------------------------------------------------------------
2017-04-30 12:17:03.630957 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 894, in read_app
    init_object(name, class_name, module_name, config[name])
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 592, in init_object
    conf.objects[name]["object"].initialize()
  File "/home/debian/appdaemon_dashboard/appdaemon/conf/apps/foscam.py", line 93, in initialize
    self.listen_state(self.start_cruise,self.start_cruise_select)
AttributeError: 'foscam' object has no attribute 'start_cruise_select'

2017-04-30 12:17:03.633464 WARNING ------------------------------------------------------------

Would love seeing this as. Component or is it hard to do ?

@Dayve67 i think you have set the # in the app on the wrong place.
it has to be for the line with listen_state. it seems that you have set it in front of the line with โ€œself.start_cruise_select =โ€

but i am afraid that its not going to work for F18918. (but i am thinking of rewriting the app for that, only some functions will be lost)

to test if this app works for your camera you could try this first(in a browser):
http://CAM_IP:CAM_POORT/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=YOUR_USER_NAME&pwd=YOUR_PWD
it should give back info.

sorry @thundergreen but i suck at creating components.
but why should you prefer that?
if i make an component out of it, you couldnt set your own icons for the controls, or change grouping, etc.
this way you have all the freedom you need and all the functions.

in the near future i will create a dashboard for it also.
then everyone with a camera thats works with this CGI can create it i a flip :wink:

I get back 404 Not Found

Commenting that out fixed that error. Now I can see I must have missed something for sensors. I looked over your config file but dont see where you added these.

2017-04-30 16:00:22.195488 WARNING foscam: Entity sensor.foscam_motion not found in Home Assistant
2017-04-30 16:00:22.606229 WARNING foscam: Entity sensor.foscam_sound_alarm not found in Home Assistant
2017-04-30 16:00:22.806181 WARNING foscam: Entity sensor.foscam_recording not found in Home Assistant

sensors dont need to be added. the app does that itself.
but you got an error for the CGI commands so that camera wont work with this app.

as soon as i have created options for that type of CGI i will put it here.

I have edited the first post.
ill will add working and not working types to the list for future users.

I have a question. How can I access the foscam webinterface without 32 bit browser? It only accepts 32 bit โ€ฆ thatโ€™S more than disappointing :frowning:

the foscam webinterface can only be accessed with Firefox, not with chrome or explorer.
but after setting up the settings i dont use the webinterface anymore.
all functions i need i have in HA and soon in dashboard.