[DEPRECATED] Kasa Plug, Switch, and Bulb integration

A lot of discussion on finding devices. Aside from Static IP address, see the below:

WRT Migrating from Community App what is the correct method to uninstall the deprecated app?

  1. Do I need to manually delete all Kasa devices ...
    Using the devices list
    Using the Kasa app "Remove Kasa Devices"

  2. Then use HPM to uninstall "Kasa Plugs Switches and Bulbs"

  3. Install the built in app

  4. Discover Kasa devices

  5. Fix any RM apps that failed

looks, except you can simply open the Kasa App and delete it (the Kasa app). That will remove the associated devices.

Thanks for the response ... i finally got some time to do the update. I has a few hiccups (I can publish the process if anyone is interested) ... but the built-in app is running!!! :smiley:

Using the built in integration, I added a couple more bulbs at a remote location but hubitat will not detect them, even though they are in my cloud Kasa account. Any thoughts?

What do you mean by remote location?

On a different wireless network at my dads house.

I added a few bulbs there a couple weeks ago, and ran detection and it picked them up as cloud devices. They still work and are controllable from hubitat.

I just added two more bulbs, but detection isn't picking them up in the integration. (I do see them in the kasa app, and are controllable there)

Here's the logs with debugging turned on.

app:8622024-04-01 08:06:24.099 AMinfoKasa Integration : updated: Updating device configurations and (if cloud enabled) Kasa Token
app:8622024-04-01 08:06:22.529 AMinfoKasa Integration : starting Kasa Integration
app:8622024-04-01 08:06:20.842 AMinfoKasa Integration : addDevStatus
app:8622024-04-01 08:06:20.826 AMinfoKasa Integration : addDevices: [selectedDevices: null]
app:8622024-04-01 08:05:58.926 AMinfoKasa Integration : [method:updateChildren, Office Strip Plug 1:[commsError:false], Office Uplight:[commsError:false], 3D Printer:[commsError:false], Testplug2:[commsError:true], Test Color Bulb:[commsError:true], Testplug3:[commsError:true], TPLOutdoor1a:[commsError:true], TPLOutdoor1b:[commsError:true], Testplug1:[commsError:false], House Garage Flood:[commsError:false], Porch Outlet 2:[commsError:false], Porch Outlet 1:[commsError:false], Deck Outlet 2:[commsError:false], Deck Outlet 1:[commsError:false], Wall Post:[commsError:false], Garage Lower Lights:[commsError:false, ip:10.40.40.103, port:9999], Testplug4:[commsError:false], Trinket Hutch:[commsError:false, ip:CLOUD, port:CLOUD], Dad Kitchen 1:[status:No update. CLOUD Device.], DadPlugRadio:[status:No update. CLOUD Device.], Dad Couch Right:[status:No update. CLOUD Device.], Dad Kitchen 2:[status:No update. CLOUD Device.], Dad Couch Left:[status:No update. CLOUD Device.]]
app:8622024-04-01 08:05:53.790 AMdebugKasa Integration : [method:cloudGetDevices, status:added cloud-only devices]
app:8622024-04-01 08:05:53.788 AMdebugKasa Integration : [ignoredDevice:E4FAC4885890, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.786 AMdebugKasa Integration : [ignoredDevice:E4FAC49C2116, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.784 AMdebugKasa Integration : [ignoredDevice:403F8CCA3D22, reason:already in array]
app:8622024-04-01 08:05:53.782 AMdebugKasa Integration : [ignoredDevice:403F8CCA3933, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.780 AMdebugKasa Integration : [ignoredDevice:3C52A14CD3C4, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.778 AMdebugKasa Integration : [ignoredDevice:3C52A14D1704, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.776 AMdebugKasa Integration : [ignoredDevice:6C5AB016009B, reason:already in array]
app:8622024-04-01 08:05:53.774 AMdebugKasa Integration : [ignoredDevice:005F67AF5837, reason:already in array]
app:8622024-04-01 08:05:53.771 AMdebugKasa Integration : [ignoredDevice:E848B8D79E37, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.769 AMdebugKasa Integration : [ignoredDevice:84D81B480E4D, reason:already in array]
app:8622024-04-01 08:05:53.767 AMdebugKasa Integration : [ignoredDevice:6C5AB01FA952, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.765 AMdebugKasa Integration : [ignoredDevice:403F8CCA486E, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.763 AMdebugKasa Integration : [ignoredDevice:54AF9707A5CC, reason:not controllable via cloud]
app:8622024-04-01 08:05:53.761 AMdebugKasa Integration : [method:parseDeviceData, alias:Trinket Hutch, type:Kasa Light Strip, ip:CLOUD, port:CLOUD, status:added to array]
app:8622024-04-01 08:05:53.758 AMdebugKasa Integration : [method:createDevice, device:[dni:40:ED:00:8A:85:1F, ip:CLOUD, port:CLOUD, type:Kasa Light Strip, rssi:-48, feature:lightStrip, model:KL400, alias:Trinket Hutch, deviceId:80121F963B5F77C02BCF61E9FB83B42F216A4ED2]]
app:8622024-04-01 08:05:52.944 AMdebugKasa Integration : [ignoredDevice:005F67B1647B, reason:already in array]
app:8622024-04-01 08:05:52.942 AMdebugKasa Integration : [ignoredDevice:84D81B47E767, reason:already in array]
app:8622024-04-01 08:05:52.940 AMdebugKasa Integration : [ignoredDevice:E4FAC48858B2, reason:not controllable via cloud]
app:8622024-04-01 08:05:52.937 AMdebugKasa Integration : [method:parseDeviceData, alias:House Garage Flood, type:Kasa Dimming Switch, ip:CLOUD, port:CLOUD, status:added to array]
app:8622024-04-01 08:05:52.935 AMdebugKasa Integration : [method:createDevice, device:[dni:2887BA21FF90, ip:CLOUD, port:CLOUD, type:Kasa Dimming Switch, rssi:-58, feature:dimmingSwitch, model:HS220, alias:House Garage Flood, deviceId:8006B8EBB3695CEAAF4260051AA29F9C1FE14F6E]]
app:8622024-04-01 08:05:52.176 AMdebugKasa Integration : [ignoredDevice:E4FAC49C2C47, reason:not controllable via cloud]
app:8622024-04-01 08:05:52.173 AMdebugKasa Integration : [ignoredDevice:005F67AF5436, reason:already in array]
app:8622024-04-01 08:05:51.466 AMinfoKasa Integration : [method:findDevices, activity:cloudGetDevices]
app:8622024-04-01 08:05:45.695 AMdebugKasa Integration : [method:parseDeviceData, alias:Wall Post, type:Kasa Plug Switch, ip:10.40.40.104, port:9999, status:added to array]
app:8622024-04-01 08:05:45.693 AMdebugKasa Integration : [method:createDevice, device:[dni:84D81B480E4D, ip:10.40.40.104, port:9999, type:Kasa Plug Switch, rssi:-73, feature:TIM, model:HS200, alias:Wall Post, deviceId:8006EF0945226EDA3D2D3D1135D35DFC1D8EE85D]]
app:8622024-04-01 08:05:45.686 AMdebugKasa Integration : [method:parseDeviceData, alias:Testplug1, type:Kasa Plug Switch, ip:10.40.40.106, port:9999, status:added to array]
app:8622024-04-01 08:05:45.684 AMdebugKasa Integration : [method:createDevice, device:[dni:005F67B1647B, ip:10.40.40.106, port:9999, type:Kasa Plug Switch, rssi:-43, feature:TIM:ENE, model:KP115, alias:Testplug1, deviceId:8006D6AF914501C784EC9EE24AEA29E11E48901F]]
app:8622024-04-01 08:05:45.676 AMdebugKasa Integration : [method:parseDeviceData, alias:Office Uplight, type:Kasa Plug Switch, ip:10.40.40.109, port:9999, status:added to array]
app:8622024-04-01 08:05:45.674 AMdebugKasa Integration : [method:createDevice, plugNo:02, device:[dni:6C5AB016009B02, ip:10.40.40.109, port:9999, type:Kasa Plug Switch, rssi:-72, feature:TIM, model:KP303, alias:Office Uplight, deviceId:80068CB7AD9B1C8F36D779052B62EDB81F18C88E, plugNo:02, plugId:80068CB7AD9B1C8F36D779052B62EDB81F18C88E02]]
app:8622024-04-01 08:05:45.671 AMdebugKasa Integration : [method:createDevice, plugNo:01, device:[dni:6C5AB016009B01, ip:10.40.40.109, port:9999, type:Kasa Plug Switch, rssi:-72, feature:TIM, model:KP303, alias:3D Printer, deviceId:80068CB7AD9B1C8F36D779052B62EDB81F18C88E, plugNo:01, plugId:80068CB7AD9B1C8F36D779052B62EDB81F18C88E01]]
app:8622024-04-01 08:05:45.669 AMdebugKasa Integration : [method:createDevice, plugNo:00, device:[dni:6C5AB016009B00, ip:10.40.40.109, port:9999, type:Kasa Plug Switch, rssi:-72, feature:TIM, model:KP303, alias:Office Strip Plug 1, deviceId:80068CB7AD9B1C8F36D779052B62EDB81F18C88E, plugNo:00, plugId:80068CB7AD9B1C8F36D779052B62EDB81F18C88E00]]
app:8622024-04-01 08:05:45.578 AMdebugKasa Integration : [method:parseDeviceData, alias:Garage Lower Lights, type:Kasa Plug Switch, ip:10.40.40.103, port:9999, status:added to array]
app:8622024-04-01 08:05:45.575 AMdebugKasa Integration : [method:createDevice, device:[dni:84D81B47E767, ip:10.40.40.103, port:9999, type:Kasa Plug Switch, rssi:-45, feature:TIM, model:HS200, alias:Garage Lower Lights, deviceId:8006907C4302A202C5EE82F88AED80141D8D7108]]
app:8622024-04-01 08:05:45.567 AMdebugKasa Integration : [method:parseDeviceData, alias:Deck Outlet 2, type:Kasa Plug Switch, ip:10.40.40.105, port:9999, status:added to array]
app:8622024-04-01 08:05:45.564 AMdebugKasa Integration : [method:createDevice, plugNo:01, device:[dni:005F67AF583701, ip:10.40.40.105, port:9999, type:Kasa Plug Switch, rssi:-79, feature:TIM, model:KP200, alias:Deck Outlet 2, deviceId:800660106CB530FA2927BBD9B76C31601E3CF93C, plugNo:01, plugId:800660106CB530FA2927BBD9B76C31601E3CF93C01]]
app:8622024-04-01 08:05:45.561 AMdebugKasa Integration : [method:createDevice, plugNo:00, device:[dni:005F67AF583700, ip:10.40.40.105, port:9999, type:Kasa Plug Switch, rssi:-79, feature:TIM, model:KP200, alias:Deck Outlet 1, deviceId:800660106CB530FA2927BBD9B76C31601E3CF93C, plugNo:00, plugId:800660106CB530FA2927BBD9B76C31601E3CF93C00]]
app:8622024-04-01 08:05:45.551 AMdebugKasa Integration : [method:parseDeviceData, alias:Testplug4, type:Kasa Plug Switch, ip:10.40.40.113, port:9999, status:added to array]
app:8622024-04-01 08:05:45.549 AMdebugKasa Integration : [method:createDevice, device:[dni:403F8CCA3D22, ip:10.40.40.113, port:9999, type:Kasa Plug Switch, rssi:-60, feature:TIM:ENE, model:KP115, alias:Testplug4, deviceId:8006EED51EF808276130683B1A3216AB1DD4BDC8]]
app:8622024-04-01 08:05:45.540 AMdebugKasa Integration : [method:parseDeviceData, alias:Porch Outlet 2, type:Kasa Plug Switch, ip:10.40.40.107, port:9999, status:added to array]
app:8622024-04-01 08:05:45.537 AMdebugKasa Integration : [method:createDevice, plugNo:01, device:[dni:005F67AF543601, ip:10.40.40.107, port:9999, type:Kasa Plug Switch, rssi:-63, feature:TIM, model:KP200, alias:Porch Outlet 2, deviceId:8006B7B8B08E57C330608C9EE75DB7B01E3DF6FA, plugNo:01, plugId:8006B7B8B08E57C330608C9EE75DB7B01E3DF6FA01]]
app:8622024-04-01 08:05:45.534 AMdebugKasa Integration : [method:createDevice, plugNo:00, device:[dni:005F67AF543600, ip:10.40.40.107, port:9999, type:Kasa Plug Switch, rssi:-63, feature:TIM, model:KP200, alias:Porch Outlet 1, deviceId:8006B7B8B08E57C330608C9EE75DB7B01E3DF6FA, plugNo:00, plugId:8006B7B8B08E57C330608C9EE75DB7B01E3DF6FA00]]
app:8622024-04-01 08:05:30.457 AMinfoKasa Integration : [method:findDevices, activity:sendLanCmd, segment:10.40.40, port:9999]
app:8622024-04-01 08:05:30.453 AMdebugKasa Integration : findDevices: Searching for LAN deivces on IP Segment = 10.40.40, port = 9999
app:8622024-04-01 08:05:30.450 AMdebugKasa Integration : [method:findDevices, hostArray:[1, 254], portArray:[9999], pollSegment:[10.40.40], timeout:10]
app:8622024-04-01 08:05:30.446 AMdebugKasa Integration : addDevicesPage
app:8622024-04-01 08:05:27.899 AMinfoKasa Integration : starting Kasa Integration
app:8622024-04-01 08:05:26.388 AMinfoKasa Integration : starting Kasa Integration

Discovery is working; however, it is finding a lot of devices not controllable via cloud (see list below). These devices are not controllable via cloud. (Look for "reason:not controllable via cloud" in lines above.)

For the two devices that you can not detect, go to the Kasa/Tapo App deviceInfo for the devices.

  • What model is listed? (please be explicit).
  • MAC Address?
  • HW Version?
  • Firmware Version?

I ask this detail to fully investigate what is going on. There are a LOT of potential issues - but this code appears to be working as planned.

Potential issues:

  1. You had previously disconnected (unbound) the device from cloud control and have not reconnected before locating remotely. This may require a re-installation of the device.
  2. The device is a newer Kasa device Hardware Version that has converted to a different API. I have a solution here.

I will work with you, as required. Dave

Thanks. The two new bulbs I can't get detected are:
Model: KL135
HW Ver: 1.0
Firmware 1.0.13
MAC: 3c:52:A1:4C:D3:C4 / 3C:52:A1:4D:17:04

These two are brand new, just paired in Kasa for the first time yesterday.

FWIW, I checked a couple other bulbs that I added a few weeks ago that do work via Hubitat. Model/HW/And Firmware are the same on them.

So another update. I'm not sure when, but apparently the cloud connected devices that were working, stopped working from Hubitat. I don't know if they quit working when I tried discovering the new bulbs or if they hadn't been working longer.

Dad has been in the hospital for awhile now and I started putting these bulbs in his house to make it look like someone is home. Scheduling from hubitat was so much easier and flexible than using the Kasa app

Both devices were in the cloud data as status = 0. This means that the cloud could not connect to them for some reason. Testing with my one remaing KL135, showing raw data from the server:

With device plugged-in (i.e., connected to WAN. Note the status at END is 1 - which means connected.

[alias:test, appServerUrl:https://use1-wap.tplinkcloud.com, deviceHwVer:1.0, deviceId:80120BD33E81C7312EA556E026B3F4951E660A05, deviceMac:E848B8B5586A, deviceModel:KL135(US), deviceName:Smart Wi-Fi LED Bulb with Color Changing, deviceRegion:us-east-1, deviceType:IOT.SMARTBULB, fwId:00000000000000000000000000000000, fwVer:1.0.13 Build 220714 Rel.162126, hwId:CCCEA814DB7786E5A00F65412AAD11CE, isSameRegion:true, oemId:C1AC4843FD5824205B8C51C5131FB350, role:0, status:1]

With the device unplugged (forced off WAN), the status is 0 - not connected.

Possible reasons:

  • Bulb was installed locally using the Kasa Phone App;, however, it is on a Guest Network (SSID) that does not have WAN (internet) access. It would still be controllable via the phone app when in wifi range of the phone - but not controllable when accessed outside wifi range.
  • Bulb was dropped from your router at the remote location after you left. (This has happened to me in the past - too many devices on a single router.)
  • Bulb is on a power circuit that can be turned off remotely and has no power (included for completeness).

That's weird. I can remotely control all the devices at his house from the kasa app. But still not discover the two new bulbs, and the existing devices that were working from hubitat no longer do.

FWIW, there are 6 KL135 bulbs, and KP115 plug. The plug too I can control from the app, but not from hubitat.

Know of no other reason for the failure nor how to fix it. It is not an issue since the design is for local control of local devices.

Gotcha. Off topic, but is there any other tools you know of to work with Kasa cloud stuff? It is so cumbersome to build schedules and automation via their app.

Samsung Smart Things may work (and not require a Hub). Also, Amazon Alexa has integrations for voice and rules control.

1 Like

Issues installing Matter and new Kasa HW Versions in the Built-In App.

See the link below:

So I just started having a new issue with the built in Kasa integration a day or two ago. I can't pinpoint exactly when it started or if it happened organically or after updating my hub..

Many Kasa (non matter) devices are not controllable or reflecting status from Hubitat but work fine from the Kasa app.

First I noticed a dimmer not working, so I went to the integration to try the ping test. No devices show up to ping.

I tried running a scan for new devices to add, just for giggles. It found all my existing devices, but for some reason about half of them are showing cloud and not local now.

After that, my dimmer works again but some of the other devices do not.

Upon closer look, it seems like the devices that show CLOUD for the ip address in the device settings do not work. The ones that still have their IP listed work as expected.

Any ideas?

if they are set as Cloud on the Devices Edit page, they will remain as cloud. See alternative below.

Two possibilities:

  • Two factor authentication causes the cloud interface to fail. See Below from app page. Disabling is done in the Kasa phone app.
  • Your credentials need updating in the Hubitat Kasa app.

Alternative (should work, but no guarantee) - disable cloud on one device using preferences, re-execute the app discovery, and see if that works. If it does for one, it should for all.

image

Just checked, two step is turned off in my app.

When I try to disable cloud in one device, after I hit save prefrences, it comes back with cloud binding back on again, and cloud control back on again.

For giggles I re-ran discovery and this time some devices that were cloud have IP's, and others that had IPs before now show cloud. So I ran it again, and it seems like each time it changes which ones are cloud and whick ones have IP's.

I turned on debug logging, before running discovery but not much useful info:

And here is what I get if I turn on debug logging for a device, when I try turning cloud back off and hitting save

Do you have any devices that require the cloud connection to work?
All of mine work locally, so I have totally logged the Kasa app out of my account and turned off the cloud binding on all the devices. I wonder if logging out would force it find them on the LAN? If I remember correctly, I possibly just had to put in a fake username so it could not connect to Kasa cloud, there was no way to actually "log out".

Did you refresh your credentials in the Hubitat Kasa App?

If that does not work, I would reinstall the Kasa Integration after assuring that all your devices are on the same LAN segment and same network (SSID) as the Hubitat device.