Foscam C1 - Sensors/Switches

I’ve had a look at the cookbook options, as well as a couple of user submissions on the community.

https://home-assistant.io/cookbook/foscam_away_mode_PTZ/

However I’m having a hard time getting anything to work. Has anyone had luck adding sensors/switches for the C1? I understand I can query states with the CGI command and then examples given in forum seem to work when I paste them in my browser as they return the correct information, but do nothing in HASS.

If someone could share they’re code of a working example with this model or a nudge in the right I’d really appreciate it.

I have the C1, I think it is a pretty basic model which does not support these features…

I may be completely off the mark, but if i can query states through the CGI function, can I not use that? For instance I can tell if the recording mode is enabled or disabled perfectly fine.

I figured out how to do this, just incase anyone else needs the config.

    switches:
      foscam_motion:
        command_on: 'curl -k "http://yourip:88/cgi-bin/CGIProxy.fcgi?usr=username&pwd=password&cmd=setMotionDetectConfig&isEnable=1&sensitivity=2"'
        command_off: 'curl -k "http://yourip:88/cgi-bin/CGIProxy.fcgi?usr=username&pwd=password&cmd=setMotionDetectConfig&isEnable=0"'
        command_state: 'curl -k --silent "http://yourip:88/cgi-bin/CGIProxy.fcgi?usr=username&pwd=password&cmd=getMotionDetectConfig" | grep -oP "(?<=isEnable>).*?(?=</isEnable>)"'
        value_template: '{{ value == "1" }}'```

This turns on motion detection with a high sensitivity.
1 Like

Thanks! youip is the camera ip?
Also you hard code the username & pwd?
Cheers

If you use mqtt , there is a python/mqtt script for foscam posted in the forums here somewhere.
I use it with a c1 and made a binary motion sensor out of it.
Edit:

Yeah, just replace it with your IP, user and password.

1 Like

Sweet, will check this out.