[DEPRECATED] Kasa Plug, Switch, and Bulb integration

Not energy monitor, it is just the size of the message. The multi-plug returns can be long, as can the EM plugs.

Ah gotcha. I use them for sense monitor and forgot this driver doesn't monitor the energy. Is the limitation with Hubitat. Sorry for the nub question

Limitation is my explicit knowledge of the EM functions (how to call and how to parse) for the 300.

This app works great, thank you very much for your hard work. I just added a KP400 (dual outdoor plugs) to my setup. Any chance of a driver to support this device? Never had much luck with the range of my GE outdoor zwave plugs but the KP400 is working great.

The KP400 should install using the driver file: TP-Link Multi-Plug (Hubitat).groovy.

Dave

1 Like

I installed that driver also but initially it didn’t discover the plug. Launched the app again this morning and there it was! Works perfectly. Thanks again!

1 Like

All,
An update is planned for 15 July with the following changes:

  • Synchronize Names. Preference. three options: do not synchronize, synchronize with the Hubitat Label as the master, or synchronize with the device (Kasa) alias as the master).
  • Debug logging. Preference. On or off without a 30 minute turn off. Default is off.
  • Info Logging. Preference. On or off preference. Default is on.
  • Fast Polling for Plug-Switch Driver. Code Option. Default is false. User can set to fast polling in the driver code. Then go to the individual devices to select the true/false Preference. Will monitor on/off state every 5 seconds and update attribute switch if changed.
  • Fast Polling for the Energy Monitor Switch Driver. Code Option. Default is false. User can set to fast polling in the driver code. Then go to the individual devices to select the true/false Preference. Will monitor power state every 5 seconds and update attribute power if changed.
  • Reduced attribute updates. To reduce system load, now only update attributes and log the info message when they have changed.
  • Hubitat Import Capability. Added an internal link that will allow future updates via the import button in the driver / application editor.
  • HS-300 Energy Monitor Driver. A new driver for the HS-300 multi-plug which also has energy monitoring capability should be ready (I get my multi-plug tomorrow). Exact details coming soon.
  • Compatibility. I will assure compatibility with all Version 4.x drivers using the new drivers and application. The Version 4.x drivers are the UDP communications versions that are currently on the server.

Notes on fast polling:

  1. Can have significant impact on Hub resources if used by too many devices.
  2. If device is off-line (no response received), will immediately stop. Will restart at the next refresh cycle.
  3. Typical Use Case - Switch. To monitor someone using the wall switch with the desire for a follow-on action (i.e., turn on/off other items). Example: Turn on left hall switch and right turns on rapidly and automatically using a rule (within 6 seconds, 3 seconds average).
  4. Typical Use Case - Energy Monitor Plug. Monitor a gas dryer (or low amp electric dryer) or washer to report when cycle finishes and power usage drops below a nominal setting. Using Rule Machine can sent SMS message, cause audio TTS announcement, or turn on/off light).
  5. I am still not convinced that one minute polling is not sufficient - especially for the energy monitor; however, I do listen and the function was easy to implement.

Current status. All code is done except the HS-300 driver. I have been completing robustness and stress testing on my hub using 1 minute polling, fast polling, and 15 minute application polling without detected (by my operations) impact.

Comments, concerns, and complaints are welcome.

Dave

3 Likes

Sounds like a crazy good update is heading our way.
Very cool Dave

Cheers Dave,
sounds great

Update to 4.3 now available. See note at root of this post.

Dave

1 Like

Note on Energy Monitor Functions in HS-110 and HS-300
I have added the below note to the top-level:
The data presented in the Hubitat interface will NOT match that in the Kasa App:
Power: Should be the same
Energy: Should be the same; however, if a preference has been run, will not match.
7DayAverage, 7DayTotal, 30DayAverage, 30DayTotal: not provided. Instead ThisMonth and LastMonth equivalents are provided.

Reason: The return from the devices is truncated when the total characters exceed 1024. When this occurs, the remaining data is incomplete and can not be read. I have also tried the Hubitat "Raw TCP" and "Protocol.RAW_LAN" and confirmed that neither of these work with the HS-300 EM Multi-plug.

Am I reading this correctly, that this app/integration is able to provide energy monitoring for the Hs100, which it doesn't natively?

1 Like

typo. HS-110.

3 Likes

I have the HS110 monitoring my gas dryer. The 30 minute polling was not specific enough for me, so I appreciate the ability to change this parameter. Is there a way with Rule Manager to change the polling to 5 minutes when drawing power, then revert to 30 minutes when not drawing power? Or might this considered as a future feature for your code? Thanks for your great work!

Hey Dave,

Also in Aust. Got 5 HS110's today. I'm setting them up, but getting errors. I've succesfully added them to wifi network, and asigned static IP. When I add to HE though, errors and warnings. I've added in the app and the right driver.

Driver installed:

This is the first TP Link device I've installed. I have four more to do.

Edit: FYI, the app finds the plug, but when I select the plug, it errors with the above error. No device is added to HE.

EDIT 2: dont worry, I didnt realise what EM stood for. Now I do. Stupid me.

But, it's not updating the on/off/status/etc.

It seemed to fix itself after 10 mins or so. Thanks for the app!

1 Like

How do I get energy monitoring for the HS110's. I've got the right driver, and it's all connected to HE, however, it only has on/off/refresh. Nothing about energy monitoring.....

Edit: I'm still getting a stack of those timeout's in the post 2 above when I add new switches into the HE mix.

Timeout errors: These are due to a rather cumbersome (but unavoidable) discovery method. Since Hubitat does not support UDP discovery, I must poll the LAN IP:9999 addresses. If successful, then I data is returned and I parse that data. If unsuccessful, I get the above. This only occurs when you run the app, and then one-time.

No EM Data: You may have hooked to the incorrect file (there are two for two different devices). The correct file link is " TP-LinkEM-Plug(Hubitat).groovy".
Documentation: Installation instructions created to add note on UDP errors and also correct fild identifier for the EM plug.

If you still have a problem, I will look further at the code to see what is going on.
Dave

Dave

Hey Dave, I do have the right driver in Hubitat. Something else is going on I suspect. I've now got two identical versions of the hubitat energy monitor driver in HE.

Uninstall and start over tomorrow when I update the EM code.
Dave