Rules for overnight

SlabSlayer, I’m pretty sure it was you that helped me develop a rule that would turn on my post lamp at sunset and then turn it off 59 minutes before sunrise the following day. Well, I’ve lost that rule and I’m looking to reconstruct it correctly as you described for me a few months back. I’ll post a screenshot in hopes that you can verify if I have it structured correctly. Thanks tlhutch4

1 Like

I’ll tag @SlabSlayer for visibility (putting the @ symbol in front of the name sends a notification to the user).

I took a look at your rule. At first I thought it was backwards but you were turning the plug off, not on :smiley:

Looks good to me based on your description.



Thanks for tip on using @ symbol in front of name. I’ll try to remember that. Also, thanks for checking my rule. I remember having a hard time getting the logic correct last time because it is an Overnight situation. Let’s see what SlabSlayer says too.


You can also search your post history because I’m sure the post is still around.


I think this was the thread

Maybe but it was Seapup that assisted


I will have to search back and look to see if that was when we were working w\ a plug schedule or a rule. I am on the road all day today and won’t get time to dedicate to that until later.

I think the problem that we had before was that, for whatever reason, when the action and inverse we’re being executed in two calendar days it wasn’t executing correctly.

But, it does look like your rule should turn off the plug and light an hour before sunrise and then turn it back on at sunset.

Make sure you don’t already have a schedule saved locally in the plug settings, or another rule, that might conflict with this.

I recently discovered a schedule in one of my plugs that I never knew was in there. Been in there for months and I just recently started seeing it execute when I started using the plug for another automation. Messed with my mind for a couple days before I connected the dots.



SlabSlayer, thanks for your reply. I look forward to your further response when you can. Also I will check local schedules as you suggested


Thanks for the suggestion to search my post history which I did attempt before posting however I was not successful.
I can remember the conversation I had with SlabSlayer about this matter and remember that he solved it for me but I wasn’t able to find it. I’ll have to improve my post searching techniques.
Looks like he may remember it and help me out again.
Thanks, tlhutch4

1 Like

I think I found your original post when you first built the rule from October of last year:

One thing I do want to mention though that you may want to consider. I know you have experienced issues with your plugs going offline…

Rules are saved on and executed from your account on the Wyze Server. If your plug goes offline, the Rule will fail and the plug will not go on\off.

Plug Schedules are saved locally on the plug and executed from the plug. If the plug goes offline, the plug will still execute the schedule so long as it still has power. Many users prefer this method for this reason. But, plug schedules will not produce a history log to look back at.

1 Like


Thanks as always. Seems like you have concurred with the rule as I have structure it above based on our prior discussion in October…Thanks

Also, thanks for enlightening me on rules vs local scheduling on the plugs. That is interesting and I like the idea of scheduling locally working even if the plugs go offline. But losing the history log requires me to think about it. Like always there are trade offs. I need to see if I am still having issues with plugs going offline like they were awhile ago.

Not sure what the schedule would look like if I were to switch away from RULES for my plugs to local scheduling. Can you enlighten me on that ?..tlhutch4

1 Like

Another drawback to using local plug schedules is that you loose the ability to schedule minutes before \ after sunrise \ sunset.

I also recall helping another user who was having the same issue you previously had with scheduling on\off within two different days. But, there has been an update to the FW scheduling, so that may have been fixed. If it was fixed, the first schedule image should work. If not, the second image splits the on\off action into two schedules.

1 Like

I need to think this through a little more, but from what you’ve explained I’m thinking maybe I might be looking at separating my plugs into 2 groups.

Most with schedules so they will continue to work if connections are dropped. I don’t like losing access to history but that’s the downside.

A few with Rules for plugs that I want to be able to schedule to turn off 59 min before sunrise. Downside here is they won’t work if connections are dropped.

I may decide that the need to turn off 59 min before sunrise isn’t worth losing the ability to continue to operate if connections are lost. But again I would really miss being able to view the history.

Any further thoughts ?

Have you considered doing both?

Here is my thinking. Redundancy is a good thing.

So on the one plug we were working with…the lamp post plug:

  • At sunset, both the RULE and the SCHEDULE turn on the the plug. First one successful wins. The second one, since it is already on, is just a redundant on command that does nothing since it is already on. (You could even modify the rule to make the on command x minutes before sunset so they aren’t triggering together.)

  • If the plug is offline, the SCHEDULE is the fallback safety to turn it on.

  • 59 minutes before sunrise, the RULE turns it off.

  • At sunrise, if the RULE failed to trigger because the plug was offline, the SCHEDULE turns the plug off. It is the fallback safety an hour after the RULE in case it didn’t execute.

  • If the plug WAS turned off by the RULE, the schedule turning it off again will do nothing at all. It is a redundant command. The plug stays off.

So… The Rule is the primary, the schedule is the backup.


I like your suggestion for using both Rule with Schedules as a fallback. I’m going to take it 1 step at a time. Today I set schedules for All my plugs and will post screenshot below;

1st screenshot is for my "standard” plugs
2nd is for my Special plugs.
Also, I have disabled Rules until I get the scheduled working. Do they look correct to you ?

1 Like

1 Like

Im not seeing any issues. You will just have to monitor their behavior to see that they are doing what they are supposed to do. If any of them don’t act right, you can always try splitting the on and off into two schedules in the same plug.

They all fired on schedule tonight using schedules for each (8 plugs and 3 switches). I’ll see if they all end on schedule tonight and tomorrow morning.

If all goes well then tomorrow I’ll add the Rules back in and make sure they are each set to fire before the associated schedules.

Tomorrow morning I’ll post screenshots of a couple rules for both plugs and switches for your consideration.

Does this plan sound ok to you ?

1 Like

Great to hear they are working. Good plan to add the Rules to fire X minutes before the schedule does so you have local backup redundancy.

I think you have the concept for the rules down quite well. You can run the rules and see how that goes. No need to post them unless one is giving you a problem.

Good :crossed_fingers: Luck!

1 Like

The other thing I like about this redundancy is that I’ll still be able to see the history of the plugs and switches firing on schedule, but will also have the redundancy of the schedules firing if the rules don’t work because of an online issue.
I’m just following your suggestions and so far it’s going well and I am learning a lot from your input. Thanks again……tlhutch4

1 Like

All of my plugs fired ON and OFF correctly last night by Schedule. Therefore I will re-enable their Rules tonight set to trigger before the Schedules. Will see how that goes tomorrow.

On the other hand my Switches turned on according to schedule, but did not go off overnight as scheduled. I checked the schedules and they looked fine. Will let them run again on schedule only tonight and see what happens tonight.

1 Like