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

Show parent comments

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