[DEPRECATED] Kasa Plug, Switch, and Bulb integration

Did the update and followed all of the instructions. I have 6 devices, all LAN connected. Now when I turn on one Kasa device, they all turn on (or off)??? Seems to be intermittent, but it turns on my coffee pot, so not good. Any ideas? Nothing showing in the logs for devices that are phantom controlled.

What are the devices?

Name: Your device Driver / Type
Coffee: Plug Switch / KP115
Family Ceiling: Dimming Switch / HS220
Family Room Fans: Plug Switch / HS200
Front Lights: Plug Switch / HS210
Garage Outside: Plug Switch / HS103
Heater: Plug Switch / HS103

All have static IP address via router

Did app and driver update via HPM. Removed the EM driver. Went into each device and pressed Save Device and Save Preferences.
Merry Christmas BTW

Found this in logs for my heater switch. I didn't change the LED setting unless that is part of the switch on and off.
2021-12-25 10:51:50.433 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:off, switch:off]

dev:5782021-12-25 10:51:50.431 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:off]

dev:5782021-12-25 10:51:36.286 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [switch:on]

dev:5782021-12-25 10:51:23.124 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:on, switch:off]

dev:5782021-12-25 10:51:23.121 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:on]

dev:5782021-12-25 10:31:45.575 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:off, switch:on]

dev:5782021-12-25 10:31:45.572 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:off]

dev:5782021-12-25 10:00:43.312 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:on]

dev:5782021-12-25 09:30:43.413 am info[Plug Switch / 6.5.0 / Heater]| setSysInfo: [led:off]

I think isolated the problem to the heater switch HS103. That seems to be the one that is firing off the group. The other HS103 I have is not causing a problem. I'll try uninstalling that and doing a reinstall and let you know.

DO NOT BOTHER DO A REINSTALL at this time. Post coming now.

1 Like

Already did the reinstall. I did notice on both of the HS103 switches it says not installed when I do a discovery (most likely cause:driver not installed) but it does install the device. And the same thing is happening.

Understand fixed. Closing. Thanks for the interaction.
Dave

Hello Dave,

I wanted to share an unintended benefit/success story that without your recent additions, might've been impossible for me to detect/find.

