Easy things should be easy, and hard things should be possible

The title is a quote from Larry Wall, the creator of the language perl. It's a very good quote to live by in general when designing software (and other systems), and I would claim it's applicable to Rule Machine for the following reason.

I wanted to set up a rule that triggers once a week. In the context of the quote this is one of the "hard things". You've made the easy things easy with Rule Machine, how about making some of the hard things possible?

Granted, I have a HUGE amount of experience scheduling tasks with Unix and Linux cron, for example a weekly log cleanup on a system was something I did fairly regularly. "0 6 * * 0" will get you there.

I'd see two possible ways to do this.

  1. The "Hubitat" way would be to add a couple more input fields: one for an optional day of week, and while you're at it, add another for a single day of month to allow a task to run once a month.

  2. The "Nerd" way would be to just let us put in a cron string and be done with it. That's a little bit on the dangerous side admittedly, because while they are powerful, they are also incredibly easy to get wrong.

I can solve my problem very simply by just putting together a quick user app. But that's like taking a 12 gauge shotgun to kill a mosquito - it gets the job done but I shouldn't need to do it this way.

1 Like

Have you looked at node red? Also you can run rules only once a week...

You can also do once a month with variable dates

With a "Periodic schedule," trigger, you get something like this, depending on what options you choose:

Rule 5.1 screenshot with weekly periodic trigger options

You can also choose "Cron String":

Rule 5.1 screenshot with 'Cron string' periodic schedule trigger

Seems like both of these are already possible? :slight_smile:


That works, although I'll leave it with the observation that had I been in charge of design, I would have arrived at the same place, just by a very different path.

How about webcore

See above the stuff posted by @bertabcd1234 That seems to do everything you need

That's all I needed to hear. :+1:

I'd been looking under "Run at certain times" which is why I probably didn't find this.

I just note that you're not using Unix / Linux style cron, which is just 5 fields: minutes, hours, day of month, month, day of week. Yours is a little more detailed, since it includes seconds and years. Unix syle for what I want would be 0 6 * * 0. Not a major problem, just something to be aware of.

We have to follow the rules for Hubitat's scheduler, which is Quartz. When you get to this place in the Rule Machine UI, you can click that "Cron expression generator" link (which you can see in my screenshot) if you aren't sure about your particular string. I didn't make the rules; just happen to know this one. :smiley:

Otherwise, glad it helped!