TP-link devices integration using Kasa Cloud API

Hey guys! So, as many of you I found that TP-Link devices (lights, strips and power plugs in my case) are not working using local API after TP-Link updated the firmware. After migrating those devices to Home Assistant I started looking for an easy integration using Kasa Cloud but couldn’t find anything that was easy to plug into HA.

This made me start working on my own integration using bash scripts taht you can find here:
https://github.com/michalmoczynski/homeassistant-tplink-integration

Currently it supports light (more coming soon). I utilizes light template and bash scripts for setting device parameters in the cloud. Also file type sensors are used to update UI state in HA.

Give it a go and let me know what you think. All feedback is welcome!

1 Like

definitely interested in this - i recently moved all my tplink kasa switches over to a new vlan and when i did that they all firmware patched and now the integration to HA is broken…

high hopes you get this working! I bought way too many kasa switches to back out now :frowning:

When attempting to configure this, I ran the getDevices.sh. In the data returned, there wasn’t any “lightid” returned. I did get back, “deviceId” & “oemid” so I wasn’t sure what data to put into the configuration.yaml file. Testing with the deviceId as the lightid the device text file simply returned null values. Any additional guidance would be appreciated!

UPDATE: I went back to look at the scripts and found they were looking for device_id. I modified my configuration.yaml to use the device_id for 5 switches. I made sure to correlate the sensors with the light templates. After restarting, all 5 device text files in config/scripts/tplink-kasa/devices has this: " null,null,null,null,null" and I do not have control of the lights via HA. I’m at a road block.

Hey G3tiTD0n3, sorry for the late answer. I’m bit swamped with work this week but I was going to get back to it as soon as I have some more time.
After running getDevices.sh does it create a kasa-devices file for you? That should be a json response from kasa cloud with all your devices (including "deviceId"s). Let me know if you’re getting this file, if not maybe variables.sh are not being included properly? if that’s the case potentially the source path may need to be different. Are you using a docker for Home Assistant?

Does anyone use this?
I have a couple of kasa plugs that I would like to use in a remote location. I think this may be the perfect integration.
Has anyone had any luck with this?

Thanks

2 Likes

Any luck with your request?
I’m in the same situation: local smartplugs via the standard integration but some extra plugs in another home where I do not have any hassio instance running
Would be really nice if someone had a solution for our case

Cheers,
Laurent

1 Like