diff --git a/source/_components/switch.acer_projector.markdown b/source/_components/switch.acer_projector.markdown index fac3494da63f..a918b6d9a699 100644 --- a/source/_components/switch.acer_projector.markdown +++ b/source/_components/switch.acer_projector.markdown @@ -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: diff --git a/source/_components/switch.arest.markdown b/source/_components/switch.arest.markdown index 9307e029539c..7960e1ff54ad 100644 --- a/source/_components/switch.arest.markdown +++ b/source/_components/switch.arest.markdown @@ -20,14 +20,13 @@ 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: @@ -35,14 +34,14 @@ If you want to use custom functions, then add the following to your `configurati ```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: diff --git a/source/_components/switch.command_line.markdown b/source/_components/switch.command_line.markdown index 197343e2110d..5b0f4f14578f 100644 --- a/source/_components/switch.command_line.markdown +++ b/source/_components/switch.command_line.markdown @@ -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: @@ -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 %} diff --git a/source/_components/switch.dlink.markdown b/source/_components/switch.dlink.markdown index a0b8424f2343..8e52b91a2a09 100644 --- a/source/_components/switch.dlink.markdown +++ b/source/_components/switch.dlink.markdown @@ -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: diff --git a/source/_components/switch.edimax.markdown b/source/_components/switch.edimax.markdown index b3e51d1c33e7..028b64d61a29 100644 --- a/source/_components/switch.edimax.markdown +++ b/source/_components/switch.edimax.markdown @@ -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. diff --git a/source/_components/switch.enocean.markdown b/source/_components/switch.enocean.markdown index df6f6f47871b..880e5ec03acc 100644 --- a/source/_components/switch.enocean.markdown +++ b/source/_components/switch.enocean.markdown @@ -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] ``` diff --git a/source/_components/switch.hikvision.markdown b/source/_components/switch.hikvision.markdown index 6fa0aedba408..19342fed4d0a 100644 --- a/source/_components/switch.hikvision.markdown +++ b/source/_components/switch.hikvision.markdown @@ -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`. diff --git a/source/_components/switch.mfi.markdown b/source/_components/switch.mfi.markdown index 5e7f850a7f32..4ff90c198719 100644 --- a/source/_components/switch.mfi.markdown +++ b/source/_components/switch.mfi.markdown @@ -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: diff --git a/source/_components/switch.mqtt.markdown b/source/_components/switch.mqtt.markdown index 2b5c4860985e..5354acff9927 100644 --- a/source/_components/switch.mqtt.markdown +++ b/source/_components/switch.mqtt.markdown @@ -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: @@ -53,3 +45,31 @@ Configuration variables:
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.
+ +## {% 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" +``` diff --git a/source/_components/switch.mysensors.markdown b/source/_components/switch.mysensors.markdown index 1e9b9a11dd05..b1bed580c35e 100644 --- a/source/_components/switch.mysensors.markdown +++ b/source/_components/switch.mysensors.markdown @@ -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. diff --git a/source/_components/switch.mystrom.markdown b/source/_components/switch.mystrom.markdown index ce1652662b64..9c9c01e493b5 100644 --- a/source/_components/switch.mystrom.markdown +++ b/source/_components/switch.mystrom.markdown @@ -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. diff --git a/source/_components/switch.netio.markdown b/source/_components/switch.netio.markdown index 14b875702845..380001bc2de8 100644 --- a/source/_components/switch.netio.markdown +++ b/source/_components/switch.netio.markdown @@ -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 @@ -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 @@ -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 -``` - - - diff --git a/source/_components/switch.orvibo.markdown b/source/_components/switch.orvibo.markdown index 5f8efc3892d0..30516626dfcd 100644 --- a/source/_components/switch.orvibo.markdown +++ b/source/_components/switch.orvibo.markdown @@ -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. diff --git a/source/_components/switch.pulseaudio_loopback.markdown b/source/_components/switch.pulseaudio_loopback.markdown index 33ff6c879275..116c5d4fbd04 100644 --- a/source/_components/switch.pulseaudio_loopback.markdown +++ b/source/_components/switch.pulseaudio_loopback.markdown @@ -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: diff --git a/source/_components/switch.rest.markdown b/source/_components/switch.rest.markdown index b2c7e027112f..98d88fa3ba1d 100644 --- a/source/_components/switch.rest.markdown +++ b/source/_components/switch.rest.markdown @@ -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: diff --git a/source/_components/switch.rfxtrx.markdown b/source/_components/switch.rfxtrx.markdown index b5cfb786b6dc..372aaa76f2a2 100644 --- a/source/_components/switch.rfxtrx.markdown +++ b/source/_components/switch.rfxtrx.markdown @@ -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 @@ -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: diff --git a/source/_components/switch.rpi_gpio.markdown b/source/_components/switch.rpi_gpio.markdown index 2cff44f0ed0b..691a1bd61d24 100644 --- a/source/_components/switch.rpi_gpio.markdown +++ b/source/_components/switch.rpi_gpio.markdown @@ -20,11 +20,10 @@ To use your Raspberry Pi's GPIO in your installation, add the following to your ```yaml # Example configuration.yaml entry switch: - platform: rpi_gpio - ports: - 11: Fan Office - 12: Light Desk - invert_logic: false + - platform: rpi_gpio + ports: + 11: Fan Office + 12: Light Desk ``` Configuration variables: diff --git a/source/_components/switch.scsgate.markdown b/source/_components/switch.scsgate.markdown index d09b50de07c3..5067dc0f0f1b 100644 --- a/source/_components/switch.scsgate.markdown +++ b/source/_components/switch.scsgate.markdown @@ -19,11 +19,10 @@ To enable SCSGate switches in your installation, add the following to your `conf ```yaml # Example configuration.yaml entry switch: - platform: scsgate - devices: - living_room: - name: Living Room - scs_id: XXXXX + - platform: scsgate + devices: + living_room: + scs_id: XXXXX ``` Configuration variables: diff --git a/source/_components/switch.tellduslive.markdown b/source/_components/switch.tellduslive.markdown index eb2002814ab8..4477289a8761 100644 --- a/source/_components/switch.tellduslive.markdown +++ b/source/_components/switch.tellduslive.markdown @@ -12,6 +12,5 @@ ha_category: Switch featured: false --- -Integrates Telldus Live switches into Home Assistant. See the [main component] for configuration instructions. +Integrates Telldus Live switches into Home Assistant. See the [main component](/components/tellduslive/) for configuration instructions. -[main component]: /components/tellduslive/ diff --git a/source/_components/switch.tellstick.markdown b/source/_components/switch.tellstick.markdown index cb00059fc537..9c1ed88d73d6 100644 --- a/source/_components/switch.tellstick.markdown +++ b/source/_components/switch.tellstick.markdown @@ -20,5 +20,5 @@ To use your TellStick device, you first have to set up your [Tellstick hub](http ```yaml # Example configuration.yaml entry switch: - platform: tellstick + - platform: tellstick ``` diff --git a/source/_components/switch.template.markdown b/source/_components/switch.template.markdown index 971b0824d400..25a05f6a4e4a 100644 --- a/source/_components/switch.template.markdown +++ b/source/_components/switch.template.markdown @@ -27,7 +27,6 @@ switch: - platform: template switches: skylight: - friendly_name: 'Skylight' value_template: {% raw %}'{{ is_state('sensor.skylight', 'on') }}'{% endraw %} turn_on: service: switch.turn_on diff --git a/source/_components/switch.thinkingcleaner.markdown b/source/_components/switch.thinkingcleaner.markdown index a9d41bbffb0f..19304fb0b4c7 100644 --- a/source/_components/switch.thinkingcleaner.markdown +++ b/source/_components/switch.thinkingcleaner.markdown @@ -20,7 +20,7 @@ To enable this switch in your installation, add the following to your `configura ```yaml # Example configuration.yaml entry switch: - platform: thinkingcleaner + - platform: thinkingcleaner ``` This will automatically add switches for each Thinking Cleaner in your network. diff --git a/source/_components/switch.tplink.markdown b/source/_components/switch.tplink.markdown index 3ae81fb44f82..750c0cc86892 100644 --- a/source/_components/switch.tplink.markdown +++ b/source/_components/switch.tplink.markdown @@ -24,14 +24,13 @@ To use your TPLink switch in your installation, add the following to your `confi ```yaml # Example configuration.yaml entry switch: - platform: tplink - host: IP_ADRRESS - name: TP-Link Switch + - platform: tplink + 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. diff --git a/source/_components/switch.wake_on_lan.markdown b/source/_components/switch.wake_on_lan.markdown index c9d334435928..87ac2410ba7d 100644 --- a/source/_components/switch.wake_on_lan.markdown +++ b/source/_components/switch.wake_on_lan.markdown @@ -23,10 +23,8 @@ To enable this switch in your installation, add the following to your `configura ```yaml # Example configuration.yml entry switch: - platform: wake_on_lan - mac_address: "00-01-02-03-04-05" - name: "WOL" - host: "192.168.1.1" + - platform: wake_on_lan + mac_address: "00-01-02-03-04-05" ``` Configuration variables: