[DEPRECATED] Kasa Plug, Switch, and Bulb integration

The devices (HS100, HS103, HS210 and HS220) use the exact same driver.

Could you turn on debug logging, turn on and off, then post the HS210 logs here. Also, after changing, select events from the device detail page and copy the last 10 or so events (as image) here. Will allow me to see if the driver has some hiccup in it.

Dave

Also, make sure you have the latest driver from gitHub. The HS210 may be busy when the refresh is sent and not replying. The newer driver has error handling for that case.

Dave

I updated the driver today. You can see in the logs below.
Summary...
1st Test: Turned on the switch using HE at 2:21:27. Switch showed "ON" at 2:21:35. 8sec delay
2nd Test: Turned off the switch using HE at 2:21:43. Switch showed "OFF" at 2:26:35. 5min delay
3rd Test: Turned on the switch using the actual switch on the wall at 2:27. Switch showed "ON" at 2:31:35. 5min delay
4th Test: Turned off the switch using the actual switch on the wall at 2:32. Switch showed "OFF" at 2:36:35. 5min delay

dev:2922019-10-09 02:36:35.446 pm info Stairs 4.5.10 Switch: off

dev:2922019-10-09 02:36:35.441 pm debug Stairs 4.5.10 commandResponse: status = [system:[get_sysinfo:[dev_name:Smart Wi-Fi 3-Way Light Switch, hw_ver:1.0, rssi:-33, latitude_i:397741, err_code:0, longitude_i:-1047512, deviceId:8006C1A110AD328E244E86EB28396A9419FB63C9, mac:AC:84:C6:38:3B:09, active_mode:none, icon_hash:, updating:0, led_off:0, on_time:0, feature:TIM, relay_state:0, next_action:[type:-1], alias:Stairs, oemId:FA7CCD3DD290792FF84DC5EADF9B86A9, model:HS210(US), abnormal_detect:0, hwId:71C89564A7C0200DD8D25466DEA4E851, fwId:00000000000000000000000000000000, mic_type:IOT.SMARTPLUGSWITCH, sw_ver:1.5.6 Build 181210 Rel.091146]]]

dev:2922019-10-09 02:36:35.105 pm debug Stairs 4.5.10 sendCmd: command = {"system":{"get_sysinfo":{}}} // device IP = 192.168.1.12, action = commandResponse

dev:2922019-10-09 02:36:35.091 pm debug Stairs 4.5.10 refresh

[[[ Physically turned OFF the device at 2:32]]]

dev:2922019-10-09 02:31:35.487 pm info Stairs 4.5.10 Switch: on

dev:2922019-10-09 02:31:35.482 pm debug Stairs 4.5.10 commandResponse: status = [system:[get_sysinfo:[dev_name:Smart Wi-Fi 3-Way Light Switch, hw_ver:1.0, rssi:-33, latitude_i:397741, err_code:0, longitude_i:-1047512, deviceId:8006C1A110AD328E244E86EB28396A9419FB63C9, mac:AC:84:C6:38:3B:09, active_mode:none, icon_hash:, updating:0, led_off:0, on_time:284, feature:TIM, relay_state:1, next_action:[type:-1], alias:Stairs, oemId:FA7CCD3DD290792FF84DC5EADF9B86A9, model:HS210(US), abnormal_detect:0, hwId:71C89564A7C0200DD8D25466DEA4E851, fwId:00000000000000000000000000000000, mic_type:IOT.SMARTPLUGSWITCH, sw_ver:1.5.6 Build 181210 Rel.091146]]]

dev:2922019-10-09 02:31:35.105 pm debug Stairs 4.5.10 sendCmd: command = {"system":{"get_sysinfo":{}}} // device IP = 192.168.1.12, action = commandResponse

dev:2922019-10-09 02:31:35.090 pm debug Stairs 4.5.10 refresh

[[[ Physically turned ON the device at 2:27]]]

dev:2922019-10-09 02:26:35.595 pm info Stairs 4.5.10 Switch: off

