I had a rule and I thought it had been working but I noticed recently it was not.
Basically I want an event to happen 1 hour after sunset or 9:00PM whichever is first. So I used the wait for event in the screenshot below. The wait for event does not work, when it hits this action it just continues on and does not wait. The rule this line was in triggered at sunset which was at 8:10PM EST tonight. At this point in the rule I expected it to stop and wait until either sunset + 1 hour(9:10PM) or 9:00PM. The rule continued as if this line did not exist.
I just changed it to the wait for expression as shown above and I assume this will do what I want, I will see tomorrow.
Is there a reason the wait for event line does not work? Has something changed, or has this never worked and I just never realized.
Below is a snippet of the log from that rule. At 8:10 is sets two schedules one for 9:10 and one for 9:00. Then less than a minute later it times out and goes to the next action which is a 1 minute delay.
I think your wait for expression is wrong as it says sunrise+60 instead of sunset+60 like the event.
With that said, I have an automation that uses two different wait for events/certain times that works fine. What is your trigger? Maybe there is a way of crafting this rule a little bit different.
You are right, I just did that in a sample rule to use for posting. The actual rule is correct.
Here is the trigger and most of the relevant part of the rule. The rule can be triggered by sunset or a close all switch. When triggered it starts closing all the shades. If the trigger was sunset then it waits until an hour after sunset or 9:00 PM to close the living room and dining room shade. The dining room close IF statement is after the living room. The current rule has the wait for expression but its had the wait for event for quite some time and was working so I don't know why it doesn't work now. I have updated this rule, because I have replaced all the motors in my shades to Matter.
I didn't think I changed anything functionally about it though. The original rule had all virtual shades as I was using a bond hub to control them. I could only set them to open, closed or 50% and there was no feedback from the shade. I had a separate rule that sent the actual command to the bond hub when the virtual shade changed.
So I did modify the rule but only the shade control and this rule has been working for quite some time.
I'm not seeing anything that should cause problems including updating the shades. I assume the shades are working fine via their device page. I can think of a couple of things that you might want to try:
1.) Bring the wait for event out of the conditional IF for the living room. Basically, let the wait for event be its own action before proceeding to close the dining room.
2.) You could also just create the dining room as its own separate rule. That would give you more flexibility and just have the triggers be the two times rather than worrying about a wait for event.
Without digging into your logic, I'll note that I always try to "trigger" the rule based on the time event rather than having it wait for the event to happen when it's something that could produce a "long" wait.
Others can chime in on the details--but, to me, it seems like things are open for a lot of troublesome external factors if you're counting on the rule waiting a "long" time for a once/day event.
Hub reboots, the rule getting invoked again before it finishes, etc.
Both versions of the wait worked as expected last night. The test rule sent me a pushover message at 9:00 that the wait was over and the shade rule continued and closed the last two shades at 9:00PM..
So I guess something in the rule got corrupted after my last modification. I am going to put it back to the wait for events tonight and see if it works.