Schedule help - run every other week?

Is it possible to run something on every other Tuesday (i.e. change the mode to something like "bi-weekly guests").

I know I could do this with a cron entry on Linux to call a Maker API endpoint (what I used to do), but I'd like to do this natively on HE.

00 6 * * Tue expr `date +\%s` / 604800 \% 2 >/dev/null && curl -s "http://endpoint/on"
00 15 * * Tue expr `date +\%s` / 604800 \% 2 >/dev/null && curl -s "http://endpoint/off"

The closest thing I've found is on every tuesday, but I might be looking in the wrong place.

Thanks!
Brian

1 Like

Two thoughts.

First, you can use a daily trigger and run it every 14 days. You'd have to time the start of this rule to the Tuesday you wanted it to happen on.

Second, you could continue with your "every Tuesday" in RM, but use a triggered rule with a virtual switch. Trigger is every Tuesday, rule is virtual switch on. Then, in your actions, have it do the mode change or whatever you want in the True actions, but also toggle the virtual switch in both True and False actions. This way the virtual switch toggles every run, but it's only On every other week, so the True actions only run every other time.

2 Likes

Clever idea on the virtual switch. I saw some RM examples at some point where someone wanted to do last Friday, was hoping it was something simple that I hadn’t yet found in RM.

1 Like

You can set up first/second/third/fourth/last specific day of the month. I poked around a bit under Period triggers and didn't see anything about every other week though.

You could use 2 rules.
One on the first Tuesday and one on the third Tuesday of every month.
The only issue is if there are 5 Tuesdays in a month. It would miss it.
Just a suggestion though.

1 Like

I need to send a notification on Sunday every other week. I created the following

Will this work if I un-pause it sometime before 5 on Sunday?
Will it remember to keep sending every two week even through firmware upgrades, power outages and reboots of my HE?

No, this will not work for every other week. This will send for the first and third week of each month.

You need to use a schedule for every week, and then flip the state of a Boolean variable each time it runs. Then you only do the notify when the variable is true. Like this:

This schedule will survive reboots, etc.

5 Likes

This has been working well for a few months but today I got the notification even though I should not have. Recycle week is currently set to TRUE