Nested IF help

Trying to make this nested IF rule work. For some reason though even if the "Late Night" switch is on it is turning off the lights at 1:00 a.m. and not waiting until 3:00 a.m. as intended. Am I missing something in this rule structure? (There is a longer rule before this but this is where the IFs start)

I think posting the entire rule build would be best to get the full picture (no pun intended), and a screenshot from a non-phone device would additionally be great - trying to parse anything from a phone screenshot makes it harder to follow.

Is this better?

image

This is what it should be doing, At 12 AM midnight:

  1. should run only if Yom Tov is off
  2. Yom Tov would need to be ON (due to else-if) and Also Y'T Late Night would need to be off. Then wait for 12:59AM and run actions.
  3. Fall back, if Yom Tov is ON and Y'T Late Night is also ON, wait for 3AM and run actions.

Is that your intention?

In your example you said Y'T Late Night was on, but was Yom Tov also ON at midnight?

Also if you turn on all the logging for the rule, you will be able to see exactly what it is doing in the hub logs.

3 Likes

That is the intention, correct. I do believe everything was on but the log only showed the last 24 hours by the time I looked at it, is there any way to store it longer?

I will try it again this weekend and turn logging on.

It is limited by file size, only way to allow going back further is to turn down the logging on other things that it is not needed for.

Ok.

I think found the problem though. Late night switch is toggled by a Google calendar entry from a public calendar. It was looking at the event description instead of the event title for the keyword. Glad I sorted that out and that my IFs are working as intended.

Is there a way to simulate time and date in a test mode? Would love to see how things would behave before saving and hoping for best.

Pretty sure you can go into the rule and click the Run Actions button to test.

Disable the "Wait for 12AM" line.
Then you should be able to use the run actions, it will run through up the IF section in question. In the logs you will be able to see which one is triggered and it will stop at your delay within each IF block.

Then you can enable the wait again and Update Rule which will reset the whole thing back to normal and cancel the delayed actions.

1 Like

Thanks. I was also thinking more broadly as I have a bunch of different rules that I would like to test at the same time. Simulating a specific day and time. Was hoping to be able to change the date and time of the unit in order to test.

I dont think you can manually set the date/time on the hub.

You might be able to make something with a global date/time variable so it uses that instead of hub time but I am not familiar with those or how it might actually work.

Also, I saw Shabbos in your rule, and remembered seeing this app a while ago. Might be of interest if not already using it: [RELEASE] Sabbath/Holiday Mode Scheduler

Thanks! Will look, I think I finally got everything down pat but always love looking at other ways of doing things.