[DEPRECATED] Kasa Plug, Switch, and Bulb integration

Hello,

I'm new to this and am not sure where to download the latest version.

Thanks

Go to the top of this thread.

1 Like

Of course, this was already fixed in version 6.4.x.

I'm on 6.4.3 already, though... I checked HPM and I don't have any Kasa updates.

Thank you for the great plug-in! All switches work just fine when controlled directly. But when I create an RM tule to turn switches ON as a result of some other event they turn on, then off, then back on several times. Fairly random and goes on for some time. I read some posts in this thread about polling but not sure if that’s the issue? Can’t seem to find an exact match to my problem. Appreciate any help. Thanks!

1 Like

Oleg, I really can't help. If you look at the device's page bottom, you will see the rules and groups it is associated with. Somewhere there is a link that causes the issue (probably).
Dave

1 Like

I think you may have indirectly tipped me off to the issue. This switch is not part of any other automations....however I think the trigger event (an LG TV turning on) is reporting faulty data causing the light to cycle. Thanks for the hint.

1 Like

Please Help.
Getting Unexpected Error page when I try to load the app. Error 1
I had just changed the IP segments to lookup when searching for new device.
I think I only had one IP range number in.
I keep seeing the ArrayIndexOutofBoundsExcetion on line 104. Logs that when I open the app.
I tried a repair of the app using package manager. Still the same.
Is there a way to reset the array? If I uninstall app and reinstall it will I have to put all the devices back in rules and automations, like new devices?
Would a hub database restore help?
Thanks

Here is the log it referenced.
2021-12-21 03:53:56.204 pm errorjava.lang.ArrayIndexOutOfBoundsException: 1 on line 104 (method startPage)

app:6712021-12-21 03:53:56.186 pm info[KasaInt/6.4.3-r3] starting Kasa Integration

app:6712021-12-21 03:51:56.149 pm errorjava.lang.ArrayIndexOutOfBoundsException: 1 on line 104 (method startPage)

app:6712021-12-21 03:51:56.127 pm info[KasaInt/6.4.3-r3] starting Kasa Integration

app:6712021-12-21 03:50:17.282 pm errorjava.lang.ArrayIndexOutOfBoundsException: 1 on line 104 (method startPage)

app:6712021-12-21 03:50:17.256 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:50:04.407 pm errorjava.lang.ArrayIndexOutOfBoundsException: 1 on line 104 (method startPage)

app:6712021-12-21 03:50:04.386 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:49:04.040 pm errorjava.lang.ArrayIndexOutOfBoundsException: 1 on line 104 (method startPage)

app:6712021-12-21 03:49:04.019 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:48:55.501 pm info[KasaInt/6.4.3-r4] parseDeviceData: Front Lights already in devices array.

app:6712021-12-21 03:48:54.240 pm info[KasaInt/6.4.3-r4] findDevices: Searching for LAN deivces on IP Segment = 192.168.1

app:6712021-12-21 03:48:54.237 pm info[KasaInt/6.4.3-r4] addDevicesPage

app:6712021-12-21 03:48:52.683 pm errorjava.lang.ArrayIndexOutOfBoundsException: 1 on line 104 (method startPage)

app:6712021-12-21 03:48:52.651 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:48:49.026 pm info[KasaInt/6.4.3-r4] parseDeviceData: Front Lights already in devices array.

app:6712021-12-21 03:48:47.747 pm info[KasaInt/6.4.3-r4] findDevices: Searching for LAN deivces on IP Segment = 192.168.1

app:6712021-12-21 03:48:47.743 pm info[KasaInt/6.4.3-r4] addDevicesPage

app:6712021-12-21 03:48:45.471 pm errorjava.lang.ArrayIndexOutOfBoundsException: 1 on line 104 (method startPage)

app:6712021-12-21 03:48:45.353 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:48:35.758 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:48:32.755 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:48:29.393 pm info[KasaInt/6.4.3-r4] parseDeviceData: Front Lights already in devices array.

app:6712021-12-21 03:48:28.137 pm info[KasaInt/6.4.3-r4] findDevices: Searching for LAN deivces on IP Segment = 192.168.1

app:6712021-12-21 03:48:28.134 pm info[KasaInt/6.4.3-r4] addDevicesPage

app:6712021-12-21 03:48:24.924 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

app:6712021-12-21 03:48:13.892 pm info[KasaInt/6.4.3-r4] parseDeviceData: Front Lights already in devices array.

app:6712021-12-21 03:48:12.631 pm info[KasaInt/6.4.3-r4] findDevices: Searching for LAN deivces on IP Segment = 192.168.1

app:6712021-12-21 03:48:12.618 pm info[KasaInt/6.4.3-r4] addDevicesPage

app:6712021-12-21 03:48:06.854 pm info[KasaInt/6.4.3-r4] starting Kasa Integration

A. Did you modify Lan Segments or the host address rage in the configuration? Those could cause the error. Check that.

As far as resetting the database: in the app, select Application Utilities and try "Reset the Device Database". PM me with results.

Dave

1 Like

Couldn't get into the app to try DB reset. Kept getting the Unexpected Error page.

I finally did get it fixed. I restored an older copy of my hub database and repaired your app for good measure via HPM. Seemed to take care of it.
I'm not a coder at all but I looked at the code. Could the problem be my hostArray in line 104 was only 1 number?
Anyway, it's fixed. Thanks for such a speedy reply to my plea for help.

Yes. The host array must be a range. Never expected it to be used for a solo IP. Examples are integrated into the apps display page.

Dave

I was trying to use it to get the app to change the DB name of just one device without having to do Reset the Device database. I had changed a plug name in device settings but app didn't pick that up automatically.
Great app BTW. Thanks for the hard work.

Thanks for finding this fatal error. A update version is due out tomorrow and I will check for this error. If there is an error (i.e., there is no range, it will automatically revert to the default).

FYI, some bulbs have apparently been modified to no longer accept the name change from Hubitat. Tomorrow's update will tell the user of the failure and the why. So far, the old LB series and the KL125/135 are impacted.

The reason for the update is not related to your error:

  • Adding setting to the Dimming Switch (configuration the long_press and double_tap functionalty for the physical switch.
  • Creating a installation status page that displays after the install to identify installed and not installed items with the driver name for the uninstalled device
  • Reducing number of drivers to preclude use errors in selecting drivers from HPM and manually (continual problem for EM and multi plugs).
1 Like

I had a range of just one IP address. I knew the static IP of the plug and used "Install Kasa Devices" on the one IP. That's when the error screen came up.
Will look for the update too.
Thanks again

Integration update to version 6.5.0.

Description in top post.

Update instructions:

  • update APP and Driver code (all).
  • Open App and run Install Devices or Reset Device Database (either one). This will cause updated to be run on each device. This is REQUIRED for the Dimming Switch to work properly.
    • Alternatively, run Save Preferences on each device

List of changes:

2 Likes

Hi Dave,

As promised, I got around to testing the synchronize names functionality. I figured out a way to aggregate the update to the devices but I ran into a questionable scenario.

It appears that I only have the ability to synchronize names back to kasa on the KL430 light strips. And while that's great, I'm unsure if it was intentionally left off the kasa color bulb KL130's or any other devices. Can you confirm if the synch name functionality was meant to be added to the preference section of all the devices or just the light strips?

Not urgent, I just noticed it as I was digging in. I am on 6.5.0

UPDATED RESPONSE

I found a sequence error in the Bulbs and Light Strip driver for Name Sync from the device. Fixed and incorporated online. A repair in HPM or replace the code fixes the error. (Does not impact Dimmer, Plugs, nor Switches).

Hubitat Sync. For name syncing from Hubitat to the device, the code is exactly the same (I use libraries for these common functions). However, I have noted suddenly that some devices return the method not available message. This includes the KL130, but not the KL135 (different firmware versions - the 135 is a hifi (color) bulb, so new firmware).

Device Sync. The code uses the return of poll to get the name (it is part of the status message). Parsing code varies by major device type (all Bulbs, Light Strip, Dimmer, and all Plugs).

UPDATE 2:
Testing results on Name Sync.

Device Master: Works except for multi-plugs (code fix in next release)
Hubitat Master: It worked for all my devices (various models of each deviceType) except bulbs with firmware version 1.8.11 (globally failed). Models impacted (out of my inventory): all LB series, KL130.

1 Like

I think you may want to know

With the new driver Alexa can't control the level change anymore from what I see in the set level you need a duration.

Alexa does change the level in the device but it's not communicating the info to the light

Like if you were changer the level in the app press set level without delays

Thank for you time this driver with those plug make this the best integration

What is the driver/device you are talking about (there are five that have setLevel)? Did you do a save Preference or run the app and "add Devices" after update (as per the update instructions)? (This is critical for the Dimmer and failure to do so may cause this error).

Just tested Dimming Switch, Color Bulb, CT Bulb, White/Mono Bulb, and Light Strip with Alexa, but had no issues setting levels.

I did a reset the data device database
Thinking that it will do exactly that.
the driver did update hs220 to version 6.5
But wasn't working .
I went to the device and did a save preference . I used to do this when you did update. and now it's working

Sorry for that

Alls OK. The major functional change was adding transition time (to actually work) to the dimmer. Therefore, initial driver device data had to be generated. (I failed to make this bulletproof - too hard to test every possibility with only two Hubs.)