TP-Link Smart Home
The tplink
integration allows you to control your TP-Link Kasa Smart Home Devices
How you can use this integration
The TP-Link integration lets you do many things, such as switching devices on and off based on schedules or events, monitoring energy usage in the Home Assistant dashboards, viewing live camera feeds, and controlling device configurations manually or via automations.
Prerequisites
You need to provision your newly purchased device to connect to your network before it can be added via the integration. This can be done either by using kasa command-line tool
If your device is a newer Kasa or Tapo device it will require your TP-Link cloud username and password to authenticate for local access. If you have an older device that does not currently require authentication, you may consider disabling automatic firmware updates to keep it that way.
Configuration
To add the TP-Link Smart Home integration to your Home Assistant instance, use this My button:
TP-Link Smart Home can be auto-discovered by Home Assistant. If an instance was found, it will be shown as Discovered. You can then set it up right away.
Manual configuration steps
If it wasn’t discovered automatically, don’t worry! You can set up a manual integration entry:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select TP-Link Smart Home.
-
Follow the instructions on screen to complete the setup.
Your TP-Link cloud username which is your case-sensitive email address. Required for Tapo and newer Kasa devices.
Checkbox to enable live view will create the live view camera entity for Tapo cameras. Requires your camera account credentials which you set up from the Tapo app under Device Settings > Advanced Settings > Camera Account.
Supported Devices
See Supported Devices in python-kasa
Devices not listed below may work but if you encounter issues submit a bug report to python-kasa
The hub attached Tapo buttons S200B and S200D, which do not currently support alerting when the button is pressed.
Some firmware versions of Tapo Cameras will not authenticate unless you enable Tapo Lab > Third-Party Compatibility in the native Tapo app. Alternatively, you can factory reset and then prevent the device from accessing the internet.
Supported Kasa devices
- Plugs: EP10, EP251, HS1002, HS103, HS105, HS110, KP100, KP105, KP115, KP125, KP125M1, KP401
- Power Strips: EP40, EP40M1, HS107, HS300, KP200, KP303, KP400
- Wall Switches: ES20M, HS2002, HS210, HS2202, KP405, KS200, KS200M, KS2051, KS220, KS220M, KS2251, KS230, KS2401
- Bulbs: KL110, KL120, KL125, KL130, KL135, KL50, KL60, LB110
- Light Strips: KL400L5, KL420L5, KL430
- Hubs: KH1001
- Hub-Connected Devices3: KE1001
Supported Tapo1 devices
- Plugs: P100, P110, P110M, P115, P125M, P135, TP15
- Power Strips: P210M, P300, P304M, P306, TP25
- Wall Switches: S500D, S505, S505D
- Bulbs: L510B, L510E, L530E, L630
- Light Strips: L900-10, L900-5, L920-5, L930-5
- Cameras: C100, C210, C225, C325WB, C520WS, TC65, TC70
- Hubs: H100, H200
- Hub-Connected Devices3: S200B, S200D, T100, T110, T300, T310, T315
Supported functionality
Cameras
Only Tapo cameras are currently supported.
In order for live view to work, you will need to enable your camera account in the Tapo App under Device Settings > Advanced Settings > Camera Account.
If you do not want to do this, keep Live view unchecked when adding the device. This can be changed at a later date using the reconfigure
option on the integration entry.
Depending on the supported features of the camera, you can control various settings such as privacy mode, pan/tilt, and motion detection alerts.
Lights
Light entities are added for bulbs, light strips, and dimmer switches. Depending on the supported features of the device, the integration will allow changing brightness, color, color temperature, and light effects.
If light effects are supported by a device, they can be selected from the bottom of the light card. Light presets are also supported and can be set via the config preset drop down on the device page.
Depending on the supported features of the device you can control various other configuration settings such as on/off transitions and auto-on/off.
Plugs and switches
Switch entities are added for plugs, simple wall switches and power strips. In addition to turning devices on and off, you can control the various configuration options that the device supports, such as auto-on/off and automatic firmware updates.
Energy monitoring
If a device supports energy monitoring sensors will be created for consumption metrics which can be fed into the Home Assistant energy dashboard.
Hub-attached devices
Various hub attached devices are supported such as those providing climate control, motion detection, humidity monitoring and water leak detection.
Data updates
Devices are polled for data updates every 5 seconds. When you make changes through Home Assistant (e.g., switching a device on), the device’s state is updated immediately rather than waiting for the next poll. The integration connects locally to the devices without going via the TP-Link cloud. This is different from the native Tapo and Kasa apps which will connect to the devices via the TP-Link cloud if the device has access to the internet.
Known limitations
Camera connections
Some firmware versions of Tapo Cameras will not authenticate unless you enable Tapo Lab > Third-Party Compatibility in the native Tapo app. Alternatively, you can factory reset and then prevent the device from accessing the internet.
Subnets and discovery
If devices are on a different subnet to Home Assistant, automatic discovery will not work. In this instance it is recommended to add devices by IP address and configure them with static IP addresses to prevent issues when IP addresses change.
Buttons
The hub-attached Tapo buttons S200B and S200D, do not currently support alerting when the button is pressed.
Hub-attached cameras
Hub attached cameras will be supported in the future. Due to battery considerations they do not support live view.
No light effects on kasa bulbs
Light effects are currently not supported on Kasa bulbs.
Kasa power strips
Due to limitations of the devices, the energy monitoring state of Kasa power strip child plugs is only updated every 60 seconds.
If required, you can manually trigger an update via Developer tools > Actions > Home Assistant Core Integration: Update entity passing a list of the child entities.
Troubleshooting
Device connections
- Take note of the known limitation for subnets above.
- Try switching the device off for 5 seconds before switching back on again.
- Check the supported device list to see if the device is tested to work with the integration.
- Try running the kasa tool
to connect to the device. An easy way to do this is to install uv and run uvx --from python-kasa kasa --username <tplink cloud username> --password <tplink cloud password>
- Raise a support issue
Unavailable entities
Some entities might be showing as Unavailable if they have been removed from the integration.
Total consumption sensor
This entity is only reported by older kasa devices. Currently, Tapo devices and newer Kasa devices do not report total consumption, although briefly during 2024.6, they incorrectly reported today’s consumption as “total consumption.” You can safely delete this entity if it is reported as unavailable on a newer Kasa or Tapo device.
Update available sensor
This entity has been removed from the integration due to stability issues, calling the TPLink cloud API to check for updates. It will be replaced in a future release with a new Update entity, but if you have an Unavailable entity ID starting with binary_sensor.
and ending with update
, you can safely delete it.
Examples
Automation ideas
- Turn on lights when it gets dark and turn them off again with a voice command.
- Turn off privacy mode and turn on motion detection for internal cameras when you leave home (with geofencing) and toggle back when you get home.
Light effect services
There are two services for light effects that can be used in automations.
These are available on devices that support light effects such as bulbs and light strips, except for kasa bulbs
Random Effect - Action tplink.random_effect
Light strips allow setting a random effect.
Data attribute | Description |
---|---|
entity_id |
The entity_id of the light strip to set the effect on |
init_states |
Initial HSV sequence |
backgrounds |
List of HSV sequences (Max 16) |
segments |
List of segments (0 for all) |
brightness |
Initial brightness |
duration |
Duration |
transition |
Transition |
fadeoff |
Fade off |
hue_range |
Range of hue |
saturation_range |
Range of saturation |
brightness_range |
Range of brightness |
transition_range |
Range of transition |
random_seed |
Random seed |
#Example action
action: tplink.random_effect
target:
entity_id:
- light.strip
data:
init_states: 199,99,96
backgrounds:
- - 199
- 89
- 50
- - 160
- 50
- 50
- - 180
- 100
- 50
segments: 0, 2, 4, 6, 8
brightness: 90
transition: 2000
fadeoff: 2000
hue_range: 340, 360
saturation_range: 40, 95
brightness_range: 90, 100
transition_range: 2000, 6000
random_seed: 80
Sequence Effect - Action tplink.sequence_effect
Light strips allow setting a sequence effect.
Data attribute | Description |
---|---|
entity_id |
The entity_id of the light strip to set the effect on |
sequence |
List of HSV sequences (Max 16) |
segments |
List of segments (0 for all) |
brightness |
Initial brightness |
duration |
Duration |
repeat_times |
Repetitions (0 for continuous) |
transition |
Transition |
spread |
Speed of spread |
direction |
Direction |
#Example action
action: tplink.sequence_effect
target:
entity_id:
- light.strip
data:
sequence:
- - 340
- 20
- 50
- - 20
- 50
- 50
- - 0
- 100
- 50
segments: 0, 2, 4, 6, 8
brightness: 80
transition: 2000
spread: 1
direction: 1
Removing the integration
This integration follows standard integration removal. No extra steps are required.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three-dot
menu. Then, select Delete.