[DEPRECATED] Kasa Plug, Switch, and Bulb integration

I am having a similar problem. However, I am unable to even discover the Hs105s in tp-link integration app. Though I am able to discover them in Kasa App. Any Solutions?

@ken4

The Hubitat Hub to Lutron Caseta Pro Hub connection is wired so you only need an ethernet switch for that portion. I believe you will need an internet connection to setup the Lutron and, of course, if you want to use the Lutron App. I don't think you need a connection once setup except for software updates which, so far, seem fairly infrequent. I have never tried pulling the plug on the internet to see what happens to the Caseta devices . . . I suppose that's a test I should perform!

I could not find any of my devices until I removed the alexa app connection to tp-link. Once alexa was removed, the devices appeared.

Do you have the kasa skill for alexa installed?

Do a manual installation of the devices. They may not be on the same LAN segment as your Hubitat device.

Dave

Thanks for the response. I was actually able to solve my issue with discovering my Kasa mini HS105 plugs last night. They wouldn't connect to my standard Home wifi network, while they had no problems connecting to my Guest Wifi and being discovered through the kasa app. I discovered this to be an issue for hubitat. It wasn't very happy about those IP addresses coming from another network. As for why they wouldn't connect to my Home network for 3 hours, I'm still not entirely sure what was going on with my router. I power cycled the router and played with some of my router's settings. I Was able to finally discover them through hubitat integration, but only once the HS105s connected to the same router as the ethernet LAN port on the HE. Seems to be working without any issues. Loving it so far.

1 Like

Update to 4.5.12. Updated the drivers to 4.5.12. Main changes:

For quick refresh on Switches, The driver will not send an event unless the new state is different than the old state.
For the Energy Monitor functions, same exclusion based on Power level.

This should eliminate all of the spurious events being generated in smart apps and reduce system overhead.

Dave

1 Like

Thanks, updated my drivers, and it took all of 5 seconds with the import function. Great work @djgutheinz !

1 Like

I think something is wrong with your dimmer switch driver. I'm on 4.5.12

The device in HE doesn't show any dimming options. Also, when using HubConnect, these dimmer switches are not listed as dimmers but shows as switches instead. Let me know if you need screen shots.

I messed up. JUST FIXED and UPDATED driver on GitHub.

Feedback welcome.
Dave

@djgutheinz, couldn't agree more - the Import function works great.
Thanks

You did understand that a fix is on GitHub? My wording was imperfect.

Dave,

Not sure if this recent fix was supposed to fix this, but I'm still getting a fair few state changes where nothing has changed flow through to the hubconnect main hub.

For example, yesterday I set up Christmas lights with a brand new tp-link plug.
Real device: 89 events in about 24 hours....

Hubconnect device in 24 hours.

For this device, it's a TP-Link Engr Mon Plug, at version 4.5.12.

I don't have anything to add yet, just wanted to drop a big thanks to @djgutheinz, during my research phase this thread is basically the reason I bought a hubitat. Thanks!
:+1:

2 Likes

For the EM plug, I monitor change in Power in quick poll. If not the same as previous, the event is generated and will feed throughout the system. The anticipated use case was monitoring the device (i.e., a washer) for when the power went below a threshold, indicating time to change out to dryer. It could also be used if someone turned or unplugged a connected device. It is working as intended.

There are other checks I could implement and I will play with the code; however, the processing impact is extensive.

Dave

Hi, new to hubitat (as in just installed it). Added your app and its working perfectly.
Just wondering if that status can be faster, sometimes my HS110's are changed outside of hubitat. I tried fast power polling and thats great, surely a postive power reading means the switch is on?

You realise that you can go into the device page and update it to 1 minute.

Alternatively, create a rule in Rule Machine that says when power is > x, refresh device every 60 seconds.

Hi, yes i did see the refresh internal and thanks for that automation i'll take a look.
I'm just used to home assistant where it had had basically no delay if i was to change the status of the plug via an outside means (eg with the kasa app)

Awesome! Thank you for all your hard work putting this together. It is very much appreciated.

Log Message Implementation in TP-Link Device Integration
There has been significant discussion on log messaging for the TP-Link device integration, mostly complaints about too many entries. I have reduced to a minimum the log lines within the various methods. When completing the logging implementation, I also consider that the device events log report when an attribute (state) has changed.

Events. The logs work with the device events list to determine what has occurred in the past. I use the capability events that report when the device states change, as below:

  • On/Off
  • Level
  • Bulb Color States
  • Energy Monitor Data
  • Communications errors (turns on if comms fail, back off when comms are normal) - a custom attribute.

Warning logs. (No user filter.) Purpose: Identify if a command was not executed for a known and anticipated reason. These are generated when an abnormal condition occurs. Examples are the user enters an invalid parameter, a communications error, or an invalid return from the device.

Debug Logs. (Recommend Disable.) Purpose: troubleshoot the interface in case of error messages. I uses debug log entries through the code and display raw returns from the device. When you select Debug Logs, logging will stop after 30 minutes. Use debug logging if you are having problems and want to post detailed data on the issue.

Information Logging. (Recommend Disable.) Purpose: Determine if the device commands and refresh are working and returning data. I use info log entries to report any time the attributes are updated, whether there is a change or not. This includes on Refresh, but not on quick polling. If turned-on, it will occur at each refresh as well as each command sent to the device. Exception: For quick-polling, I do not log the event being sent.

Quick Polling Information
I have added two types of quick polling to some of the drivers. I added these on request of the user - but they should be used only in limited cases. These exact a significant processing bandwidth on the Hubitat server. Wherever possible, consider using a faster refresh rate instead. Consider resetting to normal polling when not needed.

Switch Quick Polling.

  • Only available on the non-energy monitor plugs and switches.
  • Anticipated use case is for a SWITCH, not a plug, to monitor when someone activates the switch manually and a 1 minute refresh rate is insufficient.

Energy Monitor Quick Polling.

  • Only available on Energy Monitoring devices.
  • Track power in watts for the device.
  • Anticipated use case is for monitor power consumption within a rule to determine if power is above or below a (rule-defined) threshold. For use when one minute refresh is insufficient.

If anyone disagrees with these or has other comments now is the time.

Dave

3 Likes

Thanks for your hard work getting these drivers to work Dave! I have just bought myself my first pair of TP-link smart plugs and they work brilliantly with your drivers. Thanks again! I will get some more plugs tomorrow :slight_smile: