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!

Thanks!

1 Like

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).

1 Like

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

default,

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.

Dave

1 Like

Hi there @djgutheinz , I tried setting the polling interval to 5s, 10s, 15s, 30s and hit the "SET POLL INTERVAL" button, then I hit SAVE PREFERENCES.

however, in the logs it always displays 1 minute. I'm wondering if there's some sort of failsafe that doesn't allow anything less than 1 minute polling?

dev:2852021-11-24 08:37:43.905 pm info[Plug Switch, 6.4.2, Terrace Light] updated: [debug:false, descriptionText:true, bind:Sending bind command, emFunction:Disabled, pollInterval:1 minute, driverVersion:6.4.2]

dev:2852021-11-24 08:37:38.943 pm info[Plug Switch, 6.4.2, Terrace Light] setCommsType: [bind:true, useCloud:true, commsType:CLOUD]

dev:2852021-11-24 08:37:38.931 pm info[Plug Switch / 6.4.2 / Terrace Light]| setBindUnbind: Bind status set to true

EDIT: Interesting, I tried changing my KASA DIMMER SWITCH to 5s and it worked no problem. I think it has to do with the KASA PLUG SWITCH cannot poll less than 1m?

Cloud communications are limited to a minimum of one minute. Convert the plug to LAN communications in preferences and try again.

The cloud limitation is due to the high resources for the cloud communications and also not to bombard the Kasa Cloud.

1 Like

awesome, thank you so much for the assistance, I converted it to LAN and it worked perfectly.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.