[DEPRECATED] Kasa Plug, Switch, and Bulb integration

Dec 20, 2022. Migrating to Kasa Built-In Integration Recommendation

I do not recommend existing Kasa Community Integration users migrate to the built-in app. I recommend that new users utilize the Built-in app.

For those who have already migrated. The devices will work normally. If you have not set STATIC IP Address, do so at your earliest convenience. The only work-around currently is to uninstall and then reinstall the device (whether installing via the built-in or community app).

Reason for recommendation: On migrating to the built-in integration, things appear to go well with all devices integrated and as children. However, once the hub undergoes a reboot, all devices are orphaned from the application. There is NO IMPACT on day-to-day LAN operations of the devices. Impacts are:

  1. Future device installation will offer existing devices for installation. This will cause an error (and possible confusion) if selected. The new selection will not install; however, the old will still work.
  2. If you have not set static ip addresses (AS INSTRUCTED), the recovery by running discovery in the app will not work.
  3. Some of the data on the multi-plugs are coordinated through the app (again, no major impact.
  4. You will not be able to connect to a device via the CLOUD.

Testing done (on my C-7 development hub):
I performed 5 test runs to assure consistency.

  • Installed the community integration with 5 devices.
  • Installed the built-in integration and did a migrate
  • Validated children were in the built-in and not in the community application database.
  • Did a hub backup (just in case)
  • Reboot with community app still installed
    • Children migrated back to the community app
  • Reboot after removing the community app
    • Children were orphaned

Final note: my objective (at 74 yo) is have Hubitat take over the integration and no longer have the community integration. This is still at least a year away.

5 Likes

I've had some issues with status reporting from my HS110 plugs since I updated to the latest community driver and app (2.3.4_R1). Two of these plugs are regularly used so I noticed fairly quickly that something wasn't working right, but I haven't sat down to troubleshoot it until now. I do not recall if I updated to the latest version from the previous released version or if I skipped a few releases when updating, but if I skipped some versions, it would at a maximum have been the last 6 months' worth of releases.

What I've found is that the automatic polling on these devices is not working. I've got one set for every 1 minute and another set for every 5 minutes. For easier troubleshooting and set them to every 5 or 10 seconds. The power usage and the switch status are not updated on the device page. They report just fine on the Kasa iOS app. The buttons on the device page work though, so I can turn on and off the switches from the device page. I can also get the device page to update the status of the switch if I use the refresh button, but not if I leave the polling to do its job.

However, I cannot get the power usage to update at all, even using the refresh button. Again, the Kasa iOS app properly shows the power usage, but the device page will not update this data at all.

I used the Kasa iOS app to power on and off the switch to see if the device page would pick up on the changes. The plug also had a load connected to it, so when the switch was turned on, the power usage should display >1000W. I turned on debug logging on the device, and below was the output. Note that during this testing, the power usage was never updated in the device page and the switch status was only updated when I hit the refresh button. The polling interval was set to 5 or 10 seconds during this testing, cannot recall which.

I've got a message on my device page saying that a newer version of the driver exists, but the driver code and the app code both already match the latest available on GitHub and I've also used the repair function in HPM to reinstall the code. After the repair, I did a rediscover in the app, which didn't find any new devices, just the already installed ones, and then hit done and then went into the driver pages for these two plugs and hit "Configure", "Save Preferences" and "Save Device", just to be thorough.

I'm using the "Kasa Plug Switch" driver.

These are my settings for one of these plugs:

Note, the pollinterval has been put back to its original 1-minute setting for this screenshot. The power reading of 13 was the last reading it recorded several weeks back before it stopped working.

To complicate things further: I also have some other HS110 plugs, and at least some of them will automatically update the switch status, but they also do not update the power usage.

Could you simply add the data value using the Custom Device Note App?

2 Likes

Error: Updated from a very early integration version does not create the data value "feature" on the devices.

See the comment below and try that code, if you want. The data value is "feature" and the value for the EM plugs is "TIM:ENE".

IF that fails, a complete reinstall of the integration would be required.

1 Like

Holy moly. How you managed to figure out that that was the issue from my description is beyond me. But that worked! Thank you so much! And thanks also to @thebearmay for another one of his clever applications that saved the day!

2 Likes

I've been meaning to ask for awhile but forget.

KS200 dimmer. Is there any way to instantly set a level with this device?

If you use set level, and leave duration 0 it doesn't work. 1 is the shortest period of time that seems to work.

In settings I have it set for 1ms transition time and instant on all settings. On/off is pretty instant but going from say 1 to 99 takes one second at the fastest. Thinking this is a limitation of the actual dimmer.

In preferences, set Fade On and Fade Off to instant. Try that. If that does not work, change the gentle on times (two of them, the second should be off) to 0.

That's just about how I had it. Only difference is I had the ms options to 1.

The fastest I can get it to fade is 1s. Using set level in the device page, it seems putting duration 0 doesn't work. Putting 1s is at least faster than leaving it blank.

I'm thinking it's just the dinner itself. Even in the kasa app I can't adjust the levels instantly like some zwave or ZigBee dimmerd

I'm using this for a dusk to dawn floodlight with motion. At night when there's no motion they are lit up dimly than goes to full brightness when there's motion. But by the time I walk by and trigger the motion I'm already out of the area by the time they're at full brightness. I think it's just the nature of the beast with this unit.

I've been using your community drivers and just recently tried to migrate over to the Hub integrated drivers. I followed the instructions as much as I could, but I now when I go into the Hub integrated Kasa App, and ping all my devices, they're "orphaned".

When I try to install as new devices that it scans, it gives me an error.

Surprisingly, they all still work as devices and within WebCore, nothing really different, but they flood my logs, is this normal and how do I fix this?

Let me know, thank you! And of course, thank you for your efforts in working on this and the Samsung Remote :slight_smile:

Make sure that Hubitat is up to the latest version. Issue is on previous Hubitat versions.

See the link below from this thread for discussion of orphaning.

Also see the top of the thread.

Dave

1 Like

What is the best way to rename kasa devices? I've tried the following but the names seems to revert back after awhile.

  1. View Kasa device
  2. Under Device Information, update Device Label and click 'Save Device'
  3. Under Preferences, change Synchronize Names to Hubitat label master and click Save Preferences.

But later on, I see that the device label name has changed back and the Synchronize Name setting is back to Don't Synchronize. I do have the Amazon Echo Skill enabled so could there be a conflict there?

Sync names works on most, but not all devices (for some reason). Just do a manual sync with the Kasa App.

This works great, thank you!

1 Like

Hi @djgutheinz,

I've noticed recently the power reading for some of my plugs temporarily drop to zero and back up a short time later. The zero entry sometimes does not have a description in the Event, whereas the "valid" one says "Watts". Any ideas?

Thanks,
Simon

Simon,
The only time that power is set w/o a description is during the setup function (i.e., Save Preferences). What I need is the logs for the device +- 1 minute from the event where power goes to zero (from past logs) - if infoLogging is enabled. PM me these logs as TEXT.

Note that updated is called on ALL devices if you press the "configure" command and IF the device is not orphaned (a problem with the built-in App). I have checked these paths and the these are single-calls within the driver and app with the chain starting from a device only.

The only other obvious possibility is that configure is exposed and can be called from rule-machine.

Dave

Thanks @djgutheinz . I'll try and take another look in the next couple of days and get you the logs.

1 Like

Hi and thanks for this :slight_smile: I have quite a few TP-Link plugs working with Smartthings and I'm finally considering migrating to Hubitat.

I'm trying to understand if this integration is 100% local or does it still leverage the cloud at all?

Welcome to the community @wj72. You’ll be happy to know that this integration is entirely local, but can be set to use the Kasa cloud as well. I have even gone so far as to block all Internet access for my Kasa devices in my firewall and they still work :slight_smile:

3 Likes

Oh this is great news, looking forward to getting off the ST platform once the hub arrives. I was a little concerned I'd have to buy a bunch of new devices.

2 Likes

After install and testing on SmartThings, make sure you uninstall the devices from SmartThings. Just a good cleanup. Also, if you use Alexa, use the Hubitat Alexa integration to present the devices to Alexa and remove the Kasa Skill from Alexa. Avoids over/conflicting control. (The same is not true from the Kasa cloud).

1 Like