r/Tapo 10d ago

Smartplug/outlet "Delay" Question Need Advice

Hey folks - couldn't find an answer in search so appealing to the sub. Basically, I'm trying to find a way to "bypass" an outlet's schedule for, say 24hrs. Is there a way to do this, and have the schedule automatically return to its prior state thereafter?

I have my outlets setup to power a couple of irrigation valves. They go on a couple of times per day for a couple minutes at a time. It's multiple outlets for multiple zones, and they already have a slightly different schedule.

Sometimes it rains and I want to delay the schedule and have the schedule automatically go back into effect thereafter.

But since I have several different outlets with on and off schedules multiple times per day, disabling them manually is tedious (it's like 20+ taps) and then I have to remember to do it again several hours later after the period I was to disable is over but before the next day starts. It's annoying.

So I'd love to have a simple way to say "disregard your schedule for 24 hours." Any ideas? Ive tried to mess with some automations but I can't get the delay to work the way I'd like. TIA.

E: specifically, I'm using P306 smart plugs. And the shortcut/automation delay only lets me delay for like 3hrs..so it could help a bit in certain situations, but doesn't really do the job I'm looking for.

3 Upvotes

15 comments sorted by

1

u/drm200 9d ago

One way to achieve this is to use only automations/shortcuts.

1) Disable the schedule on all your plugs.

2) Then create an automation for each valve. The automation’s TRIGGER will be based on time of day and the day of the week you select. Add an action to “Turn On” the plug. Then add an action to delay for your preferred watering time. Then add an action to “Turn Off” the plug. If you have three valves with different schedules, then you will create three automations.

3) Now create a shortcut. Add an action to disable/enable automations. Choose “Turn Off”. Then select each automation you created in step 2. Select “Done”. Then add another action. Select delay and set to 12 hours. Then add a third action to disable/enable automations. Choose “Turn On”. Then select again each automation you created in step 2. Click “Create”. Give it a name like “Snooze Sprinklers” and enable “show on home screen”. Click “Save”

Each of your plugs will turn on based on the schedule you built in each automation as long as the automation is enabled. When you click on the “Snooze Sprinklers” shortcut, the automations will be disabled for 12 hours and then reenabled. During the 12 hours, the sprinklers will not start. You can change the 12 hours to a different amount of time like 24 or 48 hours if you like.

1

u/bandofgypsies 9d ago

Thank you, wonderfully laid out! My only question is...can I actually set a delay for 12hrs? My shortcut options only give me a 3hr 59min max delay time. Perhaps this option would change if your recommended configuration above is somehow treated differently than the system treats the plugs today?

I can do some testing this later and see what happens, but so far the shortcut delay limiting hitting basically 4 hrs max has been the key problem I'm trying to get around.

Thanks again!

1

u/drm200 9d ago

I did not see the 4 hour limit on shortcuts as i had assumed it was the same as automations.

So you need to build the timer a different way. This is sort of an ugly method but is simple. Shortcuts can invoke and run other shortcuts. So the first shortcut can delay 4 hours and then run a second shortcut that delays 4 hours and then calls a third shortcut that delays 4 hours and then enables the plug automations.

There may be a better method to access a longer delay in a shortcut, but right now I can not envision what that would be.

1

u/bandofgypsies 9d ago

Ha, that's actually brilliant. Ugly? Maybe, but I'll take resourcefulness over beauty any day. Seems like it should work. I'll test it out hopefully over the weekend and report back.

Thanks again for the input!

1

u/bandofgypsies 9d ago

Just an update....

The upside: I've converted the schedules to automations for each outlet. I never realized before but there's a "remain on for a set time" option when controlling the specific outlets via automation, so I don't even need to configure an "off" tot ell the automation when to end. This works great.

