{"id":33251356,"url":"https://github.com/ianperrin/MMM-ModuleScheduler","last_synced_at":"2025-11-21T17:02:05.075Z","repository":{"id":11072632,"uuid":"68243878","full_name":"ianperrin/MMM-ModuleScheduler","owner":"ianperrin","description":"A MagicMirror helper module to schedule the display of modules and sending of notifications.","archived":false,"fork":false,"pushed_at":"2025-04-28T04:50:43.000Z","size":1026,"stargazers_count":109,"open_issues_count":5,"forks_count":14,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-28T05:30:31.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianperrin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"ianperrin","custom":["https://paypal.me/ianperrin01"]}},"created_at":"2016-09-14T21:13:20.000Z","updated_at":"2025-04-28T04:50:47.000Z","dependencies_parsed_at":"2024-03-09T00:35:22.478Z","dependency_job_id":"52cd0fb9-3972-4bef-925e-7331da432b9c","html_url":"https://github.com/ianperrin/MMM-ModuleScheduler","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ianperrin/MMM-ModuleScheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianperrin%2FMMM-ModuleScheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianperrin%2FMMM-ModuleScheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianperrin%2FMMM-ModuleScheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianperrin%2FMMM-ModuleScheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianperrin","download_url":"https://codeload.github.com/ianperrin/MMM-ModuleScheduler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianperrin%2FMMM-ModuleScheduler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285655011,"owners_count":27209077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-17T00:00:30.828Z","updated_at":"2025-11-21T17:02:05.064Z","avatar_url":"https://github.com/ianperrin.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ianperrin","https://paypal.me/ianperrin01"],"categories":["Mirror Utilities"],"sub_categories":[],"readme":"# MMM-ModuleScheduler\n\nA [MagicMirror²](https://magicmirror.builders) helper module to schedule when modules should be shown, hidden or dimmed and when notifications should be sent.\n\n[![Platform](https://img.shields.io/badge/platform-MagicMirror-informational)](https://MagicMirror.builders)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://raw.githubusercontent.com/ianperrin/MMM-ModuleScheduler/master/LICENSE)\n![Test Status](https://github.com/ianperrin/MMM-ModuleScheduler/actions/workflows/node.js.yml/badge.svg)\n[![Known Vulnerabilities](https://snyk.io/test/github/ianperrin/MMM-ModuleScheduler/badge.svg)](https://snyk.io/test/github/ianperrin/MMM-ModuleScheduler)\n\n![Example Scheduling](.github/example.gif)\n\n## Installation\n\nIn your terminal, go to your MagicMirror's Module folder, clone this repository, go to the modules folder, install the dependencies:\n\n```\ncd ~/MagicMirror/modules\ngit clone https://github.com/ianperrin/MMM-ModuleScheduler.git\ncd MMM-ModuleScheduler\nnpm install --omit=dev\n```\n\nAdd the module to the modules array in the `config/config.js` file:\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler'\n    },\n```\n\n## Config Options\n\n| **Option**              | **Default** | **Description**                                                                                                                                                  |\n| ----------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `schedulerClass`        | 'scheduler' | **Optional** The name of the class which should be used to identify the modules which have an individual schedule.                                               |\n| `animationSpeed`        | 1000        | **Optional** The speed of the show and hide animations in milliseconds                                                                                           |\n| `notification_schedule` |             | **Optional** A single, or array of multiple definitions to schedule when notifications should be sent. See [Scheduling Notifications](#scheduling-notifications) |\n| `global_schedule`       |             | **Optional** A single, or array of multiple definitions to schedule when all modules should be shown/hidden/dimmed. See [Global Schedules](#global-schedules)    |\n| `uselock`               | `true`      | **Optional** If set to `false`, scheduler don't lock the hidden modules. Other modules can then be used to show the modules if they are hidden by the scheduler. |\n| `debug`                 | `true`      | **Optional** Outputs messages to the console/log when set to `true`                                                                                              |\n\n## Config Examples\n\nSending notifications\n\n- [Basic example](#scheduling-notifications)\n- [Multiple notifications](#scheduling-multiple-notifications)\n- [Remote control notifications](#scheduling-actions-to-control-your-magicmirror-pi-and-monitorscreen)\n\nModule Display\n\n- [Hide or show all modules](#global-schedules)\n- [Hide or show a group of modules](#group-schedules)\n- [Hide or show individual modules](#individual-module-schedules)\n- [Dimming modules](#dimming-modules)\n- [Multiple schedules](#multiple-schedules)\n- [Ignoring Modules](#ignoring-modules)\n\n### Scheduling Notifications\n\nTo schedule the sending of a notification to other modules, add a `notification_schedule` definition to the MMM-ModuleScheduler config, e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            // SHOW AN ALERT AT 09:30 EVERY DAY (see https://github.com/MichMich/MagicMirror/tree/develop/modules/default/alert)\n            notification_schedule: {\n                notification: 'SHOW_ALERT',\n                schedule: '30 9 * * *',\n                payload: {\n                    type: \"notification\",\n                    title: 'Scheduled alert!'\n                }\n            }\n        }\n    },\n```\n\n**Notes**\n\n- `notification` is required and should be the identifier of the notification to be sent to all other modules.\n- `schedule` is required and determines when the notification will be sent. It should be a valid cron expression - see [crontab.guru](http://crontab.guru/).\n- `payload` is optional and its contents will be determined by the module receiving the notification.\n\n* When specifying your schedule values make sure that your values fall within the ranges below.\n\n| **Unit**       | **Format**     |\n| -------------- | -------------- |\n| `Seconds`      | 0-59           |\n| `Minutes`      | 0-59           |\n| `Hours`        | 0-23           |\n| `Day of Month` | 1-31           |\n| `Months`       | 0-11 (Jan-Dec) |\n| `Day of Week`  | 0-6 (Sun-Sat)  |\n\n#### Scheduling Multiple Notifications\n\nMultiple `notification_schedule` definitions can be added using an array, e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            notification_schedule: [\n                // SHOW AN ALERT AT 07:30 EVERY DAY\n                {notification: 'SHOW_ALERT', schedule: '30 7 * * *', payload: {type: \"notification\", title: 'Good morning!'}},\n                // SHOW AN ALERT AT 17:45 EVERY DAY\n                {notification: 'SHOW_ALERT', schedule: '17 45 * * *', payload: {type: \"notification\", title: 'Good afternoon!'}}\n            ]\n        }\n    }\n```\n\n#### Scheduling actions to control your MagicMirror, Pi and monitor/screen\n\nUsed in conjunction with [MMM-Remote-Control](https://github.com/Jopyth/MMM-Remote-Control) module, the `notification_schedule` definitions can create schedules to control your MagicMirror, Pi and monitor/screen, e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            notification_schedule: [\n                // TURN THE MONITOR/SCREEN ON AT 07:30 EVERY DAY\n                {notification: 'REMOTE_ACTION', schedule: '30 7 * * *', payload: {action: \"MONITORON\"}},\n                // TURN THE MONITOR/SCREEN OFF AT 22:30 EVERY DAY\n                {notification: 'REMOTE_ACTION', schedule: '30 22 * * *', payload: {action: \"MONITOROFF\"}},\n                // RESTART THE MAGICMIRROR PROCESS AT 2am EVERY SUNDAY\n                {notification: 'REMOTE_ACTION', schedule: '0 2 * * SUN', payload: {action: \"RESTART\"}}\n            ]\n        }\n    },\n```\n\n**Notes**\n\n- A full list of remote actions available for controlling your MagicMirror, Pi and monitor/screen are available in the [MMM-Remote-Control module documentation](https://github.com/Jopyth/MMM-Remote-Control#list-of-actions)\n- If you simply want to hide and show modules, it is recommended to use the module display scheduling options defined below, rather than the `SHOW` and `HIDE` remote actions.\n\n### Scheduling Module Display\n\n#### Global Schedules\n\nTo schedule when all modules are shown (or hidden) by the Magic Mirror, add a `global_schedule` definition to the MMM-ModuleScheduler config, e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            // SHOW ALL MODULES AT 06:00 AND HIDE AT 22:00 EVERY DAY\n            global_schedule: {from: '0 6 * * *', to: '0 22 * * *' },\n        }\n    },\n```\n\n#### Group Schedules\n\nTo apply a schedule to a group of modules, add the `groupClass` option to the `global_schedule` definition, e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            // SHOW MODULES WITH THE CLASS 'daytime_scheduler' AT 06:00 AND HIDE AT 22:00 EVERY DAY\n            global_schedule: {from: '0 6 * * *', to: '0 22 * * *', groupClass: 'daytime_scheduler'},\n        }\n    },\n    {\n        module: 'clock',\n        position: 'top_left',\n        classes: 'daytime_scheduler'\n    }\n    {\n        module: 'compliments',\n        position: 'lower_third',\n        classes: 'daytime_scheduler'\n    },\n\n```\n\n**Notes**\n\n- Modules scheduled as a group, only need the `groupClass` adding to the `classes` option in their config. The `schedulerClass` option can be omitted unless indiviudal schedules also exist.\n\n#### Individual Module Schedules\n\nTo schedule when an individual module is shown (or hidden) by the Magic Mirror, modify the configuration for that module so that it includes the `classes` and `module_schedule` options. e.g.\n\n```javascript\n    {\n        module: 'calendar',\n        header: 'US Holidays',\n        position: 'top_left',\n        classes: 'scheduler',\n        config: {\n            // DISPLAY THE CALENDAR BETWEEN 09:00 and 18:00 ON WEDNESDAYS\n            module_schedule: {from: '0 9 * * 3', to: '0 18 * * 3' },\n            calendars: [\n                {\n                    symbol: 'calendar-check-o ',\n                    url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics'\n                }\n            ]\n        }\n    },\n```\n\n**Notes**\n\n- `from` is required and determines when the module will be shown. It should be a valid cron expression - see [crontab.guru](http://crontab.guru/).\n- `to` is required and determines when the module will be hidden. It should be a valid cron expression - see [crontab.guru](http://crontab.guru/).\n\n#### Dimming Modules\n\nTo dim modules, rather than hide them, add the `dimLevel` option (as a percentage between 0 and 100) to the `global_schedule` and `module_schedule` definitions. e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            // SHOW ALL MODULES AT 06:00 AND DIM THEM TO 40% AT 22:00\n            global_schedule: {from: '0 6 * * *', to: '0 22 * * *', dimLevel: '40' },\n        }\n    },\n    {\n        module: 'clock',\n        position: 'top_left',\n        classes: 'scheduler',\n        config: {\n            // SHOW THE CLOCK AT 06:30 AND DIM IT TO 25% AT 22:30\n            module_schedule: {from: '30 6 * * *', to: '30 22 * * *', dimLevel: '25'}\n        }\n    },\n```\n\n**Note:**\n\n- The modules will be shown (full brightness) based on the `from` expression\n- The modules will then either be dimmed (if the `dimLevel` option is set) based on the `to` expression.\n- Take care when adding both `global_schedule` and `module_schedule` definitions as MMM-ModuleScheduler performs no validation that they will be compatible.\n\n#### Multiple Schedules\n\nFor more complex scheduling, multiple `global_schedule` and `module_schedule` definitions can be added using an array, e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            global_schedule: [\n                // SHOW MODULES WITH THE CLASS 'morning_scheduler' AT 06:00 AND HIDE AT 09:00 EVERY DAY\n                {from: '0 6 * * *', to: '0 9 * * *', groupClass: 'morning_scheduler'},\n                // SHOW MODULES WITH THE CLASS 'evening_scheduler' AT 17:00 AND HIDE AT 23:00 EVERY DAY\n                {from: '0 17 * * *', to: '0 22 * * *', groupClass: 'evening_scheduler'},\n            ]\n        }\n    },\n    {\n        module: 'clock',\n        position: 'top_left',\n        classes: 'scheduler',\n        config: {\n            // DISPLAY BETWEEN 09:30 ON SATURDAYS AND 22:30 ON SUNDAYS,\n            // THEN AGAIN BETWEEN 20:00 AND 23:00 ON TUESDAYS AND WEDNESDAYS\n            module_schedule: [\n                {from: '30 9 * * SAT', to: '30 22 * * SUN'},\n                {from: '0 20 * * 2-3', to: '0 23 * * 2-3'}\n            ]\n        }\n    },\n```\n\n**Note:**\n\n- Take care when adding both `global_schedule` and `module_schedule` definitions as MMM-ModuleScheduler performs no validation that they will be compatible.\n\n#### Ignoring Modules\n\nTo ignore modules from being shown, hidden or dimmed by a global schedules, add the `ignoreModules` option to the `global_schedule` definition e.g.\n\n```javascript\n    {\n        module: 'MMM-ModuleScheduler',\n        config: {\n            // SHOW ALL MODULES EXCEPT clock AND calender BETWEEN 06:00 AND 22:00\n            global_schedule: {from: '0 6 * * *', to: '0 22 * * *', ignoreModules: ['clock', 'calendar'] },\n        }\n    },\n```\n\n**Note:**\n\n- Modules are ignored based on their name, as defined in the config file. If multiple instances of a single module are defined in the `config.js` file, all instances will be ignored using this option.\n\n## Updating\n\nTo update the module to the latest version, use your terminal to go to your MMM-ModuleScheduler module folder and type the following command:\n\n```\ngit pull\n```\n\nIf you haven't changed the modules, this should work without any problems.\nType `git status` to see your changes, if there are any, you can reset them with `git reset --hard`. After that, git pull should be possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianperrin%2FMMM-ModuleScheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianperrin%2FMMM-ModuleScheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianperrin%2FMMM-ModuleScheduler/lists"}