[DEPRECATED] Kasa Plug, Switch, and Bulb integration

Thanks Dave, no rush.

Receiving this message when attempting to refresh the token

Unexpected Error

An unexpected error has occurred trying to load the app. Check Logs for more information.

Error: Cannot get property 'data' on null object

I am unable to control HS100 plugs HS103 plugs still have control

Version 6.3.1

Run the app. Before trying to update the token, turn on debug logging. Open a logging window. Try to update the token. Send me the log for the app only.

Dave

1 Like

I've been getting this error too but now I know what to do about the logs!

Thanks

I had been using this driver with success for a while now. I updated it yesterday using Hubitat Package Manager and noticed that my Kasa switches stopped responding via Hubitat.

I ended up opening the Kasa app and clicked on both of the options below.. I didn't remove or add anything - but noticed that the switches started working after doing this.
image

Not sure why they stopped working.. I haven't read all of the messages above but I saw something mentioning fixing IP addresses.. is that recommended? Otherwise, if I have to reboot my router and the switches get new IP addresses will that mess this up again?

There is a TEST driver out there for the EM Driver only (HS110 and HS115 only. It add the following enhancements that will become general in the next full release if deemed useful.

  • Add LED On/Off commands.
  • Remove LED On/Off Preference.
  • Added attribute Led with values (string) 'on", 'off"
  • Change attribute "commsError" to "string" with values "true" and "false" so that it will work with Rule machine.

Link to this test code: https://raw.githubusercontent.com/DaveGut/HubitatActive/master/zTestCode/6-3-2%20Test%20EM%20Plug.groovy

If you have problems replace the code using the import feature in the editor's page or the HPM repar feature.

1 Like

Running either install or remove researches for the devices and refreshes the device iPs. If you do not have static IPs and your WiFi server is off for several days, you may have all of your devices change IPs. Setting static device IPs precludes this problem. I am glad the problem was solved.

For all. Connectivity issue. Run the App and run Update Installed devices. If using Cloud, update the token. Otherwise the app will update the device IP for all the devices it finds. If it does not find a device, then Houston, we have a problem.

dave

1 Like

Thanks Dave. I will try to take a look over the weekend.

Hi Dave,

I've tested the latest changes you made and it all works and does everything I had asked for. I was able to simplify my RM rules to turn the LEDs on or off when transitioning between modes, I can implement monitoring rules based on the commsError attribute now and can see the attribute indicating if the LED is on or off. Great job!!

Thanks,
Simon

Actually, one minor thing I noticed was the preference for the led status did hang around after I applied the new version of the code. This makes sense given the Preference is still part of the code, but it doesn't seem to have any effect, i.e. changing it's value and hitting Save Preferences doesn't change anything, apart from the value stored in the Preference itself. Was just thinking it may be a little confusing for some to have both, perhaps the Preference should be removed...?

I was also confused when I looked at the code for the ledOn and ledOff commands that they appeared to be operating on the preferences, at least that is what I interpretted the code as doing. It works the way I want it, i.e. the attribute updates perfectly, so more of a question from a developer than an end users perspective...

Simon

same issue

Fixed test code and updated test code at same location.

1 Like

That all looks good Dave, thanks for removing the preference setting.

Hello,

Is there a way to bulk update the default poll interval? It seems to be set to 30 mins as a default. I recall seeing a setting in another integration and I was wondering if I was just missing it. I only see a way to update each device one at a time.

Regards,

1 Like

Take a look at the Preference Manager App. Its not specifcally associated with Kasa Integration but works with all devices. Its a generic app that lets you do bulk preference settings.

2 Likes

That was my first thought too... Unfortunately, at the moment, the poll interval is stored in a state variable, not a Preference, updated via the setPollInterval command.

Perhaps Dave could introduce something into the driver or the app, whether it be switching this to a Preference to open up the option for Preference Manager, or allowing a bulk update via the app.

I've been on a bit of a run lately in ensuring I can report / monitor various settings across my setup. My preference (pardon the pun) is to have the poll interval stored in an attribute, which would allow retrieval of it for display on a dashboard or provide visibility in other apps like Device Watchdog. But I would also not want to see it duplicated as a Preference, so that would remove the option for Preference Manager, making the change for bulk updates potentially more involved.

I'd be happy with any solution, it's not something I am looking at right now, just wanted to put a few options out there any some thoughts around what each one may provide....

Simon

1 Like

No, there is no way to bulk update poll interval. It would be dangerous given the potential extreme impact of fast polling on hub performance.

Dave

1 Like

sys:12021-05-19 01:21:08.142 pm Received cloud request for App 165 that does not exist, path: /ping from 52.203.225.134

sys:12021-05-19 01:21:07.694 pm Received cloud request for App 165 that does not exist, path: /ping from 52.203.225.134

app:642021-05-19 01:21:07.592 pm debug[KasaInt/6.3.1]: kasaAuthenticationPage

app:642021-05-19 01:21:02.007 pm errorjava.lang.NullPointerException: Cannot get property 'data' on null object on line 186 (getToken)

app:642021-05-19 01:21:01.997 pm info[KasaInt/6.3.1]: starting Kasa Integration, Version 6.3.1

app:642021-05-19 01:21:01.994 pm info[KasaInt/6.3.1]: getToken: TpLinkToken updated to e3be11c9-ATN4mG9phWpn6aU37f9QYCE

app:642021-05-19 01:21:01.630 pm info[KasaInt/6.3.1]: getToken chadleeper1@gmail.com

app:642021-05-19 01:20:59.403 pm debug[KasaInt/6.3.1]: kasaAuthenticationPage

app:642021-05-19 01:20:55.262 pm info[KasaInt/6.3.1]: starting Kasa Integration, Version 6.3.1

app:642021-05-19 01:20:51.549 pm info[KasaInt/6.3.1]: starting Kasa Integration, Version 6.3.1

Will be addressed in next version. Note the top 2 refer to app 165. The kasa app is app 64 - so I will not address that error.

This is all really great information! Thank you. Unrelated to this, I did see that there's a set polling interval option in webcore.

In theory, one could just write an easy script in webcore to do it but I don't know if that function in webcore actually works (some of the edge use functions don't work). I would have to run some tests to see if it works.

1 Like