This is all I could come up with to water my lawn every 2nd day.
Seems to ignore PST and is only UTC as the answer is 6 even thought it’s the 5th ATM.
Anything more elegant?
This is all I could come up with to water my lawn every 2nd day.
Seems to ignore PST and is only UTC as the answer is 6 even thought it’s the 5th ATM.
Anything more elegant?
Is there a reason you are not just using a timer for every two days?
Turn out my piston doesn’t work anyway due to 31 and 1 end of month. ![]()
The Julian date ends up out of sync so I need to use a format that is just the last integer of today’s date.
I don’t know why I missed the var $day, integer(right(string($day),1))
We can only water on even days not every second day.
You can use Basic Rules and have the restrictions to run even days only.
I don't understand that requirement... why only even days? That is going to cause you to miss a watering day after every month with 31 days... but that is what you want to happen?
So, I'm still confused why you are not just using an every 2-days timer for this.
It’s a city bylaw. We have the same every year with stage 2, only even days for even house number. Stage 3 where no lawn or automatic sprinkler watering at all which we are in now.
That still wouldn't water only on even day numbers like they need.
You would need to do something like “formatDateTime($now, 'd') % 2 == 0” to determine if a day is even or not.
Or maybe even something easier like just “$day % 2 == 0” …. I didn't test it.
Yep, read right past that requirement.
I couldn’t find a way to restrict to even days using Basic Rules as it seems to only allow restrictions to particular days of the week, however is should be possible to do this by installing Date & Time Parser and creating a Rule Machine automation with a trigger with a condition based on Date_Time IsDayOfMonNumEven=True. I have found that using the various variables available via Date & Time Parser much simpler than using a piston.
Ah, that explains it.
This is the easiest way to find if the day is even.
You can add month restrictions to the every day schedule:
That’s why I thought what I was doing is inefficient.
I was twisting my brain and couldn't remember the Mod operator.
Thanks!