Skip to content

Instantly share code, notes, and snippets.

@swilson
Created November 17, 2018 21:10
Show Gist options
  • Save swilson/7674fd6bf4789bb0c7938136210f1168 to your computer and use it in GitHub Desktop.
Save swilson/7674fd6bf4789bb0c7938136210f1168 to your computer and use it in GitHub Desktop.
Home Assistant motion sensor for Foscam camera motion detection
binary_sensor:
- platform: command_line
name: "Front Door Motion Sensor"
command: 'curl -k --silent "https://192.168.1.XXX:443/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXX&pwd=XXXX" | grep -oP "(?<=motionDetectAlarm>).*?(?=</motionDetectAlarm>)"'
device_class: motion
payload_on: "2"
payload_off: "1"
scan_interval: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment