[DEPRECATED] Kasa Plug, Switch, and Bulb integration

You did a save preferences after selecting the function?

The functions are one shot. They do a one-time update of the name.

@djgutheinz
Dave,

Yes, preferences saved. I just redid it and still no name change and the plug info is still incorrect.

I even tried deleting the device name and leaving it blank, then saved the device. Went back in and saved preferences. No device name added.

OK. Able to test this AM. There is an error in the code. In the meantime, you can change the device name manually on the device's edit page. Fix will be in next update.

Dave

New Version 6.5.3 now available.

Update Note: After updating the APP and DRIVERS, do one of the following to assure proper operation (especially of the EM Funtion). Either of these actions will configure all devices and the app to new data and updated scheduling.

  • Open the App and simply exit OR,
  • Open any ONE device's edit page and select the command "configure"

Link to change description: HubitatActive/Changes-6_5_3.pdf at master ยท DaveGut/HubitatActive (github.com)

4 Likes

Anyone else getting these errors when upgrading via HPM? I am coming from 6.5.1

app:4732022-04-23 03:39:20.221 pm errorError upgrading driver groovyx.net.http.HttpResponseException: status code: 500, reason phrase: Server Error
app:4732022-04-23 03:39:20.048 pm errorError upgrading driver groovyx.net.http.HttpResponseException: status code: 500, reason phrase: Server Error
app:4732022-04-23 03:39:18.567 pm infoFatal error occurred, rolling back
app:4732022-04-23 03:39:18.564 pm errorError upgrading driver groovyx.net.http.HttpResponseException: status code: 500, reason phrase: Server Error
app:4732022-04-23 03:39:18.370 pm infoUpgrading Dimming Switch
app:4732022-04-23 03:39:18.367 pm errorError retrieving driver source: groovyx.net.http.HttpResponseException: status code: 500, reason phrase: Server Error
app:4732022-04-23 03:39:14.708 pm infoUpgrading All Plug-Switches (except Dimmer)
app:4732022-04-23 03:39:11.122 pm infoUpgrading Color Bulb
app:4732022-04-23 03:39:07.743 pm infoUpgrading Kasa Integration
app:4732022-04-23 03:39:07.595 pm infoDownloading Dimming Switch
app:4732022-04-23 03:39:07.461 pm infoDownloading All Plug-Switches (except Dimmer)
app:4732022-04-23 03:39:07.332 pm infoDownloading Color Bulb
app:4732022-04-23 03:39:07.213 pm infoDownloading Kasa Integration

Mine seems to have moved through the versions ok, but can't tell what versions were involved each time, so can't comment on when it worked. There does appear to have been a requirement added for platform version 2.3.1 sometime recently, could that be playing a part?

Otherwise, the HTTP 500 error is a very general one, perhaps try doing the update again manually....? At different times people can experience issues with GitHub responding to requests.... That could have been the case for you....

1 Like

Tried again and same issue, it seems to install the base app, the color bulb and plug device driver, but keeps failing on the dimmer driver:
An error occurred while installing the package: Failed to upgrade driver https://raw.githubusercontent.com/DaveGut/HubitatActive/master/KasaDevices/DeviceDrivers/DimmingSwitch.groovy.

From my testing yesterday using HPM:

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:51:17.407 am [debug](http://192.168.50.197/installedapp/configure/3607)Updates complete

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:51:14.099 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading DEPRECATED Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:51:10.731 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading DEPRECATED EM Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:51:07.152 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading DEPRECATED EM Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:51:04.179 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading Dimming Switch

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:51:00.526 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading All Plug-Switches (except Dimmer)

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:55.281 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading Light Strip

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:50.626 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading Mono/White Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:45.032 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading Color Temp Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:35.960 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading Color Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:26.405 am [info](http://192.168.50.197/installedapp/configure/3607)Upgrading Kasa Integration

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:26.046 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading DEPRECATED Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:25.818 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading DEPRECATED EM Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:25.572 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading DEPRECATED EM Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:25.338 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading Dimming Switch

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:25.113 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading All Plug-Switches (except Dimmer)

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:24.875 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading Light Strip

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:24.603 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading Mono/White Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:24.388 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading Color Temp Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:24.168 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading Color Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:23.909 am [info](http://192.168.50.197/installedapp/configure/3607)Downloading Kasa Integration

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:23.609 am [debug](http://192.168.50.197/installedapp/configure/3607)Performing update

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:16.321 am [debug](http://192.168.50.197/installedapp/configure/3607)prefPkgVerifyUpdates

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:13.037 am [debug](http://192.168.50.197/installedapp/configure/3607)Updates available

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:07.607 am [debug](http://192.168.50.197/installedapp/configure/3607)Updates available

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:06.757 am [info](http://192.168.50.197/installedapp/configure/3607)Checking for updates for Xiaomi/Aqara Temperature & Humidity Sensor

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:06.754 am [debug](http://192.168.50.197/installedapp/configure/3607)Updates found package for https://raw.githubusercontent.com/DaveGut/HubitatActive/master/KasaDevices/packageManifest.json -> null (force production: true)

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:06.749 am [debug](http://192.168.50.197/installedapp/configure/3607)Updates found for package https://raw.githubusercontent.com/DaveGut/HubitatActive/master/KasaDevices/packageManifest.json

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:06.541 am [info](http://192.168.50.197/installedapp/configure/3607)Checking for updates for Kasa Plugs, Switches and Bulbs

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:06.351 am [info](http://192.168.50.197/installedapp/configure/3607)Checking for updates for Hubitat Package Manager

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:06.128 am [info](http://192.168.50.197/installedapp/configure/3607)Checking for updates for Samsung MultiRoom Speakers

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:05.818 am [info](http://192.168.50.197/installedapp/configure/3607)Checking for updates for MyQ Garage Door Integration

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:05.517 am [info](http://192.168.50.197/installedapp/configure/3607)Checking for updates for Samsung TV Remote

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-23 10:50:05.334 am [debug](http://192.168.50.197/installedapp/configure/3607)Update chosen

And just tried a repair:

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:55.879 pm [debug](http://192.168.50.197/installedapp/configure/3607)Repair complete

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:52.833 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling DEPRECATED Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:49.747 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling DEPRECATED EM Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:46.200 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling DEPRECATED EM Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:43.069 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling Dimming Switch

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:39.881 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling All Plug-Switches (except Dimmer)

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:35.510 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling Light Strip

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:31.977 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling Mono/White Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:27.964 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling Color Temp Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:22.573 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling Color Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:18.120 pm [info](http://192.168.50.197/installedapp/configure/3607)Reinstalling Kasa Integration

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:17.645 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading DEPRECATED Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:17.352 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading DEPRECATED EM Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:17.104 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading DEPRECATED EM Multi Plug

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:16.891 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading Dimming Switch

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:16.696 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading All Plug-Switches (except Dimmer)

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:16.407 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading Light Strip

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:16.166 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading Mono/White Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:15.955 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading Color Temp Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:15.716 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading Color Bulb

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:15.502 pm [info](http://192.168.50.197/installedapp/configure/3607)Downloading Kasa Integration

[app:3607](http://192.168.50.197/logs#pastapp3607)2022-04-24 02:23:14.698 pm [debug](http://192.168.50.197/installedapp/configure/3607)Executing repair

Anyone else seeing a difference between Kasa app and Kasa cloud stoed device information? I renamed all of the plugs in an HS300 and then imported into several apps (Google Home, HE, HA) and all show old device info, not the updated info. It looks like the App info is not being stored after changes. I thought it was the Kasa Integration in HE, but it is happening with other apps to.

Hi @djgutheinz,

I was wondering whether you would consider / be able to put any kind of delay between the recording of an update to the switch attribute and the current power? The reason I ask is that I have noticed recently that my RM rule to detect my dehumidifier tank is full has started firing when it is not full. I don't have enough history to confirm this is the cause, but I am wondering whether the power and switch readings could be being recorded too close together, so my restriction around the switch being on is somehow now being honoured?

I received a notification at about 5:15pm today. I am thinking the transition to off may not have been reflected in the restriction until after the power reading of zero was also recorded...? Bit of a long shot...

I'll eventually get back around to putting an extra wait condition in the rule if you don't want / can't handle it in the driver. Mostly I'm just being lazy... :slight_smile:

The current design for polling is to poll the switch.

  • If the switch is on, I immediately poll power.
  • If the switch is off, power is set to 0 w/o polling (when the switch is off, the power is truely removed from the circuit and is zero).

In your case, there is a possibility that the following happens:

  • the switch is turned on and power is immediately polled for.
  • the power is below 15 and the rule turns off the power.

Is that the case? If so, I can put a 4 second delay in polling for power within the current polling design (allowing as fast as 5 sec polling interval).

To test this, you can modify your driver code on line 161

  • Current:
    • getPower()
  • update:
    • runIn(3, getPower)

If that works, tell me and I will add it to a maintenance release.

Dave

It's when the device turns off. I am suspecting the zero'ing of the power may somehow get in before the restriction kicks in. My rule is only meant to be waiting for a trigger when it is switched on and when the power drops below 15W it sends me a notification.

I get where you were heading though, I had a similar thought at one point, but the event history screenshot and the fact I received a notification around the time it turned off lead me to my potentially flawed conclusion.

Try after Line 163, adding the line

pauseExecution(3000)

If that fixes the problem, then great. Easy enough to update.

Dave

1 Like

Thanks Dave, I'll need to try it out tomorrow (just) night after work. I'll let you know the result. Well... Actually... I'll probably need to let it run for a couple of days, now that I think about it.

I've added the code, we'll see how it goes. Should be enough moisture still over the next week to test it out...

		} else if (onOff == "off" &&
				   device.currentValue("power") > 0) {
            pauseExecution(3000)
			sendEvent(name: "power", value: 0, descriptionText: "Watts", unit: "W")
			logInfo("setSysinfo: [power: 0]")
		}

Good. Let me know if it works (please). I will then add to baseline.

1 Like

One successful notification down and no false positives today, so I expect the delay following the turn off event is working, but will give it a couple more days to be sure.

I'm wondering whether the same thing you suggest originally for turning on may help my rule for my iron and motion lighting. I'll try it out over the weekend as well and see if it helps.

There is a combination Motion detector/Light Switch KS200M. Is that supported currently? Just bought two of them thinking they likely were, but searching this thread and documents, the number doesn't appear anywhere.
They are quite cool devices with the motion detector built in. I'm hoping they will work or can be added.
Thanks to all who write these devices in. You all rock!
Kasa KS200M

Hi Dave. It appears this fix has slipped through the cracks. Its back again.