dev:2922019-10-09 02:26:35.590 pm debug Stairs 4.5.10 commandResponse: status = [system:[get_sysinfo:[dev_name:Smart Wi-Fi 3-Way Light Switch, hw_ver:1.0, rssi:-33, latitude_i:397741, err_code:0, longitude_i:-1047512, deviceId:8006C1A110AD328E244E86EB28396A9419FB63C9, mac:AC:84:C6:38:3B:09, active_mode:none, icon_hash:, updating:0, led_off:0, on_time:0, feature:TIM, relay_state:0, next_action:[type:-1], alias:Stairs, oemId:FA7CCD3DD290792FF84DC5EADF9B86A9, model:HS210(US), abnormal_detect:0, hwId:71C89564A7C0200DD8D25466DEA4E851, fwId:00000000000000000000000000000000, mic_type:IOT.SMARTPLUGSWITCH, sw_ver:1.5.6 Build 181210 Rel.091146]]]

dev:2922019-10-09 02:26:35.126 pm debug Stairs 4.5.10 sendCmd: command = {"system":{"get_sysinfo":{}}} // device IP = 192.168.1.12, action = commandResponse

dev:2922019-10-09 02:26:35.112 pm debug Stairs 4.5.10 refresh

dev:2922019-10-09 02:21:44.234 pm info Stairs 4.5.10 Switch: on

dev:2922019-10-09 02:21:44.229 pm debug Stairs 4.5.10 commandResponse: status = [system:[get_sysinfo:[dev_name:Smart Wi-Fi 3-Way Light Switch, hw_ver:1.0, rssi:-32, latitude_i:397741, err_code:0, longitude_i:-1047512, deviceId:8006C1A110AD328E244E86EB28396A9419FB63C9, mac:AC:84:C6:38:3B:09, active_mode:none, icon_hash:, updating:0, led_off:0, on_time:16, feature:TIM, relay_state:1, next_action:[type:-1], alias:Stairs, oemId:FA7CCD3DD290792FF84DC5EADF9B86A9, model:HS210(US), abnormal_detect:0, hwId:71C89564A7C0200DD8D25466DEA4E851, fwId:00000000000000000000000000000000, mic_type:IOT.SMARTPLUGSWITCH, sw_ver:1.5.6 Build 181210 Rel.091146]]]

dev:2922019-10-09 02:21:43.835 pm debug Stairs 4.5.10 sendCmd: command = {"system":{"set_relay_state":{"state":0}},"system":{"get_sysinfo":{}}} // device IP = 192.168.1.12, action = commandResponse

dev:2922019-10-09 02:21:43.817 pm debug Stairs 4.5.10 off

dev:2922019-10-09 02:21:35.469 pm info Stairs 4.5.10 Switch: on

dev:2922019-10-09 02:21:35.464 pm debug Stairs 4.5.10 commandResponse: status = [system:[get_sysinfo:[dev_name:Smart Wi-Fi 3-Way Light Switch, hw_ver:1.0, rssi:-32, latitude_i:397741, err_code:0, longitude_i:-1047512, deviceId:8006C1A110AD328E244E86EB28396A9419FB63C9, mac:AC:84:C6:38:3B:09, active_mode:none, icon_hash:, updating:0, led_off:0, on_time:7, feature:TIM, relay_state:1, next_action:[type:-1], alias:Stairs, oemId:FA7CCD3DD290792FF84DC5EADF9B86A9, model:HS210(US), abnormal_detect:0, hwId:71C89564A7C0200DD8D25466DEA4E851, fwId:00000000000000000000000000000000, mic_type:IOT.SMARTPLUGSWITCH, sw_ver:1.5.6 Build 181210 Rel.091146]]]

dev:2922019-10-09 02:21:35.125 pm debug Stairs 4.5.10 sendCmd: command = {"system":{"get_sysinfo":{}}} // device IP = 192.168.1.12, action = commandResponse

dev:2922019-10-09 02:21:35.111 pm debug Stairs 4.5.10 refresh

dev:2922019-10-09 02:21:27.769 pm info Stairs 4.5.10 Switch: off

dev:2922019-10-09 02:21:27.764 pm debug Stairs 4.5.10 commandResponse: status = [system:[get_sysinfo:[dev_name:Smart Wi-Fi 3-Way Light Switch, hw_ver:1.0, rssi:-32, latitude_i:397741, err_code:0, longitude_i:-1047512, deviceId:8006C1A110AD328E244E86EB28396A9419FB63C9, mac:AC:84:C6:38:3B:09, active_mode:none, icon_hash:, updating:0, led_off:0, on_time:0, feature:TIM, relay_state:0, next_action:[type:-1], alias:Stairs, oemId:FA7CCD3DD290792FF84DC5EADF9B86A9, model:HS210(US), abnormal_detect:0, hwId:71C89564A7C0200DD8D25466DEA4E851, fwId:00000000000000000000000000000000, mic_type:IOT.SMARTPLUGSWITCH, sw_ver:1.5.6 Build 181210 Rel.091146]]]