I kept getting a persistent device trying to install under kasa but the label was blank. It would only show ", Kasa Light Strip". For weeks I've just been ignoring it because I didn't know what it was. I reviewed the list of devices in the native app a dozen times and everything appeared to be functioning properly (mind you I'm over 150 devices).

After some driver code cleanup today, I saw that the kasa integration was yet again trying to install this device. If you opt to not install the device and still click through to the end, it will still give you the readout of all the devices and their IP, including the one that had no name and I refused to install. Now with at least the IP, I could start looking for this device.

I ultimately found what device it was and this device was somehow absent from my kasa app. It must've been out for a while because it was a firmware update behind. It's in a room I rarely enter so I didn't notice. I restored the light and tied everything back together.

The point being in all of this that it was your app's persistent message telling me it was detecting a device in some sort of quasi-added state and at least giving me enough info to chase it down despite it not having a name. A state that rendered this device completely invisible to the native app.

One thing to note that even Kasa's "other device detection" technology picks up other bulbs on my network that aren't part of the same account and persistently asks me to add them. Even THAT functionality was not telling me there was possibly another lightstrip somewhere. Without your recent update, I'm not sure how I would've found it.

Thank U GIF

2 Likes

Hi,

I am new to hubitat and first thing I am trying to do is to setup my kasa dimmer switches and smart plug with it.

I installed the kasa integration app and corresponding drivers as per the instructions (thanks for the creating the app and drivers). I am now trying to install devices. As part of this process, I clicked on kasa login and token update and added my user name and password. However, when I click on get or update token I always get below error
" An unexpected error has occurred trying to load the app. Check [Logs] for more information.
Error: Cannot get property 'error' on null object"

Logs has following message
app:342021-12-28 10:16:02.801 am errorjava.lang.NullPointerException: Cannot get property 'error' on null object on line 727 (method startGetToken)
app:342021-12-28 10:16:02.744 am warn[KasaInt/6.5.0-r1] sendKasaCmd:
Error in Cloud Communications. The Kasa Cloud is unreachable.
Additional Data: Error = org.apache.http.conn.HttpHostConnectException: Connect to wap.tplinkcloud.com:443 [wap.tplinkcloud.com/ wap.tplinkcloud.com/] failed: Network is unreachable (connect failed)

The username and password are correct. I confirmed by signing into my kasa app as well as tplink cloud. I am sure I am missing some basic step here. Appreciate help in troubleshooting this issue.

Thanks
Amit

I will check. For now, start again on the app and do not check the cloud login. It is not usually necessary.

Dave

PS - this may be a AWS problem. It says the address is unreachable.

Hi Dave,

Thanks for the quick reply and apologies for delay in my response.

"PS - this may be a AWS problem. It says the address is unreachable." - Initially, I too thought so, however I have been getting this error since Monday evening so I am not sure if it is truly related to AWS outage or configuration.

So, I am not sure if I understand this statement - "do not check the cloud login". Do you mean not entering the user id and password under " kasa login and token update" button? Well, here is what I tried

  1. Re-add app. go to " kasa login and token update" enter user id and password. Did not click on "Get or Update token". Click next. Click on "Install Kasa Devices". No devices detected.
  2. Remove and re-add app. Click on "Install Kasa Devices". No devices detected.

In both cases token was null. I don't know if token is required (I would assume it is) and how to get it?

P.S Regarding the null error. I looked at the code and it is in catch all block. However, additional data does show host connection exception. So it appears related to network. I am using Google wifi by the way. I am not sure if I need to tweak some setting there. Hubitat is on static IP.

Thanks
Amit

What is the explicit device model?

Below assumes you are a novice, so apologies....

Did you first install the devices using the Kasa Phone App? This is required for the device to be installed on your LAN and is also required for the Kasa Cloud to recognize your token. If this is not done, then this integration can not detect the device.

What happens. A new Kasa device installs as an access point (not on your LAN). The phone installation has your phone connect to this access point then look for your Local wifi network. You select this and enter credentials which then installs the unit on your LAN. It also registers the device with the Kasa Cloud, and if the first device, your access token.

A similar process happens on installing any wifi device on your LAN.

(Note that the Hubitat Hub does not support this automatic IP address switching your phone does, so there is no other easy way to accomplish this.)

1 Like

Hi Dave,

I have 3 HS220 dimmers and HS105 smart plug. I have already installed these using kasa app and have been using these for more than 3 months. I can see and control these devices using the kasa app as well as google assistant.

Thanks
Amit

Sending you a PM (data protection).

UPDATE:
Thanks to Amit for solving the issue and providing valuable feedback. For everyone:

  • Solved relative to LAN installation. Issue was somewhere in the unintended LAN configuration. User re-installed some of the devices and the problem corrected. I believe the router was a Google mesh device, but I have seen issues in other complex routers.
  • CLOUD. Error was that the cloud was not available (I see this frequently, no apparent reason). When this is encountered, the only fix is to try again.
  • App Change (next version): Eliminate fatal error and clarify error messages.

Dave

Hi @djgutheinz,

Every chance this issue is at my end and not related to the Kasa drivers, but thought I'd check with you (and others) in case it was.... I saw this error in my logs, could it be something I have done or should change? The same pattern appears in the logs for most of my plugs. Happy to take this on myself as something to follow up or investigate, not expecting it is a problem with the Kasa drivers....

A restart seems to have solved the issue for now...

The preceding messages look like the event database was somehow corrupted or there was a loop in setting an event (every second or so) that would fill up the database.

Questions:

  • Hub version are you using?
  • Kasa Driver version and Device Type?

Dave

The same logs appear in both a C-4 and C-7, both running 2.3.0.121.

The Kasa drivers are version 6.5.0 according to info logs for more recent entries in the HE logs.

I have a mixture of the larger HS110 energy monitoring plugs, as well as the slimmer KP115 energy monitoring plugs. Both are represented in the kind of logs I showed in the last post.

Looks like I have bigger problems....

Error is in the setupEM function (called when you save preferences. I am looking for a loop in that area as well as the comms error area. Additionally, the parse UDP area.

The message with the wierd characters is the pre-decrypted return from the device.

1 Like