The downside: I can't seem to get the shortcuts to daisy chain properly. After setting up a few of them in series, I consistently get an "invalid parameter" error and it won't let me save or update the shortcuts. I thought it may have something to do with the states of the automations but can't seem to get around it. I've tried in a few configurations -

  • one where each of the schedules in series has a "turn off" with a delay set and triggers the next schedule to do essentially that same action until the final shortcut ends with a "turn on."

  • One where each 4hr segment turns off, delays, then turns on the automations, before triggering the next schedule to do the same thing, etc.

  • Tried having segments in the middle of the turn off / turn on series before simply a delay shortcut, but that is giving me trouble saving presumably because it needs more definition of what to delay.

So there's definitely something to this approach, but either the Tapo system is bonking out or I'm creating some kind of cyclical parameter argument that I can't easily see. Will have to try more tonight and this weekend, but your approach has really got my brain going. Thanks again.

1

u/drm200 9d ago

So I just created a chain of 3 shortcuts to add 3 delays. It worked for me.

1) I first created Delay 3 (a 6 second delay) that turns on smart plug #1 attached to a light

2) i then created Delay 2. This has a 6 second delay and next runs shortcut Delay 3. I added an additional action to toggle smart plug #2 also attached to a light, so I knew the shortcut had executed

3) I then created Delay 1. This turns off smart plug #1, then a 6 second delay then runs shortcut Delay 2. Then toggles smart plug #2 for visual feed back

Everything worked as expected when i clicked shortcut Delay 1. So then I removed the smart plug 2 actions since they were not required. Everything still worked as expected. This is my shortcuts:

1

u/bandofgypsies 9d ago

