mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
Merge pull request #289 from joemcmonagle/patch-2
Update switch.command_line.markdown with example including statecmd
This commit is contained in:
commit
537f0d4c1b
@ -87,3 +87,19 @@ switch:
|
|||||||
oncmd: "cvlc 1.mp3 vlc://quit &"
|
oncmd: "cvlc 1.mp3 vlc://quit &"
|
||||||
offcmd: "pkill vlc"
|
offcmd: "pkill vlc"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### {% 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:
|
||||||
|
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: '{{ value == "1" }}'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user