dev:2922019-10-09 02:21:27.347 pm debug Stairs 4.5.10 sendCmd: command = {"system":{"set_relay_state":{"state":1}},"system":{"get_sysinfo":{}}} // device IP = 192.168.1.12, action = commandResponse

dev:2922019-10-09 02:21:27.327 pm debug Stairs 4.5.10 on

dev:2922019-10-09 02:21:24.378 pm info Stairs 4.5.10 Switch: off

dev:2922019-10-09 02:21:24.373 pm debug Stairs 4.5.10 commandResponse: status = [system:[get_sysinfo:[dev_name:Smart Wi-Fi 3-Way Light Switch, hw_ver:1.0, rssi:-33, latitude_i:397741, err_code:0, longitude_i:-1047512, deviceId:8006C1A110AD328E244E86EB28396A9419FB63C9, mac:AC:84:C6:38:3B:09, active_mode:none, icon_hash:, updating:0, led_off:0, on_time:0, feature:TIM, relay_state:0, next_action:[type:-1], alias:Stairs, oemId:FA7CCD3DD290792FF84DC5EADF9B86A9, model:HS210(US), abnormal_detect:0, hwId:71C89564A7C0200DD8D25466DEA4E851, fwId:00000000000000000000000000000000, mic_type:IOT.SMARTPLUGSWITCH, sw_ver:1.5.6 Build 181210 Rel.091146]]]

dev:2922019-10-09 02:21:24.000 pm debug Stairs 4.5.10 sendCmd: command = {"system":{"get_sysinfo":{}}} // device IP = 192.168.1.12, action = commandResponse

dev:2922019-10-09 02:21:23.985 pm debug Stairs 4.5.10 refresh

Initial thought - device is taking about 1/2 second to turn on. Returned state is still off. (coordination time with second switch?)

will research tomorrow. I think this is good data. I will probably have an updated driver for you to test. I may have to slow down my driver to accommodate this switch.

1 Like

Hi @djgutheinz,
I just reinstalled my home network (new broadband), and reset everything from routers, modems etc. As part of that, went through Hubitat to update my systems, as my bulbs no longer worked. I assumed this was because IP addresses did change (new router caused this), so went to reinstall the newest version of your App (4.5)
All of my TPLink devices are found, except for 2, and they are both the LB120 bulbs.

Is there any possibility that there is something in the detection of the LB120 bulbs that differs from all the other bulb types/switch types (I have LB100, LB130, and HS110 all which detect) .

I've never had problems with this app before. NOTE: the devices are all visible on my router, and they all work fine with the Kaza App. I can confirm that the IP addresses of all the detected devices match the router's indications also (no out of date IP addresses)

Any assistance would be appreciated!

The LB120 and 130 use the exact same controller, wifi hardware, and firmware, so there should be no problem.

Attempt:

  • Open the Kasa App on your phone.
  • See if you can see and control your "missing" LB130.
  • If not, reset the devices and reinstall into the Kasa App (to set IP address).

I had a similar router change out and had to reinstall two devices into the Kasa Account. They did not follow to the new router.

Thanks Dave. Had to remove and replace them in the App twice (even though they were working in the App), but then they finally showed up. Thank you!!

@djgutheinz

Dave - updated to latest app/driver code for everything. Now getting this error on the HS100(US) plug using the TP-Link Plug-Switch:

dev:3392019-10-11 04:06:03.399 pm errorjava.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 220 (commandResponse)

After an update, run Preferences on each device. This updates and enables some variables; including shortPoll.

After I get back home (2 weeks), I will look for ways to preclude this on the next release.

1 Like

Trying to install a TP-Link Mini Plug HS105. I installed the app code, and the driver code for the Mini Plug. The plug shows up in the app's drop-down list. I select it, then click Done. But the device does not show up in the device list. Have tried several times. Rebooted hub as well. Any help would be appreciated. Thanks!

Typical problem is that the device driver is not installed or not up to date. Suggest you install the current APP and HS105 Driver.

1 Like

Thanks, Dave. The App and driver were those available yesterday. I'll retrace my steps to see where I've gone wrong.

UPDATE: I removed both the App and the Driver, and then added them back. Now works fine.

Thanks for the help!

Maybe not related to Hubitat however I'm currently stumped.

