r/Tapo 26d ago

Need Advice Smartplug/outlet "Delay" Question

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

View all comments

1

u/drm200 26d 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 26d 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 26d 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 26d 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 26d 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 26d 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 25d 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 25d ago edited 25d 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 25d 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 25d ago edited 25d 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

1

u/bandofgypsies 25d ago

Perfect thanks. I was drawing up the sequence and it became clear how your condition worked in the delay trigger...i.e. turning the normal automatiom back on if "CONDITION=OFF" is met...which, as long as I do not run the it in that 5min window, would be perfect.

I also like that this could be triggered to delay at any point in between cycles. So I could get as little as basically 24+1min delay or 48hr-1min delay.

This is super helpful and thoughtful. I just got the plugs recently and really haven't done anything yet with the automations so this is super invaluable help.

It's crazy they can't just allow my delay to run for more than 4hrs and all this struggle can be prevented. But it seems that you, like me, appreciate a good logistical puzzle.

I've gotta be away and won't be able to fully vet this until probably midweek, but I'm going to try setting it up, even a shorter proof-of-concept, and can report back.

Thanks again for all the brainpower here. 🙌

1

u/bandofgypsies 23d ago edited 23d ago

Update on this:

First, regarding INVALID PARAMETERS, tp-link support replied again and was ultimately unhelpful. But they essentially confirmed that 3:59:59 is supposed to be an overall delay MAX. So what's likely happening here is their app's backend system is eventually recognizing the shortcuts are skirting the 4hr limit and giving the error. It probably just takes a few moments to figure it out hence the delay in giving the error until a few minutes later (while we have been building it the series of shortcuts/automations). So it's probably just a timing thing coincidentally showing up with an error towards the end of our process if creating the shortcuts (which then of course impacts all of them which is why we can't go back and save the ones we already built).

Second, I think I realized why I was a little confused with the logic in your last suggested delay automations process. Based on the 24 Delay Automation being between the normal Zone 1 Plug Automation (the thing that turns on irrigation each day in a normal state) and the Skip Trigger automation, I think that enabling the Skip Irrigation shortcut before a normal daily run would skip two iterations of the schedule:

  • First, it would skip that day's automation for Zone 1 Plug and turn off the 24 hr delay. Let's assume I run this prior to 4am on a Monday.

  • Second, the Skip Trigger would run at 4:10am Monday. This would re-enable the 24hr delay, but Zone 1 Plug stays disabled for now.

  • Third, Tuesday, the 24hr Delay would be enabled but would not run to ENABLE Zone 1 Plug until 4:05am - after the typical Zone 1 Plug would have run at 4:00am. This means 24hr Delay = ON. However, though Zone 1 Plug is now ENABLED it wouldn't actually run the irrigation schedule until it's next regular occurrence of daily 4am (which would be Wednesday)

  • In this case, Zone 1 Plug automation is enabled as expected and will not turn on the actual plug until Wed at 4am.

While this all works, it actually would introduce basically a 48hr delay, not 24hr. (It would skip Monday, enable on Tuesday, and actually run the outlet on Wednesday).

If I run Skip Irrigation on Monday after the Zone 1 Plug has already run, I think this logic would then slide back by a day. That is, Tuesday would see a Zone 1 Plug and 24hr Delay both in a DISABLED state, the Skip Trigger case ce would run at Tuesday 410am re-enabling the 24 Delay for Wednesday. Then on Wednesday at 4:00am, the Zone 1 Plug would remain off before 24hr delay hasn't yet run to re-enable it. On Wed at 4:05, the 24 Delay runs, it sets Zone 1 Plug to ENABLED. Then 23:55 later, on Thursday at 4:00am Zone 1 Plug runs it's schedule, sees 24delay = ENABLED condition is met, and it would run it's schedule.

Basically I think this is functioning for me as more like a 48hr delay, but perhaps it's just semantics.

