mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-17 14:26:51 +00:00
Add an additional example
This commit is contained in:
parent
8f66769d97
commit
d70a994fd0
@ -31,6 +31,11 @@ Configuration variables:
|
|||||||
- **oncmd** (*Required*): The action to take for on.
|
- **oncmd** (*Required*): The action to take for on.
|
||||||
- **offcmd** (*Required*): The action to take for off.
|
- **offcmd** (*Required*): The action to take for off.
|
||||||
|
|
||||||
|
## {% linkable_title Examples %}
|
||||||
|
|
||||||
|
In this section you find some real life examples of how to use this switch.
|
||||||
|
|
||||||
|
### {% linkable_title aREST device %}
|
||||||
|
|
||||||
The example below is doing the same as the [aREST switch](/components/switch.arest.html). The commandline tool `[curl](http://curl.haxx.se/)` is used to toogle a pin which is controllable through REST.
|
The example below is doing the same as the [aREST switch](/components/switch.arest.html). The commandline tool `[curl](http://curl.haxx.se/)` is used to toogle a pin which is controllable through REST.
|
||||||
|
|
||||||
@ -44,3 +49,21 @@ switch:
|
|||||||
offcmd: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/0"
|
offcmd: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/0"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### {% linkable_title Shutdown your local host %}
|
||||||
|
|
||||||
|
This switch will shutdown your system that is hosting Home Assistant.
|
||||||
|
|
||||||
|
<p class='note warning'>
|
||||||
|
This switch will shudown your host immediately, there will be no confirmation.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry
|
||||||
|
switch:
|
||||||
|
platform: command_switch
|
||||||
|
switches:
|
||||||
|
Home Assistant system shutdown:
|
||||||
|
offcmd: "/usr/sbin/poweroff"
|
||||||
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user