This switch will control the motion sensor of Foscam Webcams which Support CGI Commands (Source). This switch supports statecmd, which checks the current state of motion detection.
-```yaml
-# Example configuration.yaml entry
-# Replace admin and password with an “Admin” priviledged Foscam user
-# Replace ipaddress with the local IP address of your Foscam
-switch:
- platform: command_line
- switches:
- foscam_motion:
- oncmd: ‘curl -k “https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&usr=admin&pwd=password”’
- offcmd: ‘curl -k “https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&usr=admin&pwd=password”’
- statecmd: ‘curl -k –silent “https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password” | grep -oP “(?<=isEnable>).*?(?=</isEnable>)”’
- value_template: ‘’
+yaml
+# Example configuration.yaml entry
+# Replace admin and password with an "Admin" priviledged Foscam user
+# Replace ipaddress with the local IP address of your Foscam
+switch:
+ platform: command_line
+ switches:
+ foscam_motion:
+ oncmd: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&usr=admin&pwd=password"'
+ offcmd: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&usr=admin&pwd=password"'
+ statecmd: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=</isEnable>)"'
+ value_template: ''
+
diff --git a/sitemap.xml b/sitemap.xml
index d9ca873974..87d1b8ed35 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1448,18 +1448,18 @@
https://home-assistant.io/demo/frontend.html
- 2016-04-19T06:33:51+00:00
+ 2016-04-19T15:17:22+00:00https://home-assistant.io/demo/index.html
- 2016-04-19T06:33:51+00:00
+ 2016-04-19T15:17:22+00:00https://home-assistant.io/googlef4f3693c209fe788.html
- 2016-04-19T06:33:51+00:00
+ 2016-04-19T15:17:22+00:00https://home-assistant.io/static/mdi-demo.html
- 2016-04-19T06:33:51+00:00
+ 2016-04-19T15:17:22+00:00