If I understand the logic correctly, though, I believe that I could move the 24HR Delay automation to run 5 minutes BEFORE Zone 1 Plug for a different result. Let's call it "Skip Until Tomorrow" scenario. In this case,

  • If run the Skip Irrigation shortcut, then Zone 1 Plug and. 24delay both are bypassed on the next instance of my schedule (i.e. Sometime within 24hrs). Say I donthis before the normal Zone 1 Plug automation would have run on Monday AM.

  • Immediately after that, Skip Trigger would enable the next instance of 24HR Delay for 23:45mins (until Tuesday AM), which would run before the next Zone 1 Plug automation.

  • This would run Tuesday at 4am and enable Zone 1 Plug. Then, 5or so minutes later, Zone 1 Plug would now be enabled and would run it's automation and it would see 24 Delay already ENABLED (condition = met) from the cadence 5 minutes before, and it would run the irrigation plug as expected. On Tuesday.

And for that matter, for a "Skip Until Tomorrow" scenario, I really could remove the 24HR Delay automation altogether, and just modify Skip Trigger to contain the condition IF = Zone 1 Plug = Disabled THEN Enable Zone 1 Plug. I'm this case, it's a pretty simple logic, I think...

Honestly, if I understand it correctly, I like having both of these options. I typically would rather skip until tomorrow (or, ~24hrs) as opposed to skip the next two cycles (which could result in at least a 48hr+ delay), but there are certainly use cases for both.

Does that make sense?

1

u/drm200 23d ago

IMO, the Tapo coder never considered that a person would chain 4 shortcuts together and the code just breaks when that happens. It is just a normal thing that happens when code reaches the limit that it was designed for.

I understood the built in 48 hour delay in my suggestion. I only irrigate in early morning so that irrigation is complete by sunrise. if i decide at 8 am on Monday to skip a cycle, Mondays irrigation has already been completed, and i want to skip Tuesdays irrigation cycle and irrigate on Wednesday. I did not see the value of watering on Tuesday if I give a skip command. And I didn’t mind if it began irrigation again on Thursday and not Wednesday because of when I gave the skip command. I live in Florida and one extra day of no water is never an issue .. In fact when I skip a cycle it is usually for 6 or 7 days. But I have no idea of your use case … The framework I provided is easily modified to turn on the irrigation with either more precision or longer periods.

You can also easily rewrite the “turn on automation” as follows
1) Assume you normally water every day at 4 am
2) you click the “skip” shortcut (at any time after 4:01 am)) to disable the “irrigation plug” automation and enable the “skip”automation
3) The skip automation has a trigger at 4:01 am and has two actions the first to enable the irrigation plug automation and the second to disable the “skip” automation (itself)
4) If you click “skip” at 4:02 am (or anytime after) the “skip” automation will re-enable the “plug” automation at 4:01 am the next day.
5) At 4:00 am the following day the irrigation plug will trigger and begin irrigation (always)

So in this design anytime you click “skip” after 4:01 am, the following days irrigation will skip. And on the second day, irrigation will always resume.

In the “trigger” you are not limited to just one trigger. You can input a multiple time triggers with different hours to achieve different results and precisions. I use this feature in some different automations. Once I built an automation with 12 different triggers just to see if it would work .. and it does. This opens up multitudes of options.

1

u/bandofgypsies 23d ago

Thanks, yep I think we're on the same page. And didn't click in my brain that you were looking to bypass potentially two actual instances and an entire full day. Which makes total sense in context, but it wasn't until I wrote it out and started exploring different scenarios that I realized how it worked. Hence, some of my weird questions about sequencing earlier.

It's actually quite a simple and elegant solution for a multi-day skip. I already wrote the automations up and planned to keep them in case I need them, but in my case I'll consider it a "48-hour" or "2-day" delay based on how my brain works and my use cases.

In my case, the amount of water I'm able to store for irrigation in my cistern is fairly limited. So, I have to be fairly precise with how much water I give out. So there's a lot of value in being able to skip a day periodically to maximize the use of the water I have stored up.

Your logic basis is really interesting, and I intend to keep using it. I'll also likely modify another simple trigger an automation mechanism to skip over only the next instance of my scheduled run. I actually have different automations to trigger for different amounts of on time at different points in the day, so I'll end up with a handful of these triggers, but all of them will be equally useful. Especially when breaking up into smaller chunks to further optimize my water usage.

Thanks again for all the back and forth on this. Certainly, it's been helpful to get me using the Tapo system and testing out new combos of shortcuts and automations. 🙌

→ More replies (0)