Kasa and Tapo Switches, Plugs, and Bulbs - Hubitat Support

There is some confusion in the TP-Link (Tapo and Kasa Devices) area. This is caused by TP-Link deciding that new Kasa devices (apparently) will use the TAPO API and Security Protocols. Hubitat supports all current Tapo and Kasa Plugs, Switches, and Bulbs plus the Tapo/Kasa Hub and Hub-connected devices (sensors).

So, let us break this out:

Hubitat Kasa Integration. Built-in to Hubitat. This support LEGACY KASA devices - mainly those devices released prior to June 2023. The Hubitat Kasa App does not support the following devices (this list is from the Tapo Android Code) and will probably grow with time:

  1. SMART_TAPO_REMODEL_KASA_HUB_KH100
  2. SMART_TAPO_REMODEL_KASA_PLUG_EP25
    (EP25 Note: Antidotes of existing Built-In installations failing due to firmware update that converts the device to the new API.)
  3. SMART_TAPO_REMODEL_KASA_PLUG_KP125M (Matter)
  4. SMART_TAPO_REMODEL_KASA_POWER_STRIP_EP40M
  5. SMART_TAPO_REMODEL_KASA_SWITCH_HS200
    (These are the latest hardware versions only)
  6. SMART_TAPO_REMODEL_KASA_SWITCH_HS220 (Dimmer)
    (These are the latest hardware version only)
  7. SMART_TAPO_REMODEL_KASA_SWITCH_KS205 (Matter)
  8. SMART_TAPO_REMODEL_KASA_SWITCH_KS225 (Dimmer, Matter)
  9. SMART_TAPO_REMODEL_KASA_SWITCH_KS240 (Dual Fan Control/Dimmer)

Community Tapo Integration. (Link: " [RELEASE] TP-LINK TAPO Plug, Switch, Bulb, Hub and Robovac Integration") Integration supports the above devices except the KS240. An update to include the KS240 is planned for August.

  • NOTE ON MATTER DEVICES. The TAPO and KASA Matter devices are (by default) supported by the Hubitat Matter implementation. However, the Community Tapo Integration also supports these as a backup for devices that are not yet supported by Hubitat Matter. Do not install a device as MATTER and LAN at the same time.
2 Likes

I have a KS205 matter switch. If I understand correctly it is not supported by HE matter connection? But your driver would only connect it via wifi and not matter?

Correct on my integration. With all the local bulb-control functions. Note that Matter is a separate function in the TAPO/Kasa line

Well that explains why I cannot add my KS240's to Hubitat. At least August is in a few days!!

I noticed today, the Tapo integrations found and installed my KS240, but shows up as just a dimmer. No functionality, but did bring it into hubitat. Is this still in the developing phase?

Yes there was not a parent app. I did check HPM for update to Tapo and it said all packages are up to date. I'm going to try and uninstall the Tapo app and remove the device. Then reinstall Tapo and search again.

Same issue. It's pulling it in as a dimmer and not a parent. I can manually change the driver to parent, but cannot get the child installed.

Installed only the parent, child dimmer, and child fan drivers. Tapo finds the device (still listed as a dimmer), but will not install it. After selecting it in the drop down and hitting next, done. It does not show up in the device page. I've tried about 10 times, every time i install it, i can search again and it says not installed. I looked at the manual install you sent. Looks like the app, and drivers are installed, it's just not picking the KS240 as a parent. Keeps pushing to dimmer. I'm going to TS some more this evening and will update this post.


I need

