TP Link/Casa in-wall Switch to Control Other Devices/Scenes

Hi there! I am brand new to Hubitat and home automation in general, and I am in need of some guidance. I have just installed the TP Link Kasa integration app from @djgutheinz (Thank you Dave!), and I think I was successful! All 5 of my Kasa devices can be controlled from my Hubitat Devices tab. Here's what I need help with though: I want to be able to press my in-wall Kasa switch, and have it turn on my 3 Kasa smart plugs with lamps.

  • I've been able to accomplish this through the Kasa app as desired, but am hoping to change over to hubitat and ultimately take this automation off of the cloud.

  • I've been able to ALMOST accomplish this through Basic Rules and Rule Machine, but not quite. By almost, I mean that everything works from the computer, but not from the wall. On the Hubitat, I can turn on and off the switch from the devices tab, and all 3 lamps turn on and off perfectly. BUT when I hit the physical switch on the wall, Hubitat doesn't seem to recognize that the switch is on (unless I hit refresh), so no lamps. Once I hit refresh from the devices tab for the in-wall switch, Hubitat recognizes the current status of the in-wall switch and the lamps immediately respond.

Please help me find a way to use my cheap wifi switch, through hubitat, to control my other cheap wifi plug switches. You're my only hope Hubitat Community!


Sounds like you need to increase polling on the switches. By default, it's set kinda high.

Use extreme caution with this setting. You can bottom out the performance of your hub if you change the polling to every 30 seconds on all of your devices (for example). You'll be ok using increased polling on a few important devices (I do the same thing).

Thank you for the suggestion. I set the poll interval to the shortest option (5 seconds), and the wall switch does now control the lamps. However, it takes up to 5 seconds for the lamps to respond. Is the the fastest I can expect from my current setup? If so, are there any suggestions in changing devices. I'd still like to use my TP Link smart plugs (they don't seem to be the issue), but I'm willing to change out my wall switch to another option if it still looks like a decora style switch but functions quicker than my Kasa Switch.

I have it designed to a minimum of 5 seconds to preclude over-taxing a hub. At 5 seconds, the load is fairly low of total hub time to respond. Going to 2 seconds would increase the device load by 2.5 times.

You can change the plug-switch driver code to get a faster speed (I am unwilling due to impacts stated above). On line 48 of the "Kasa Plug Switch" driver are the lines:

	command "setPollInterval", [[
		name: "Poll Interval in seconds",
		constraints: ["default", "5 seconds", "10 seconds", "15 seconds",
					  "30 seconds", "1 minute", "5 minutes",  "10 minutes",
					  "30 minutes"],

Change these to read, as below (adding 2 seconds):

	command "setPollInterval", [[
		name: "Poll Interval in seconds",
		constraints: ["default", "2 seconds", "5 seconds", "10 seconds", "15 seconds",
					  "30 seconds", "1 minute", "5 minutes",  "10 minutes",
					  "30 minutes"],

That will give a response of 0 - 2 seconds with a 1 second average.

Safest method is to add (including quotation marks and comma)

"2 seconds",

after the


entry. The commas are very important.

After doing this, go to the Runtime Stats and restart (trash can). Then run for several hours /days and review and verify your total is still low.


1 Like

Download the Hubitat app