[DEPRECATED] Kasa Plug, Switch, and Bulb integration

:+1:

I just migrated my Kasa devices from SmartThings to HE. I was having trouble with a couple of automations where a physical switch was pressed. The first was with a switch (connected to a fan) which I automate to turn off after 30 minutes. Setting the switch device polling to 5 minutes will fix the issue (as I don't care if it takes an extra 5 minutes for the fan to turn off).

The second automation involves two Kasa switches. If switch A is turned off, switch B should turn off. Simple enough. Without polling this does not work when physically turning off switch A. If I set polling on Switch A to 5 seconds, switch B does not always turn off if I set the automation using a Basic Rule. It does work if I poll both A and B. I noticed that if I use RM, I do not have to poll switch B. (I suppose RM sends the off command regardless of the status).

All that said, am I doing this correctly? Any other suggestions? (Even with RM there is a delay)

I don't use Basic Rule, but that sounds like it has "optimization" built in by default. That feature in HE is what you were getting at (if switch is already off, don't send the command). That's a toggleable option in RM.

1 Like

Thank you for your work on the Kasa integration. I just installed an ES20M today. I can control on/off/dimming from Hubitat. I haven't tried triggering any events by operating the switch. Let me know how I can help you develop for the other capabilities.
I also just checked for the Jasco/Enbrighten 26933, which was out of stock everywhere, except a single shop that had it on low stock, but for $72.49. Getting the ES20M fully supported would be amazing if a true Z-Wave Motion Dimmer isn't available anymore.

I have some ideas on how to get the motion; however, it may be delayed. Testing is on a Kasa Spot Cam. It will be several weeks - but definitely on my to-do list. I will contact you then for support.

1 Like

Hubitat next release to include Kasa Integration as built-in app.

This has been worked with me and the code is the 6.7.1 version. This custom integration will NOT go away (too many users adversely impacted).

https://community.hubitat.com/t/2-3-3-x-kasa-integration-migration/99904/3

18 Likes

Next level stuff! An official integration! Congratulations!

4 Likes

Dave,

Thank you so much for continuing to pprovide and support this wonderful solution.

I just used HPM to update your Kasa solution. I noticed something out of character. I saw a notice on your Kasa app saying it had an update available. I went to HPM and performed the update from an earlier release (not sure which) and it completed the update successfully, but did not clear the flag on the Kasa Integration line in the Apps listing. I performed a repair with HPM. It is still there. It shows that it is at version 6.7.1.

YF :cowboy_hat_face:

Press the configure button on any one device. That will update that information.

I did, but nothing happened. I also noticed the following:

State Variables

  • getEnergy : Today
  • pollInterval : 30 minutes
  • releaseNotes : Fixed limit-rate-exceeded issue from Kasa Cloud. Added driver capability Configuration. Other cleanups of code. See: https://github.com/DaveGut/HubitatActive/blob/master/KasaDevices/Docs/ChangeLog.pdf
  • UPDATE_AVAILABLE : App and driver updates are available to version 6.7.1. Consider updating.
  • lastCommand : {"emeter":{"get_realtime":{}}}
  • response :
    DRIVER_MISMATCH : **Driver version (6.5.4) not the same as App version (6.6.1)
  • errorCount : 0

I have updated HPM and repaired HPM and Kasa Integration apps on both of my hubs. Still seems I am having troubles.

YF :cowboy_hat_face:

For now, just ignore the warning. I am swamped and will look at later.

Hi, I tried to dim my Kasa outdoor switch and it didn't work (it did at one point but that was months ago)

I noticed the following the the event log:

dev:7302022-09-04 07:42:39.434 pm errorjava.lang.ClassCastException: null (method setLevel)
dev:7302022-09-04 07:41:58.030 pm errorjava.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String on line 256 (method setLevel)

Edit.. I got it working but wanted to report this anyway FWIW. I just tried to enable debug logging but when I hit save preferences it failed with an 'invalid value' for this attribute (it was set to 10000). I had never touched it before but changed to 1000 and hit save and now the light dims fine. Maybe something happened after an update?
image

1 Like

Great stuff! Any idea when the next Hubitat release may come out?

BTW that link above says "Oops! That page doesn’t exist or is private."; I am a new user not sure if that has anything to do with it.

The standard answer is "when it's ready" :slightly_smiling_face:

The version @djgutheinz referred to has just entered beta test about 1 week ago. So I would anticipate something within the next month.

1 Like

I will look into the error cause and fix for the next version. What driver version? Are you on the Hubitat Beta?

Open and check the value again. The app list is not dynamic, so when hpdating, it will not update on the display until you do a refresh or exit and return to the page.

Did some looking and I could not update.

Probable cause: You had updated the code since you last used the device. There were some changes (about 6 months ago). If you did not do a save preferences, the data elements / states may not have been correct - therefore the error.

That makes sense to me - thanks for looking!

1 Like

So I'm stumpped. I just added a new plug to the integration, and all my other kasa devices in hubitat quit working.

I can still control them from the kasa app, but nothing from in hubitat on the device page works.

I did the comms check, and the hub can ping all my devices okay (below). I've also power cycled devices and rebooted the hub.

Below "3D Printer" is the new device I just added, that works. It catches my eye it shows port 9999 but all the other devices show null.



Total Kasa devices: 9
[Ip:Port: [testResults, RSSI, Alias, Driver Version, Installed?]

10.20.20.40:null: [PASSED, -37, Garage Hill, 6.7.1, Yes]
10.20.20.41:null: [PASSED, -42, Garage Lower Lights, 6.7.1, Yes]
10.20.20.42:null: [PASSED, -64, Wall Post, 6.7.1, Yes]
10.20.20.43:null: [PASSED, -75, Deck Outlet 1, 6.7.1, Yes]
10.20.20.43:null: [PASSED, -75, Deck Outlet 2, 6.7.1, Yes]
10.20.20.44:null: [PASSED, -42, TestPlug, 6.7.1, Yes]
10.20.20.45:null: [PASSED, -68, Porch Outlet 1, 6.7.1, Yes]
10.20.20.45:null: [PASSED, -68, Porch Outlet 2, 6.7.1, Yes]
10.20.20.46:9999: [PASSED, -47, 3D Printer, 6.7.1, Yes]

Just got back to this issue. All of my Kasa devices have this:

tate Variables

  • getEnergy : Today
  • pollInterval : 30 minutes
  • releaseNotes : Fixed limit-rate-exceeded issue from Kasa Cloud. Added driver capability Configuration. Other cleanups of code. See: https://github.com/DaveGut/HubitatActive/blob/master/KasaDevices/Docs/ChangeLog.pdf
    *UPDATE_AVAILABLE : App and driver updates are available to version 6.7.1. Consider updating.
    ***** lastCommand : {"emeter":{"get_monthstat":{"year": 2022}}}
  • response :
  • DRIVER_MISMATCH : Driver version (6.5.4) not the same as App version (6.6.1)
  • errorCount : 0