[DEPRECATED] Kasa Plug, Switch, and Bulb integration

I have a question about polling. I'm just using this app to do something very simple. In my living room, we have an air purifier. It is plugged into the same HS300 as the TV. I am making a rule to turn the plug with the air purifier off when the TV turns on and then turn the plug back on after a few seconds (purifier requires a button press to start). Basically this will automate turning the purifier off when the TV is turned on.

I know that it probably doesn't matter, but I like being as efficient as possible. It's my understanding that when polling the HS300, it returns the data for all the plugs at once. So I shouldn't need to poll the TV and the purifier separately. Is this correct? If so, how do I do this in your app? Right now I've set it up to poll the TV and air purifier every 20 seconds (because I only want to send the command to turn off the switch if the purifier is on; I don't want it turn off and on every 20 seconds).

My second question is similar. I've enabled energy monitoring for both devices. There is a separate "device refresh interval" preference next to this option that defaults to 60 minutes. What does this option do?

Thanks for the question.

Combined Polling. It is not possible with this driver to combine. That is because the polling / refresh is for both the plug on/off state and the plug energy usage state.

  • All of my drivers are designed for manual operation without a plug-plug interface. I would have to delete this capability.
  • What you are saying is possible, but it would require using the application to update the sister plugs in the HS300. That is possible, but I will have to think A LOT before implementing.
  • Note that you should only use the quick polling if you have an need. Polling more than 2 plugs on a HS300 simultaneously can cause errors.
  • Note also, please, that most drivers do not have the quick poll options.

Energy Polling. Polling for a plug also gets the current energy usage (single command).

Future Changes: I will look into combining the refresh / polling for plug on/off state. It will take a significant amount of logic coordinating between the devices, but may be worth it. I will have to see.

Right now I've got both devices set up identically, like this

This is the rule I created. It seems to be working.

image

So what should I set the device refresh interval to? There doesn't seem to be a disable setting. Should I just set it to the highest value? I'm not really sure what you mean when you mention combined polling, unless you're talking about what I mentioned with polling the HS300 once for data about more than 1 plug.

Your use case and rule: Quick polling is not necessary nor of any value. When you turn the TV power on, the system will detect the change and the rule to turn off then on the air purifier will work.

Action: Select the button on the page "Set Poll Interval:" with a value of "off". This will turn off the unnecessary quick polling.

For your case, quick polling is not necessary.

Maybe I don't understand how your app works then. If I don't poll the plugs, how will Hubitat know anything about them, outside of the 60 minute device refresh interval?

EDIT: Okay, so I turned off the polling and changed the device refresh interval to 1 minute and I think that works too. I'd like to refresh more than once per minute though. More like once every 20 - 30 seconds.

Fine. You can go down to 10 seconds.

When the plug is turned on or off through Hubitat, the return from the device is the current status, whuch the driver reads and then sends an event. This takes about 1/3 second. Once the event is sent, the trigger is activated in the rule machine.

Hi @djgutheinz,

Did the KP105 ever make it into a build? It's still not automatically picking this model up. The LED on/off function also doesn't work on this model.

Let me know if I can help by providing you any info/debug data.

It is not in the US model list from KP Link, so this is the first time I have heard about it. I have done an update to the application only (and the product table only). Link to code:

https://raw.githubusercontent.com/DaveGut/HubitatActive/master/KasaDevices/Application/KasaIntegrationApp.groovy

1 Like

That works! Thanks for the super fast update.

The LED on and off function isn't working on this model, but I believe this may be because TP-Link bought the Tapo smart plug product, made a few minor design tweaks and stuck a Kasa logo on it and called it their Mini plug! It's likely a different parameter sets the LED state perhaps.

Let me know if I can help in any way.

1 Like

LED on/off is weird across the entire product line. It is available for use if it is helpful. For example, the HS200 switch does the following:

LED Setting / LED with Switch On / LED with Switch Off
0n / OFF / ON
Off / ON / ON

VERY WEIRD - but a Kasa issue. The command is exactly the same whether HS200 or HS220 and the functionality within the device may be different.

Dave

Dave

Thank you, works great on my HS103P3 devices (KASA Smart Wi-Fi Plug Lite)

Hoping for some help...new to Hubitat (another smartthings retread) and I decided to try the Kasa outlets I have prior to the z-wave switches currently on Version 2 ST hub. So, I have three plugs, all running lamps. I run the app and get the following:

Kasa App Alias Inst Hubitat Driver ID
Lamp 4 No Kasa Plug Switch
Lamp 3 No Kasa Plug Switch
Lamp 2 Yes Kasa EM Plug

Which is great! All are there...but I go to devices and I have the following:

|Lamp 2 (HS110) |Kasa EM Plug|User|50C7BF98F2BE|2020-09-11 7:34:24 PM PDT|
|Lamp 4(HS103)|Kasa Plug Switch|User|C2A5119895A2|2020-09-09 4:12:28 PM PDT|

No Lamp 3! Don't see any errors on the logs...Suggestions?

Thanks for any help that might be offered!

Michael

I will need the logs during installation. Also, please tell me the exact device type for Lamp 3. It may be a new model number to me.

Dave

Thank you Dave!

I hope this doesn't run too long! I tried several things to get it to find the lamp. It I did a copy and paste...if this isn't the right way, please let me know. Both lamp 3 and lamp 4 are the same device, so that really puzzeled me.

Thank you again!

Michael

it is too long. I copied over to a file. Please delete the post to save space on this page.

I have a couple questions that I could not find when searching the tread.

I have HS220 dimmer switches with hue bulbs. The switch is bypassed to have constant power to the bulbs to allow changing of temperature when the light is off.

  1. Is there a way to get the dimmer buttons on the physical switch to adjust the bulbs through hubitat?

  2. Polling: can we get around polling by allowing the switch to send a status update to improve delay? currently have polling set to 5 seconds.

Thanks!

Welcome to the group.

Dimmer on Hue: I do not know if a dimmer bulb can be controlled through a dimmer switch. Probably not (the dimming circuits are in the bulb, not the bulb power input).

Polling: Fast polling is a method to provide the status update.

Dave

@djgutheinz how quick is quick polling?

It’s as quick as you set it to be. From memory you can select different values ranging from 5 to 30 seconds

Mattias is correct; however, you want only use when necessary. Too many devices could push the hub over threshold in performance.