Scheduling monthly tasks

So I have a problem scheduling items.
There are two mains nodes I have found to do 99% of my scheduling Bigtimer and schedx. Both are great. HOWEVER these are more for daily/weekly tasks. Is there any node out there that does monthly?
For example I want to run an even on the last day of the month, or the first day of the month?
Big timer is the closest it comes because you can include special days but still doesn't work 100% on 1st of the month or last day of the month.
The inject node as well does some of my scheduling but it only can do up to a week
Any suggestions on a node?

Yep - 0 0 12 L * * At 12:00 PM, on the last of the month

Yep - 0 0 12 1 * * At 12:00 PM, on the 1st day of the month`

Some more examples...

  • * * * * * * Every Second
  • 0 * * * * * Every minute
  • 0 */10 * * * * Every 10 minutes
  • 0 */20 1 * * * Every 20 minutes, between 01:00 AM and 01:59 AM
  • 0 15,30,45 * * * * At 15, 30, and 45 minutes past the hour
  • 0 0 12 * * * Every day at noon - 12pm
  • 0 0 2 29 FEB * 2020-2040 At 02:00 AM, on day 29 of the month, only in February, every 4 years, 2020 through 2040
  • 0 0 7 * * MON#1 * At 07:00 AM, on the first Monday of the month
  • 0 0 12 * JAN,FEB,MAR,APR * Every day at noon in January, February, March and April
  • * * 1W * * Every minute, on the first weekday of the month
  • * * * * Tue#3 Every minute, on the third Tuesday of the month
  • 0 12 * * MONL At 12:00 PM, on the last Monday of the month

Below is the discussion thread with screen shots etc (scroll to end of thread for latest info)...

3 Likes

Sample flow and screen shots...

[{"id":"b1d41651.702f28","type":"cronplus","z":"ac2abaf3.ee3148","name":"","outputField":"payload","timeZone":"","options":[{"topic":"SOM","payload":"","type":"str","expression":"0 0 12 1 * * "},{"topic":"EOM","payload":"","type":"str","expression":"0 0 12 L * * "}],"x":940,"y":320,"wires":[["4bc38690.77e528"]]},{"id":"4bc38690.77e528","type":"switch","z":"ac2abaf3.ee3148","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"SOM","vt":"str"},{"t":"eq","v":"EOM","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1070,"y":320,"wires":[["d1b1fd22.3e658"],["2ec10a7f.8fee76"]],"outputLabels":["Schedule Trigger","Control Reply"]},{"id":"d1b1fd22.3e658","type":"debug","z":"ac2abaf3.ee3148","name":"Start of month","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1220,"y":260,"wires":[]},{"id":"2ec10a7f.8fee76","type":"debug","z":"ac2abaf3.ee3148","name":"End of month","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1210,"y":360,"wires":[]}]

image

Thanks for this, I didn't even think about cron jobs!
Great job. I have used Cron jobs for standard linux stuff but not for node red
this will be perfect :slight_smile:

1 Like

Thanks for this great tool. I am writing every frist day of the month some data to a database. I notice however that every time I deploy node red a trigger is sent. So if I am working on another flow I get a lot of unwanted database entries every time I deploy node red.

Is there a fix for this?

It is impossible to answer that unless you tell us what mechanism you are using to trigger the write each month.

Try only deploying updated nodes and not all nodes.

This is it:
afbeelding

The cronplus node triggers the HS4 device and that data is prepared for and sent to the database.

I hope this is clear?

The cronplus node does not fire until its allotted time. I suspect that "Cumulatief mm" node is the culprit.
To prove this, add a debug node (set to send to " system console") to the output of the cronplus node AND another to the output of the "Cumulatief mm" node - then deploy again. Be sure to set the name of both debug nodes. Then check your console and debug panel.

You are right, the "Cumulatief mm" node was the culprit. It is working fine now.
Thanks for commenting.

In addition, if, as suggested by @E1cid, you click the dropdown arrow on the Deploy button, and select Modified Nodes then a Deploy will only deploy modified nodes rather than all nodes, assuming that is what you currently have.

thanks for the hint!