A custom HomeAssistant integration that allows you to integrate a few TPLink/Kasa/Tapo devices by the cloud interface. This integration relies extensively on the base TP-Link Smart Home integration as well as the underlying python-kasa library.
Configuration via Homeassistant UI.
This integration is antithetical to the ethos of HomeAssistant which advocates direct local control of your IoT devices. What about devices not on your local network? I'd still advocate accessing these devices via VPN using the core TP-Link Smart Home integration.
What about devices that you want to add to your HomeAssistant instance that are network where you cannot setup a VPN. In my case devices attached to my condo utility room network? You have two solutions:
- Connect the device via another hub like Amazon Alexa then connect your HomeAssitant to that cloud hub... Ouch.
- Utilizing TP-Link's cloud to control the device. (Much simipiler).
The recommended way to install this is via HACS:
-
Click on HACS in the Homeassistant side bar
-
Click on the three dots in the upper right-hand corner and select "Custom repositories."
-
In the form enter:
- Respository:
iluvdata/tplink_cloud - Select "Integration" as "Type"
- Respository:
Copy the tplink_cloud directory to the custom_components directory of your Homeassistant Instance.
Add the intergration to Home Assistant:
Enter you username and password you used to setup your device and connect to the TP-Link Cloud. Unlike most intergrations- this integration will not store your password as the TP-Link Cloud uses access tokens.
Once connected the intergration will add ALL active cloud devices to your home assistance instance. You should disable any device you don't want to use. NOTE: In the future, I may implement the ability to select which devices to add to HomeAssistant.
There are two options to configure. The defaults should be sufficient for most use cases.
- Device List Poll Interval. The frequency at which the integration looks for new devices. Default is 30 mins. Setting this too low will get you temporarily blocked on the api.
- Device Poll Interval. The frequency at which device states are refreshed. 1 min is the default. 30 seconds has worked as well. It's not clear if more frequent will result in a temporary block.
When the integration polls the cloud (see Device List Poll Interval above) and a new device is discovered and can be added through a discovery flow.
I don't have a ton of the devices but it would seem that any device that utilizes the IoT Protocol (not the Smart protocol used by Tapo devices and newer Kasa devices) will work as the cloud just passes through requests to and from the device. Tested with:
- Plugs
- HS100 hw ver 1 and 2
- KL115
- Switches
- HS200
- Bulbs
- KS125
- KS135
If you're interested in testing other devices I suggest using the underlying library pykasacloud to first connect to the device and enabling debug logging. If you need assistance submit an Issue on github.
If there is enough interest I will approach the contributors of the python-kasa library and the core HomeAssistant integration about add cloud functionality to these integrations.