a. the App data page from Application State value devices. Below is the same for my installed child device. Need the TEXT, not a picture.
b. Installation logs for the last run (these can be found on the past-logs page, selecting the Tapo integration filter. Need the TEXT, not a picture.
c. Make sure the parent driver is on the Drivers Code page. Same for the two children.

Example Application State for a parent device:

{5C628BEF9B32={deviceType=SMART.TAPOPLUG, protocol=KLAP, baseUrl=http://192.168.50.184:80/app, alias=test multiplug, model=TP25(US), type=Parent}}

Sorry for the delay. I've been trying multiple ways to try install. Deleted device, app, and drivers. manually installed from your raw data. The KS240 will not install without the dimmer driver. I installed only parent app, child dimmer, child fan. While running the tapo integration, it finds the KS240, but will not install. I hope the data below is what you need. Verified that those three drivers are on the drivers code page.

2024-08-17 07:02:10.600 AMinfoTapo Integration-2.3.9a: [method:getDiscData, type:SMART.KASASWITCH, model:KS240(US), baseUrl:http://192.168.68.103:80/app, dni:202351FA4224, devId:c816b38f406062868144e567223c2265, ip:192.168.68.103, port:80, protocol:KLAP, status:OK]

2024-08-17 07:02:31.912 AMinfoTapo Integration-2.3.9a: [method:updated, status:setting updated for new session]

app:652024-08-17 07:02:31.909 AMinfoTapo Integration-2.3.9a: [method:scheduleItems, logEnable:false, databases:trimmed]

app:652024-08-17 07:02:28.314 AMinfoTapo Integration-2.3.9a: [method:addDevices, selectedDevices:null]

app:652024-08-17 07:02:25.267 AMwarnTapo Integration-2.3.9a: [method:addDevice, dni:202351FA4224, status:failedToAdd, driver:Dimmer, errorMsg:null]

app:652024-08-17 07:02:25.224 AMinfoTapo Integration-2.3.9a: [method:startPage, status:Starting Tapo Integration Setup]

app:652024-08-17 07:02:16.424 AMinfoTapo Integration-2.3.9a: [method:updateLegacyDevices, appVer:2.3.9a, version:2.3.9a, children:]

app:652024-08-17 07:02:16.403 AMinfoTapo Integration-2.3.9a: [method:findDevices, intType:Tapo Integration, findTpLinkDevices:[method:findTpLinkDevices, action:getTpLinkLanData, timeOut:8, hostArray:[2, 254], pollSegment:192.168.68]]

app:652024-08-17 07:02:16.315 AMinfoTapo Integration-2.3.9a: [method:updateTpLinkDevices]

app:652024-08-17 07:02:10.675 AMinfoTapo Integration-2.3.9a: [method:getDiscData, type:HOMEWIFISYSTEM, model:S4, status:INVALID, reason:Device not supported.]

app:652024-08-17 07:02:10.638 AMinfoTapo Integration-2.3.9a: [method:getDiscData, type:HOMEWIFISYSTEM, model:S4, status:INVALID, reason:Device not supported.]

app:652024-08-17 07:02:10.600 AMinfoTapo Integration-2.3.9a: [method:getDiscData, type:SMART.KASASWITCH, model:KS240(US), baseUrl:http://192.168.68.103:80/app, dni:202351FA4224, devId:c816b38f406062868144e567223c2265, ip:192.168.68.103, port:80, protocol:KLAP, status:OK]

app:652024-08-17 07:01:59.310 AMinfoTapo Integration-2.3.9a: findDevices: Finding TP-Link LAN Devices

app:652024-08-17 07:01:56.938 AMinfoTapo Integration-2.3.9a: [method:initInstance, status:App data updated for appVer 2.3.9a]

app:652024-08-17 07:01:56.922 AMinfoTapo Integration-2.3.9a: [method:startPage, status:Starting Tapo Integration Setup]

No luck. Found the line and replaced.
case "brightness": // library marker davegut.appTpLinkSmart, line 191
if (!cmdResp.color_temp_range && !comps.find {it.id == control_child} ) {
driver = "Dimmer" // library marker davegut.appTpLinkSmart, line 193
} // library marker davegut.appTpLinkSmart, line 194
break // library marker davegut.appTpLinkSmart, line 195
Ran the app, found the KS240. Selected and installed. Does not show in devices.

2024-08-17 03:38:23.076 PMinfoTapo Integration-2.3.9a: [method:updated, status:setting updated for new session]

app:662024-08-17 03:38:23.073 PMinfoTapo Integration-2.3.9a: [method:scheduleItems, logEnable:false, databases:trimmed]

app:662024-08-17 03:38:19.361 PMinfoTapo Integration-2.3.9a: [method:addDevices, selectedDevices:null]

app:662024-08-17 03:38:16.357 PMwarnTapo Integration-2.3.9a: [method:addDevice, dni:202351FA4224, status:failedToAdd, driver:Dimmer, errorMsg:null]

app:662024-08-17 03:38:16.331 PMinfoTapo Integration-2.3.9a: [method:startPage, status:Starting Tapo Integration Setup]

app:662024-08-17 03:38:09.925 PMinfoTapo Integration-2.3.9a: [method:updateLegacyDevices, appVer:2.3.9a, version:2.3.9a, children:]

app:662024-08-17 03:38:09.907 PMinfoTapo Integration-2.3.9a: [method:findDevices, intType:Tapo Integration, findTpLinkDevices:[method:findTpLinkDevices, action:getTpLinkLanData, timeOut:8, hostArray:[2, 254], pollSegment:192.168.68]]

app:662024-08-17 03:38:09.733 PMinfoTapo Integration-2.3.9a: [method:updateTpLinkDevices]

app:662024-08-17 03:38:04.122 PMinfoTapo Integration-2.3.9a: [method:getDiscData, type:HOMEWIFISYSTEM, model:S4, status:INVALID, reason:Device not supported.]

app:662024-08-17 03:38:04.101 PMinfoTapo Integration-2.3.9a: [method:getDiscData, type:HOMEWIFISYSTEM, model:S4, status:INVALID, reason:Device not supported.]

app:662024-08-17 03:38:04.079 PMinfoTapo Integration-2.3.9a: [method:getDiscData, type:SMART.IPCAMERA, model:C100, status:INVALID, reason:Device not supported.]

app:662024-08-17 03:38:04.040 PMinfoTapo Integration-2.3.9a: [method:getDiscData, type:SMART.KASASWITCH, model:KS240(US), baseUrl:http://192.168.68.103:80/app, dni:202351FA4224, devId:c816b38f406062868144e567223c2265, ip:192.168.68.103, port:80, protocol:KLAP, status:OK]

app:662024-08-17 03:37:52.853 PMinfoTapo Integration-2.3.9a: findDevices: Finding TP-Link LAN Devices

app:662024-08-17 03:37:50.907 PMinfoTapo Integration-2.3.9a: [method:initInstance, status:App data updated for appVer 2.3.9a]

app:662024-08-17 03:37:50.899 PMinfoTapo Integration-2.3.9a: [method:startPage, status:Starting Tapo Integration Setup]

Ok. I will spend the hours with a simulator to try to solve.

Sorry. It's over my head, but I tried.

1 Like

Updated. Best way is to open the App Code and select Import at the top of the page. That will import the updated code. Then save the app and try again.

I tested on a system with two multi-plug-parents, one hub, two EM plugs, two stnadard plugs, 5 bulbs, and the robovac. No issies on install.

Change was to go to a different method of defining drivers that would preclude the driver type being overwritten later in the process.

OK. Updated through import. Ran app. Parent device was installed. That part worked great. Received an error when the system attempted to install child devices.

2024-08-18 05:29:51.604 PMinfoKS240-2.3.9a: [method:installChildren, Ceiling Fan Corner Bed:[alias:Ceiling Fan Corner Bed, childDni:202351FA4224, label:Ceiling Fan Corner Bed, name:KS240, type:Child Fan, deviceId:803BE204CD104F52E9F5D880F0CC148822B1808700, category:kasa.switch.outlet.sub-fan, status:FAILED, error:null], Light Corner Bed:[alias:Light Corner Bed, childDni:202351FA4224, label:Light Corner Bed, name:KS240, type:Child Dimmer, deviceId:803BE204CD104F52E9F5D880F0CC148822B1808701, category:kasa.switch.outlet.sub-dimmer, status:FAILED, error:null]]

dev:822024-08-18 05:29:49.594 PMwarnKS240-2.3.9a: [alias:Light Corner Bed, childDni:202351FA4224, label:Light Corner Bed, name:KS240, type:Child Dimmer, deviceId:803BE204CD104F52E9F5D880F0CC148822B1808701, category:kasa.switch.outlet.sub-dimmer, status:FAILED, error:null]

dev:822024-08-18 05:29:47.569 PMwarnKS240-2.3.9a: [alias:Ceiling Fan Corner Bed, childDni:202351FA4224, label:Ceiling Fan Corner Bed, name:KS240, type:Child Fan, deviceId:803BE204CD104F52E9F5D880F0CC148822B1808700, category:kasa.switch.outlet.sub-fan, status:FAILED, error:null]

dev:822024-08-18 05:29:47.485 PMinfoKS240-2.3.9a: [method:installChildren]

dev:822024-08-18 05:29:47.388 PMinfoKS240-2.3.9a: [method:updated, installChild:true, commonUpdated:[commsError:false, pollInterval:30 min, logging:[logEnable:false]]]

dev:822024-08-18 05:29:42.205 PMinfoKS240-2.3.9a: [method:installed, commonInstalled:[method:commonInstalled, configure:[method:configure, checkApp:false, handshake:[method:deviceHandshake, protocol:KLAP], handshakeInterval:3 Hours]], children:installing]

dev:822024-08-18 05:29:37.139 PMinfoKS240-2.3.9a: [method:configure, checkApp:false, handshake:[method:deviceHandshake, protocol:KLAP], handshakeInterval:3 Hours]

dev:822024-08-18 05:29:32.094 PMinfoKS240-2.3.9a: [method:updateDeviceData, currentVersion:null, newVersion:2.3.9a, tpLinkType:SMART.KASASWITCH, type:Parent]

I'm working remotely. I will try to remote reboot the hub and update if any changes. Thanks again.

  • Updated driver code.
    • Open driver.
    • Select Import.
      • Note line 9 string: // TEST MOD FOR Kasa 240
    • Save
  • Open SEPARATE log page.
  • If 240 is still installed:
    • open Devices page then the 240 device
    • in Preference, select "Install Child Devices" then "Save Preferences"
    • The children should install. Logs will indicate any further errors (yikes)
  • if 240 is not installed, run install again. The children should install automatically.

Text me with success or failure.

THANKS for your help. I learned that KASA does not always follow the TP-LINK device data definitions.

Corrected case where Kasa implementation does not use data element position to define child "location".

Still an error installing child device.


dev:822024-08-20 12:33:33.295 PMwarnKS240-2.3.9a: [alias:Light Corner Bed, childDni:202351FA4224, label:Light Corner Bed, name:KS240, type:Child Dimmer, deviceId:803BE204CD104F52E9F5D880F0CC148822B1808701, category:kasa.switch.outlet.sub-dimmer, status:FAILED, error:java.lang.IllegalArgumentException: A device with the same device network ID exists, Please use a different DNI]

dev:822024-08-20 12:33:31.272 PMwarnKS240-2.3.9a: [alias:Ceiling Fan Corner Bed, childDni:202351FA4224, label:Ceiling Fan Corner Bed, name:KS240, type:Child Fan, deviceId:803BE204CD104F52E9F5D880F0CC148822B1808700, category:kasa.switch.outlet.sub-fan, status:FAILED, error:java.lang.IllegalArgumentException: A device with the same device network ID exists, Please use a different DNI]

dev:822024-08-20 12:33:30.970 PMinfoKS240-2.3.9a: [method:updated, installChild:true, commonUpdated:[commsError:false, pollInterval:10 sec, logging:[logEnable:false]]]

Error: I failed to remove a no-longer valid check prior to generating the dni. (blush}.

Same procedure as before

1 Like

:grinning: :grinning: :grinning: :grinning: :grinning:
I believe you got it!!! Initial testing looks good. No issues so far. Great job and great patience. Thank you for the effort. I'll report any changes or bugs! Thanks again!

Thanks for your help. I rely on people like you to verify a wide product line that is almost impossible to own a sample of each variant. This integration is a community effort.

1 Like