Kasa (KP105) Smart Plug schedule/timer question

Pseudocyclic

Well-known member
I've just read that TP-Link Kasa KP105 smart plugs can turn themselves on and/or off at predetermined times even if Wi-Fi connection is lost. I was a bit sceptical so I tested it and was very pleasantly surprised to find that it's true, the timer must be stored in the plug itself. This means you can use one to reboot the router that the plug is connected to, for example by using the Kasa app to 'program' the plug to turn itself (and therefore the router too) off at 03:00 and then on again at 03:01.

I'm looking for a way to be able to do this as and when required, as opposed to daily at a pre-determined time.

An 'OK Google reboot router' routine would be great, but timers don't appear to be supported (although I could well be missing something obvious).

Are there any Macrodroid home automation gurus here who might already know how I could do this with a macro?
 

RSF

Well-known member
Couple options exist to control Kasa devices via MacroDroid, but note the caveat in the 2nd paragraph below:
  • If you have a Google Home setup, here's a post that describes controlling TP-Link/Kasa devices from Google Home, including a link to this post describing how to use Google voice commands to control linked devices. This info might be helpful.
  • If by chance you use SmartThings to control home devices, you could issue a HTTP Request from MacroDroid to SmartThings to control the Kasa plug. (I have documentation on doing that, let me know if you want that).
Of course, either way, it'll be hard to send a "Turn back on" command to the Kasa plug once the router is powered off (even if the plug is connected to a local hub). So I assume you mean you want to somehow program the Kasa plug's timers from MacroDroid. Neither of the schemes above appears to support that -- they're focused on turning things off and on, and dimming lights, etc.

There's always UI Interaction into the Kasa app, although there's all the inherent issues with that...
 

Pseudocyclic

Well-known member
Yes, I want to program the Kasa plug's timers from MacroDroid.

Using the Kasa app I can first tell the plug to turn on one minute from now, and the command is sent to the plug and the plug will 'remember' it. Then I tell the plug to turn off (which turns off the router). After the one minute delay the plug turns itself back on (which reboots the router).

Unfortunately whatever I try with Google Home the one minute delay is handled by Google Home and not delegated to the plug, hence Google Home can't turn the plug back on because it needs the router to be on.

Might it be possible to send a 'wait one minute then turn yourself on' command to the plug using SmartThings?
 

RSF

Well-known member
I doubt it. The problem will be that SmartThings commands require the router to be on, in order to get to the plug. There are actions in SmartThings to delay actions a number of seconds; but ... as with Google, the wait occurs on the SmartThings server. I believe the plug would need to be connected to receive the wake-up command, the same as with Google Home.

Unfortunately, trying to use a UI Interaction to reboot the router using its app (whatever it is) probably wouldn't work, either, since the phone screen would likely be off at 3am or whenever you wanted to reboot the router.

I haven't found an API for Kasa, though I've seen mention that there's an un-official one (though, it may only support on/off, vs. timer control).

Any chance that your router has a reboot option accessible via a web call that could be issued by MacroDroid?
 

420

Active member
Yes, I want to program the Kasa plug's timers from MacroDroid.

Using the Kasa app I can first tell the plug to turn on one minute from now, and the command is sent to the plug and the plug will 'remember' it. Then I tell the plug to turn off (which turns off the router). After the one minute delay the plug turns itself back on (which reboots the router).

Unfortunately whatever I try with Google Home the one minute delay is handled by Google Home and not delegated to the plug, hence Google Home can't turn the plug back on because it needs the router to be on.

Might it be possible to send a 'wait one minute then turn yourself on' command to the plug using SmartThings?
Can you not create shortcuts/routines/tap-to-runs or whatever they are called in the Kasa app? And then (if it still works using 1 or maybe 2 seperate shortcuts) run those Kasa shortcuts from Google home/SmartThings/alexa or something like ifttt?
 

Pseudocyclic

Well-known member
Can you not create shortcuts/routines/tap-to-runs or whatever they are called in the Kasa app? And then (if it still works using 1 or maybe 2 seperate shortcuts) run those Kasa shortcuts from Google home/SmartThings/alexa or something like ifttt?
Unfortunately, routines only provide on/off options. Delay timers set in routines are for delays between routine actions, and only the actual on/off actions are sent to the plug.
 

Pseudocyclic

Well-known member
I doubt it. The problem will be that SmartThings commands require the router to be on, in order to get to the plug. There are actions in SmartThings to delay actions a number of seconds; but ... as with Google, the wait occurs on the SmartThings server. I believe the plug would need to be connected to receive the wake-up command, the same as with Google Home.

Unfortunately, trying to use a UI Interaction to reboot the router using its app (whatever it is) probably wouldn't work, either, since the phone screen would likely be off at 3am or whenever you wanted to reboot the router.

I haven't found an API for Kasa, though I've seen mention that there's an un-official one (though, it may only support on/off, vs. timer control).

Any chance that your router has a reboot option accessible via a web call that could be issued by MacroDroid?
The router does have a reboot option accessible via a browser, but it's a 6-step process (including logging in). It would just be so convenient to be able to simply say "OK Google reboot router" instead!
 

eshroom

New member
  • If by chance you use SmartThings to control home devices, you could issue a HTTP Request from MacroDroid to SmartThings to control the Kasa plug. (I have documentation on doing that, let me know if you want that).
Please can you send me the documentation to control a SmartThings smartplug (or presumably any switch?) via a HTTP request. I have a bunch of plugs and switches that I'd love to be able to control with Macrodroid and cannot figure out how. Thank you.
 

Pseudocyclic

Well-known member
Please can you send me the documentation to control a SmartThings smartplug (or presumably any switch?) via a HTTP request. I have a bunch of plugs and switches that I'd love to be able to control with Macrodroid and cannot figure out how. Thank you.
Please share your experiences here - thanks in anticipation!
 

eshroom

New member
Please share your experiences here - thanks in anticipation!
I've used macrodroid for years, but would still say I'm a n00b. Previously it was easy to control smarthings with Sharptools, but with the closing of Groovy, Sharptools is no longer supported and so I am looking for other ways to control my devices with macrodroid. Thanks in advance for any insight!
 

eshroom

New member
My situation is quite similar. I have a meross smart socket in smartthings that I want to turn off when the phone reaches 80% charge. It isn't tuya compatible so that limits my options a bit.
 

Snurre

Well-known member
My situation is quite similar. I have a meross smart socket in smartthings that I want to turn off when the phone reaches 80% charge. It isn't tuya compatible so that limits my options a bit.
Yeah I was also using Sharptools but unfortunately it's not working anymore
But you can do it with Bixby, if you got that
 

eshroom

New member
Yeah I was also using Sharptools but unfortunately it's not working anymore
But you can do it with Bixby, if you got that
No Bixby for me. I was reading Google assistant could be used, but seems quite complicated to set up in tasker. Http request would be much better!
 
Top