Skip to content

Minimizing of the configuration sample (Switch) #1047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions source/_components/switch.acer_projector.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ To use your Acer Projector in your installation, add the following to your `conf
```yaml
# Example configuration.yaml entry
switch:
platform: acer_projector
filename: /dev/ttyUSB0
name: Projector
timeout: 1
write_timeout: 1
- platform: acer_projector
filename: /dev/ttyUSB0
```

Configuration variables:
Expand Down
31 changes: 15 additions & 16 deletions source/_components/switch.arest.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,28 @@ To use your aREST enabled device with pins in your installation, add the followi
```yaml
# Example configuration.yaml entry
switch:
platform: arest
resource: http://IP_ADDRESS
name: Office
pins:
11:
name: Fan
12:
name: Light Desk
- platform: arest
resource: http://IP_ADDRESS
pins:
11:
name: Fan
12:
name: Light Desk
```

If you want to use custom functions, then add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry
switch:
platform: arest
resource: http://IP_ADDRESS
name: Office
functions:
function1:
name:
function2:
name: Light Desk
- platform: arest
resource: http://IP_ADDRESS
name: Office
functions:
function1:
name:
function2:
name: Light Desk
```

Configuration variables:
Expand Down
6 changes: 3 additions & 3 deletions source/_components/switch.command_line.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ switch:
kitchen_light:
command_on: switch_command on kitchen
command_off: switch_command off kitchen
command_state: query_command kitchen
value_template: '{% raw %}{{ value == "online" }}{% endraw %}'
friendly_name: Kitchen switch
```

Configuration variables:
Expand Down Expand Up @@ -57,6 +54,9 @@ switch:
arest_pin4:
command_on: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/1"
command_off: "/usr/bin/curl -X GET http://192.168.1.10/digital/4/0"
command_state: "/usr/bin/curl -X GET http://192.168.1.10/digital/4"
value_template: '{% raw %}{{ return_value == "1" }}{% endraw %}'
friendly_name: aREST Pin 4
```

### {% linkable_title Shutdown your local host %}
Expand Down
2 changes: 0 additions & 2 deletions source/_components/switch.dlink.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ To use your D-Link smart plugs in your installation, add the following to your `
switch:
platform: dlink
host: IP_ADRRESS
name: D-Link plug
username: YOUR_USERNAME
password: YOUR_PASSWORD
use_legacy_protocol: False
```

Configuration variables:
Expand Down
13 changes: 5 additions & 8 deletions source/_components/switch.edimax.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@ To use your Edimax switch in your installation, add the following to your `confi
```yaml
# Example configuration.yaml entry
switch:
platform: edimax
host: 192.168.1.32
username: YOUR_USERNAME
password: YOUR_PASSWORD
name: Edimax Smart Plug
- platform: edimax
host: 192.168.1.32
```

Configuration variables:

- **host** (*Required*): The IP address of your Edimax switch, eg. 192.168.1.32
- **username** (*Optional*): Your username for the Edimax switch. Defaults to "admin".
- **password** (*Optional*): Your password for the Edimax switch. Defaults to "1234".
- **host** (*Required*): The IP address of your Edimax switch, eg. `192.168.1.32`.
- **username** (*Optional*): Your username for the Edimax switch. Defaults to `admin`.
- **password** (*Optional*): Your password for the Edimax switch. Defaults to `1234`.
- **name** (*Optional*): The name to use when displaying this switch.

