home-assistant.github.io/source/_components/switch.tplink.markdown
jumpkick 44b7e5fca3 IP address without protocol, otherwise it errors (#2053)
This is the error if you provide http://IP_ADDRESS as the example shows.
```ERROR:homeassistant.components.switch:Error while setting up platform tplink
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/switch/tplink.py", line 40, in setup_platform
    add_devices([SmartPlugSwitch(SmartPlug(host), name)], True)
  File "/home/ged/.homeassistant/deps/pyHS100/pyHS100.py", line 78, in __init__
    socket.inet_pton(socket.AF_INET, ip_address)
OSError: illegal IP address string passed to inet_pton```
2017-02-16 10:06:55 +01:00

39 lines
864 B
Markdown

---
layout: page
title: "TPLink Switch"
description: "Instructions how to integrate TPLink switches into Home Assistant."
date: 2016-07-13 08:00
sidebar: true
comments: false
sharing: true
footer: true
logo: tp-link.png
ha_category: Switch
ha_iot_class: "Local Polling"
ha_release: "0.24"
---
The `tplink` switch platform allows you to control the state of your [TPLink smart switch](http://www.tp-link.com/en/products/list-5258.html).
Supported units:
- HS100
- HS110
- HS200
To use your TPLink switch in your installation, add the following to your `configuration.yaml` file:
```yaml
# Example configuration.yaml entry
switch:
- platform: tplink
host: IP_ADRRESS
```
Configuration variables:
- **host** (*Required*): The IP address of your TP-Link switch, eg. `192.168.1.32`.
- **name** (*Optional*): The name to use when displaying this switch.