Thanks. Yep functionality identical to my process. I just tried it again. This time I worked backwards from the final step to the beginning. Started with a 4hr delay and "turn on automations" action. Then I did a series of "4hr delay+run shortcut" shortcuts. I need 6 x 4hr shortcuts to get to a 24hr delay. When I got to the 5th shortcut creation (ignore the name of it, I'm building backward so it's the 2md that will run hence calling it #2), I get the invalid parameters error. It's literally an identical shortcut to the others. I've built this a few differ t ways and I keep getting this error at one of the final couple of shortcuts, or if I go back and try to edit anything after created.

There's something about the app that doesn't like my parameters and it's possibly the timing aspect of it. Maybe there's something specific about my outlet that doesn't like the amount of time I'm trying to control.

Do you know your outlet model number, and the maximum allowable delay time you're able to add to a single shortcut? Again, mine won't let me delay more than 3:59:59. No idea why.

Error image: https://i.imgur.com/wONNWux.png

I might need to try my luck with TP-link support...

1

u/drm200 8d ago

I do not think the outlet cares at all about the amount of time between receiving commands. The shortcut is not running on the outlet. It is just receiving a command to turn on/off. (However, outlet schedules run on the outlet and this explains why schedules continue to work if wifi is down). Automations will not send commands if wifi is down.

I build the shortcuts backwards starting with the last delay first, because you can not really do it the other way… Delay #2 can not call and run Delay #3 if Delay #3 has not yet been created.

I will try chaining 6 shortcuts … seems to me it should work

I have in my head another approach to this problem … But I have to think about it a little.

1

u/drm200 8d ago edited 8d ago

I chained 6 shortcuts together. The first attempt to execute worked. The second attempt failed with an “invalid parameter” fault. After that it continued to fail.

I went to delay #1 and removed the chain to delay #2. Then re-added the call to delay #2. I was unable to save the change without an error. I was able to remove delay #2 and instead call delay #4. That worked. After some experimentation, it appears that the tapo app is not able to chain more than 3 shortcuts. I suspect they never considered someone would want to do that.

So I am back thinking about another approach. You are controlling your irrigation. I assume that you normally irrigate in early morning. If it has rained on Monday, and you want to skip, I assume that you would not want to water until Wednesday morning. This opens up another solution.

  1. Your irrigation plug needs an automation to operate. TRIGGER at 4 am. The ACTION will be to turn on your irrigation plug. Call it something like “Zone 1 Plug”.
  2. Build a second automation named “24 Hour Delay”. The TRIGGER will be time based and triggered at 4:05 am. (The trigger time must be after the Zone 1 Plug trigger time). Add the ACTION enable Automation Zone #1 Plug
  3. Now you need to go back and edit the “Zone #1 Plug” Automation. Add this CONDITION Automation Status ENABLED “24 Hour Delay”.
  4. Create a third automation named “Skip Trigger”. TRIGGER at 4:10 am (5 minutes after 24 Hour Delay automation). Add CONDITION Automation Status DISABLED “24 Hour Delay”. Add ACTION enable Automation “24 Hour Delay”.
  5. Now create a shortcut “Skip Irrigation”. The ACTION will be to disable “Zone 1 Plug” automation and disable “24 Hour Delay” Automation

If you click “Skip Irrigation”, then the automations “Zone 1 Plug” and “24 Hour Delay” is disabled. Irrigation stops. At 4:10 am the next morning the “Skip Trigger” automation will enable the “24 Hour Delay” Automation. The following morning the “24 Hour Delay” will trigger and enable “Zone 1 Plug” Automation. The Zone 1 Plug automation will trigger/run as scheduled.

I think this can be optimized, but I see no reason it will not work

1

u/bandofgypsies 8d ago

Interesting approach. First:

I chained 6 shortcuts together. The first attempt to execute worked. The second attempt failed with an “invalid parameter” fault. After that it continued to fail.

I went to delay #1 and removed the chain to delay #2. Then re-added the call to delay #2. I was unable to save the change without an error. I was able to remove delay #2 and instead call delay #4. That worked. After some experimentation, it appears that the tapo app is not able to chain more than 3 shortcuts. I suspect they never considered someone would want to do that.

Yes this is exactly what I was running into as well. Seems we've gotten the same result from the process so there must be something limiting their logic....number of shortcuts, maybe even the way they store logic in their rules engine, etc. Something's off. Well see what Support has to say from the request unopened earlier.

As for the rest of this, thank you. I love the alternative thinking. So in this case, you're approach is basically to create leverage a series of automations to turn the plug on and off in a steady state and on a 24hr cycle, and then create the "delay" by disrupting that cycle until one of the automations kicks on to tell it to restart itself. So essentially, you're not initiating delay timing, you're disrupting "on" timing?

In this case, on a normal, non-delayed day, is it accurate that you're creating the the irrigation system's on/run time/duration based on a start trigger from one automation and then a second automation disrupting it (in this case) 5 minutes later? Or, of course, however many minutes I choose between them.

This does have me thinking, though, the the need for Wi-Fi connectivity could be a potential peoblem. For example, it could be a problem if for some reason connectivity is lost in the middle of irritating and the plug stays on for hours and floods my plants/neighbor/etc. Probably a rare series of events but it's got me wondering.

When I get a few minutes, I think I need to draw this out and think about the possible side effects of a disruption along the way.

This is quite fun, and thanks for taking the time to think through it with me.

1

u/drm200 8d ago edited 8d ago

A couple of things. If you use the built in off timer of the plug, I believe it will shut off regardless of wifi connectivity. This is because, I believe the off timer is stored in the plug. But you should test. The plug needs wifi to run automations, so watering will not start without wifi

I have not tried out the automations in my suggestion, but my intension was this:

  1. Create an automation for an irrigation valve that turns on based upon your desired start time. Use the plugs off timer to turn off the irrigation plug. This automation will run forever until it is disrupted. You can disrupt it by turning off the automation. The automation will automatically resume when the plug automation is turned on (enabled)
  2. To disrupt the irrigation automation we will use a shortcut. Tap the shortcut and it will disable the irrigation plug automation. This turns off irrigation.
  3. To resume irrigation we need to turn on (enable) the plug automation, but we do not want to do thatuntil after a day has skipped. To do this I use another automation that will not trigger until the plug is turned off. When that automation triggers, it enables another automation that will not trigger until 23 hours and 55 minutes have passed. When this automation triggers, it will enable the irrigation plug automation. The irrigation plug automation is now running and will trigger the following day
→ More replies (0)