From 30abcda712e4c805827a2b69eb9f076f444d3896 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 2 May 2016 08:49:34 +0200 Subject: [PATCH] Fix sample --- source/_components/switch.command_line.markdown | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/_components/switch.command_line.markdown b/source/_components/switch.command_line.markdown index bc0e68ce23d..ebe82456f71 100644 --- a/source/_components/switch.command_line.markdown +++ b/source/_components/switch.command_line.markdown @@ -91,10 +91,9 @@ switch: ### {% linkable_title Control Foscam Motion Sensor %} This switch will control the motion sensor of Foscam Webcams which Support CGI Commands ([Source](http://www.ipcamcontrol.net/files/Foscam%20IPCamera%20CGI%20User%20Guide-V1.0.4.pdf)). 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: @@ -102,5 +101,8 @@ switch: 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>).*?(?=)"' - value_template: '{{ value == "1" }}' + value_template: {% raw %}'{{ value == "1" }}'{% endraw %} ``` + +- Replace admin and password with an "Admin" priviledged Foscam user +- Replace ipaddress with the local IP address of your Foscam