TP-Link Smart Home Devices

The tplink component allows you to control your TP-Link Smart Home Devices such as smart plugs and smart bulbs.

There is currently support for the following device types within Home Assistant:

In order to activate the support, you will have to enable the integration inside the config panel. The supported devices in your network are automatically discovered, but if you want to control devices residing in other networks you will need to configure them manually as shown below.

Supported Devices

This component supports devices that are controllable with the KASA app. The following devices are known to work with this component.


  • HS100
  • HS103
  • HS105
  • HS110

Wall Switches

  • HS200
  • HS210
  • HS220 (acts as a light)


  • LB100
  • LB110
  • LB120
  • LB130
  • LB230
  • KL110
  • KL120
  • KL130


# Example configuration.yaml

Configuration Variables


(boolean)(Optional)Whether to do automatic discovery of devices.

Default value: true


(list)(Optional)List of light devices.


(string)(Required)Hostname or IP address of the device.


(list)(Optional)List of switch devices.


(string)(Required)Hostname or IP address of the device.

Manual configuration example

# Example configuration.yaml entry with manually specified addresses
  discovery: false
    - host:
    - host:
    - host:
    - host:

Extracting Energy Sensor data

In order to get the power consumption readings from supported devices, you’ll have to create a template sensor. In the example below, change all of the my_tp_switch’s to match your device’s entity ID.

  - platform: template
        friendly_name_template: "{{}} Current"
        value_template: '{{ states.switch.my_tp_switch.attributes["current_a"] | float }}'
        unit_of_measurement: 'A'
        friendly_name_template: "{{}} Current Consumption"
        value_template: '{{ states.switch.my_tp_switch.attributes["current_power_w"] | float }}'
        unit_of_measurement: 'W'
        friendly_name_template: "{{}} Total Consumption"
        value_template: '{{ states.switch.my_tp_switch.attributes["total_energy_kwh"] | float }}'
        unit_of_measurement: 'kWh'
        friendly_name_template: "{{}} Voltage"
        value_template: '{{ states.switch.my_tp_switch.attributes["voltage"] | float }}'
        unit_of_measurement: 'V'
        friendly_name_template: "{{}} Today's Consumption"
        value_template: '{{ states.switch.my_tp_switch.attributes["today_energy_kwh"] | float }}'
        unit_of_measurement: 'kWh'

Presence detection

The tplink platform allows you to detect presence by looking at connected devices to a TP-Link router.

Currently supported devices includes the following:

  • Archer C7 firmware version 150427
  • Archer C9 firmware version 150811
  • EAP-225 AP with latest firmware version
  • Archer D9 firmware version 0.9.1 0.1 v0041.0 Build 160224 Rel.59129n

TP-Link devices typically only allow one login at a time to the admin console. This component will count towards your one allowed login. Depending on how aggressively you configure device_tracker you may not be able to access the admin console of your TP-Link device without first stopping Home Assistant. Home Assistant takes a few seconds to login, collect data, and log out. If you log into the admin console manually, remember to log out so that Home Assistant can log in again.


To enable this device tracker, add the following lines to your configuration.yaml:

# Example configuration.yaml entry
  - platform: tplink
    host: YOUR_ROUTER_IP

Configuration Variables


(string)(Required)The IP address of your router, e.g.,


(string)(Required)The username of an user with administrative privileges, usually admin. The Archer D9 last firmware does not require a username.


(string)(Required)The password for your given admin account.

For Archer C9 models running firmware version 150811 or later please use the encrypted password you can retrieve like this:

  1. Go to the login page of your router. (default:
  2. Type in the password you use to login into the password field.
  3. Click somewhere else on the page so that the password field is not selected anymore.
  4. Open the JavaScript console of your browser (usually by pressing F12 and then clicking on “Console”).
  5. Type document.getElementById("login-password").value; or document.getElementById("pcPassword").value;, depending on your firmware version.
  6. Copy the returned value to your Home Assistant configuration as password.

See the device tracker component page for instructions how to configure the people to be tracked.

For Archer D9 model the default ip is, the username is not necessary and you can leave that field blank.