I use the EM multi plug with hubitat and this integration and everything has been fine up until a few weeks ago. All of a sudden 1 of the 6 plugs now turns on randomly (or I think randomly at the moment). In Hubitat device page, it still shows off so I have to hit refresh and then it sees it as on. Very strange, maybe it's Kasa, maybe not. Now I noticed another of my HS300 strips doing it. Trying to capture logs but not successful to capture the moment yet. Noticed other errors in the logs here and there but nothing looks related that I know of.

Anybody else seeing something like this? Or just me

off topic: I did update to the latest 4.5.10 driver/app releases. I also noticed this comment on the release notes:
"Combined HS110 and HS300 drivers to single driver."
However I still have both drivers installed separately for my HS110 and HS300. Don't think that's a big deal but maybe I missed an instruction to delete one?

Some Errors I get:
dev:8462019-10-23 12:30:06.187 pm info M Bedrm DreamS 4.5.10 Power: on

dev:8462019-10-23 12:30:06.117 pm warn M Bedrm DreamS 4.5.10 Attempt 1 to recover communications

dev:8462019-10-23 12:30:06.029 pm warnError occured with UDP message: SocketTimeoutException: Receive timed out

dev:8462019-10-23 12:19:58.407 pm errorjava.lang.NullPointerException: Cannot get property 'system' on null object on line 172 (commandResponse)

dev:8462019-10-23 12:19:58.396 pm warn M Bedrm DreamS 4.5.10 CommsError: Fragmented message returned from device.

  1. All of the errors are as expected (I should probably capture/isolate the 2nd to last error).
  2. It should not be the dual drivers - but change the driver for your HS 110 (go to the device's page and near the bottom you can select the type (driver).
  3. You are getting no indication that Hubitat is turning the devices on / off. so I do not think it is the Hubitat end. Kasa App????? Question would be, does the Kasa App show the correct state.
  4. Have you tried rebooting the HS300 (unplug, plug back in in 15 seconds). There is some quirkiness in the TP-Link Firmware.

Out of curiosity, go to the Kasa App and get the firmware version for your HS 300. TP-Link has been working on SmartThings integration and they may have had to change the firmware.

I am currently out-of-pocket, but in a couple of days I might be able to run some tests.
Dave

I'm still running some tests. Thanks for the tip/info on Number 1 and 2.

You're right. Don't think it's hubitat. I believe I checked the Kasa app when it happened and it did show correct state.

Trying this now. Just need to wait now to see if it happens. So far the bedroom one has not had the issue. Trying the original one. Will post results if this solved it.

On an off note, the funny thing about all this is the issue happened with a plug I used for a pair of Halloween skeletons that play dueling bango songs at each other whenever they hear a loud sound or clap or motion. Freaked out the house randomly but also ruined some movie watching.

If you have Amazon Alexa or Google Home, check and make sure the Kasa skill is disabled (removed in Alexa). Then use the Hubitat Alexa App to control via Alexa. Dual control may cause the problem.

If you use rules, check any that turn on/off thes HS300.

My testing showed no problems; however, I do not use rules (generally do not need rules). They are powerful tools that simplify day-to-day, I just haven't had time to start using.

Dave

I have one other thing to try if you are still having problems. It will disconnect the device from the Kasa cloud. You will still be able to control through Hubitat and through the Kasa app when on home network. No remote access via the Kasa app. Disparate move.

Yes I have both Google Home and Alexa. Checked both and not installed and skillset not enabled.

Yes, one of the first things I checked. Checked on device settings page in HE and removed from all rules and associations. Still turned on.

Thanks! That may resolve it however I think your previous solution might have worked. (reset by removing plug from TP Link HS300 for a minute then trying again). That might be the winner. Still waiting for the skeletons to start singing.

I am old. I could sing for you.

If you need the final option, it is an App I wrote for the purpose. Requires you know the IP address. Link is below:

The 15 second unplug reset HS300 didn't work. It's only one of the six plugs that decided to do this (that I know of). So I switched devices and used a device that I will keep on all the time in that specific plug (plug 5) that has the issue.
I assume it's a Kasa bug but I'll leave it alone for now until it creeps into the other plugs. Patch and root cause later.

1 Like

Hey all, I am a new Hubitat owner. I have added in the TP link Integration and followed the directions for the drivers, but for some reason the Hubitat is only seeing one light bulb to add. I have switches and other items and it does not see them. I have reserved the devices and they have static IP's on my router. I have taken one device that was not being found and reset it to factory defaults and re-added it to see if that would work- nope. Any ideas?