1 change: 0 additions & 1 deletion source/_components/switch.enocean.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ To use your EnOcean device, you first have to set up your [EnOcean hub](/compone
# Example configuration.yaml entry
switch:
- platform: enocean
name: Front door
id: [0x01,0x90,0x84,0x3C]
```

Expand Down
14 changes: 5 additions & 9 deletions source/_components/switch.hikvision.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,14 @@ To use your Hikvision cam in your installation, add the following to your `confi
```yaml
# Example configuration.yaml entry
switch:
platform: hikvisioncam
- platform: hikvisioncam
host: 192.168.1.32
port: 80
name: Hikvision Cam 1 Motion Detection
username: USERNAME
password: PASSWORD
```

Configuration variables:

- **host** (*Required*): The IP address of your Hikvision camera, eg. 192.168.1.32
- **port** (*Optional*): The port to connec to your Hikvision camera. Defaults to 80.
- **host** (*Required*): The IP address of your Hikvision camera, eg. `192.168.1.32`.
- **port** (*Optional*): The port to connec to your Hikvision camera. Defaults to `80`.
- **name** (*Optional*): This parameter allows you to override the name of your camera.
- **username** (*Optional*): The username for accessing your Hikvision camera. Defaults to "admin".
- **password** (*Optional*): The password to access your Hikvision camera. Defaults to "12345".
- **username** (*Optional*): The username for accessing your Hikvision camera. Defaults to `admin`.
- **password** (*Optional*): The password to access your Hikvision camera. Defaults to `12345`.
11 changes: 4 additions & 7 deletions source/_components/switch.mfi.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ To add this platform to your installation, add the following to your `configurat
```yaml
# Example configuration.yaml entry
sensor:
platform: mfi
host: IP_ADDRESS
port: PORT
username: USERNAME
password: PASSWORD
ssl: true
verify_ssl: true
- platform: mfi
host: IP_ADDRESS
username: USERNAME
password: PASSWORD
```

Configuration variables:
Expand Down
40 changes: 30 additions & 10 deletions source/_components/switch.mqtt.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ To enable this switch in your installation, add the following to your `configura
```yaml
# Example configuration.yml entry
switch:
platform: mqtt
name: "Bedroom Switch"
state_topic: "home/bedroom/switch1"
command_topic: "home/bedroom/switch1/set"
payload_on: "ON"
payload_off: "OFF"
optimistic: false
qos: 0
retain: true
value_template: '{% raw %}{{ value.x }}{% endraw %}'
- platform: mqtt
command_topic: "home/bedroom/switch1/set"
```

Configuration variables:
Expand All @@ -53,3 +45,31 @@ Configuration variables:
<p class='note warning'>
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.
</p>

## {% linkable_title Examples %}

In this section you find some real life examples of how to use this sensor.

### {% linkable_title Full configuration %}

The example below shows a full configuration for a switch.

```yaml
# Example configuration.yml entry
switch:
- platform: mqtt
name: "Bedroom Switch"
state_topic: "home/bedroom/switch1"
command_topic: "home/bedroom/switch1/set"
payload_on: "ON"
payload_off: "OFF"
optimistic: false
qos: 0
retain: true
```

For a check you can use the command line tools `mosquitto_pub` shipped with `mosquitto` to send MQTT messages. This allows you to operate your cover manually:

```bash
$ mosquitto_pub -h 127.0.0.1 -t home/bedroom/switch1set -m "ON"
```
1 change: 1 addition & 0 deletions source/_components/switch.mysensors.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ footer: true
logo: mysensors.png
ha_category: Switch
featured: false
ha_iot_class: "Local Push"
---

Integrates MySensors switches into Home Assistant. See the [main component] for configuration instructions.
Expand Down
7 changes: 3 additions & 4 deletions source/_components/switch.mystrom.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ To use your myStrom switch in your installation, add the following to your `conf
```yaml
# Example configuration.yaml entry
switch:
platform: mystrom
host: IP_ADRRESS
name: MyStrom Switch
- platform: mystrom
host: IP_ADRRESS
```

Configuration variables:

- **host** (*Required*): The IP address of your myStrom switch, eg. http://192.168.1.32
- **host** (*Required*): The IP address of your myStrom switch, eg. `http://192.168.1.32`.
- **name** (*Optional*): The name to use when displaying this switch.

Check if you are able to access the device located at `http://IP_ADRRESS`. The details about your switch is provided as a JSON response.
Expand Down
53 changes: 4 additions & 49 deletions source/_components/switch.netio.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ To use Netio devices in your installation, add the following to your `configurat
switch:
- platform: netio
host: 192.168.1.43
port: 1234
username: user
password: pwd
username: YOUR_USERNAME
password: YOUR_PASSWORD
outlets:
1: Free
2: TV
Expand All @@ -34,17 +33,14 @@ switch:

Configuration variables:

- **host** (*Required*): The IP address of your Netio plug, eg. http://192.168.1.32
- **host** (*Required*): The IP address of your Netio plug, eg. `http://192.168.1.32`.
- **port** (*Optional*): The port to communicate with the switch. Defaults to `1234`.
- **username** (*Required*): The username for your plug.
- **password** (*Required*): The password for your plug.
- **outlets** (*Required*) array: List of all outlets.
- **[No.]: [Name]** (*Required*): Identification of an outlet.



To get pushed updates from the Netio devices, one can add this Lua code in the device interface as an action triggered on "Netio" "System variables updated"
with an 'Always' schedule:
To get pushed updates from the Netio devices, one can add this Lua code in the device interface as an action triggered on "Netio" "System variables updated" with an 'Always' schedule:


```lua
Expand All @@ -69,44 +65,3 @@ local url = string.format('http://%s%s?%s', address, path, qs)
devices.system.CustomCGI{url=url}
```





















The `dlink` switch platform allows you to control the state of your [D-Link Wi-Fi Smart Plugs](http://us.dlink.com/product-category/home-solutions/connected-home/smart-plugs/).

Supported devices (tested):

- DSP-W215
- DSP-W110

To use your D-Link smart plugs in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry
switch:
platform: dlink
host: IP_ADRRESS
name: D-Link plug
username: YOUR_USERNAME
password: YOUR_PASSWORD
```



22 changes: 12 additions & 10 deletions source/_components/switch.orvibo.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,29 @@ The `orvibo` switch platform allows you to toggle your Orvibo S20 Wifi Smart Soc
To automatically discover Orvibo sockets on your network:

```yaml
# Example configuration.yaml entry
switch:
platform: orvibo
- platform: orvibo
```

To specify Orvibo sockets and skip discovery:

```yaml
# Example configuration.yaml entry
switch:
platform: orvibo
discovery: false
switches:
- host: IP_ADDRESS
mac: MA:CA:DD:RE:SS:00
name: "My Socket"
- platform: orvibo
discovery: false
switches:
- host: IP_ADDRESS
mac: MA:CA:DD:RE:SS:00
name: "My Socket"
```

Configuration variables:

- **discovery** (*Optional*): Whether to discover sockets (default true).
- **discovery** (*Optional*): Whether to discover sockets. Defaults to `true`.
- **switches** (*Optional*):
- **host** (*Required*): IP address of your socket, eg. 192.168.1.10.
- **mac** (*Optional*): MAC address of the socket, eg "AA:BB:CC:DD:EE:FF". This is required if the socket is connected to a different subnet to the machine running Home Assistant
- **host** (*Required*): IP address of your socket, eg. `192.168.1.10`.
- **mac** (*Optional*): MAC address of the socket, eg "AA:BB:CC:DD:EE:FF". This is required if the socket is connected to a different subnet to the machine running Home Assistant.
- **name** (*Optional*): Your name for the socket.

5 changes: 0 additions & 5 deletions source/_components/switch.pulseaudio_loopback.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ To enable this switch, add the following lines to your `configuration.yaml` file
# Example configuration.yaml entry
switch:
- platform: pulseaudio_loopback
name: mpd1 -> bedroom
host: 127.0.0.1
port: 4712
source_name: mpd1.monitor
sink_name: bedroom
```

Configuration variables:
Expand Down
7 changes: 2 additions & 5 deletions source/_components/switch.rest.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ To enable this switch, add the following lines to your `configuration.yaml` file
```yaml
# Example configuration.yaml entry
switch:
platform: rest
resource: http://IP_ADDRESS/ENDPOINT
name: "Bedroom Switch"
body_on: "ON"
body_off: "OFF"
- platform: rest
resource: http://IP_ADDRESS/ENDPOINT
```

Configuration variables:
Expand Down
2 changes: 2 additions & 0 deletions source/_components/switch.rfxtrx.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ First you have to set up your [rfxtrx hub](/components/rfxtrx/).
The easiest way to find your switches is to add this to your `configuration.yaml`:

```yaml
# Example configuration.yaml entry
switch:
platform: rfxtrx
automatic_add: True
Expand All @@ -34,6 +35,7 @@ Here the name is `0b11000102ef9f210010f70` and you can verify that it works from
Then you should update your configuration to:

```yaml
# Example configuration.yaml entry
switch:
platform: rfxtrx
devices:
Expand Down
Loading