MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-ModuleScheduler: How to schedule for every other week

    Scheduled Pinned Locked Moved Solved Requests
    cronschedulenotifications
    2 Posts 2 Posters 183 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      elentophanes
      last edited by

      Re: MMM-ModuleSceduler- How to schedule for every other week

      I’ve been using the very handy scheduling module https://github.com/ianperrin/MMM-ModuleScheduler/ successfully to trigger other modules such as displaying fireworks https://github.com/ChrisF1976/MMM-Fireworks/ on anniversaries by sending notifications to the modules. I’d love to set some more complex schedules like bi-weekly, or odd/even weeks. In theory this can be achieved in the linux crontab by sending an expression such as [ $(expr $(date +%W) % 2) -eq 1 ] that is evaluated before the command is sent.

      I’ve tried a few different ways to send this but it looks like the node.js cron does not support this. Wondering if anyone has managed to configure such a setup.

      { notification: 'FireFireFire', schedule: '00 18 * * SUN [ $(expr $(date +%W) % 2) -eq 1 ]', payload: {text: "Its been 2 weeks"}}, // start fireworks 2 weeks on Sunday at 1800
      { notification: 'StopFire', schedule: '30 19 * * SUN [ $(expr $(date +%W) % 2) -eq 1 ]', payload: {text: "StopFire"}},   // stop fireworks at 1930
      

      Thanks in advance.

      S 1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil @elentophanes
        last edited by sdetweil

        @elentophanes you cant do biweekly ONLY in cron

        the launched pgm needs to handle the every other

        i did a search
        cron biweekly
        and there were examples by testing the week number for even/odd and other things (write a file test sbd erase if exists…)

        the module scheduler module doesn’t support commands as part of the cron definition.

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • E elentophanes has marked this topic as solved on
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy