MagicMirror² v2.11.0 is available! For more information about this release, check out this topic.
READ THE CHANGELOG BEFORE UPDATING!

MMM-ModuleScheduler - Module Schedules and Notifications



  • Hello all,

    @ianperrin Thanks for the great module!

    I’ve been using MMM-ModuleScheduler successfully for a couple of weeks, however, after a recent update the module is no longer working as designed. It appears that the correct SHOW & HIDE commands are being send (see logs below), however, the modules do not appear or disappear from the MM itself.

    The only command that works well is the HDMI on/off. Any guidance or insight is appreciated.

    Thanks!

      | MMM-ModuleScheduler will next send SEND_NOTIFICATION to REMOTE_ACTION at Thu Apr 20 2017 23:30:00 GMT-0400 (EDT) based on "30 23 * * *"
    0|mm       | Powering off HDMI
    0|mm       | MMM-ModuleScheduler is sending HIDE_MODULE to module_11_MMM-ImagesPhotos
    0|mm       | MMM-ModuleScheduler will next send HIDE_MODULE to module_11_MMM-ImagesPhotos at Thu Apr 20 2017 23:45:00 GMT-0400 (EDT) based on "45 23 * * *"
    0|mm       | MMM-ModuleScheduler is sending SEND_NOTIFICATION to REMOTE_ACTION
    0|mm       | MMM-ModuleScheduler will next send SEND_NOTIFICATION to REMOTE_ACTION at Fri Apr 21 2017 06:00:00 GMT-0400 (EDT) based on "0 6 * * *"
    0|mm       | MMM-ModuleScheduler is sending SHOW_MODULE to module_4_localtransport
    0|mm       | MMM-ModuleScheduler will next send SHOW_MODULE to module_4_localtransport at Fri Apr 21 2017 06:00:00 GMT-0400 (EDT) based on "0 6 * * *"
    0|mm       | MMM-ModuleScheduler is sending SHOW_MODULE to module_6_iFrame
    0|mm       | MMM-ModuleScheduler will next send SHOW_MODULE to module_6_iFrame at Fri Apr 21 2017 06:00:00 GMT-0400 (EDT) based on "0 6 * * *"
    0|mm       | Powering on HDMI with preferred settings
    
    


  • Hi All and thanks to @ianperrin for creating this awesome module.

    I’m trying to schedule my screen to turn it on and off in specific times from Monday to Friday, and doing also the same thing in different times on weekend.

    Right now this is my configuration, but is not quite working:

    {
    module: ‘MMM-ModuleScheduler’,
    config: {
    notification_schedule: [
    // TURN THE MONITOR/SCREEN ON AT 08:00 EVERY DAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘0 8 * * * 1-5’, payload: {action: “MONITORON”}},
    // TURN THE MONITOR/SCREEN OFF AT 09:30 EVERY DAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘30 9 * * * 1-5’, payload: {action: “MONITOROFF”}},
    // TURN THE MONITOR/SCREEN ON AT 19:00 EVERY DAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘0 19 * * * 1-5’, payload: {action: “MONITORON”}},
    // TURN THE MONITOR/SCREEN OFF AT 23:00 EVERY DAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘0 23 * * * 1-5’, payload: {action: “MONITOROFF”}},
    // TURN THE MONITOR/SCREEN ON AT 10:30 WEEKEND
    {notification: ‘REMOTE_ACTION’, schedule: ‘30 10 * * * 6-7’, payload: {action: “MONITORON”}},
    // TURN THE MONITOR/SCREEN OFF AT 21:00 WEEKEND
    {notification: ‘REMOTE_ACTION’, schedule: ‘0 21 * * * 6-7’, payload: {action: “MONITOROFF”}},
    // RESTART THE MAGICMIRROR PROCESS AT 2am EVERY SUNDAY
    {notification: ‘REMOTE_ACTION’, schedule: ‘0 2 * * SUN’, payload: {action: “RESTART”}}
    ]
    }
    },

    Can somebody tell me if this is the right way to do it or if there is some kind of issue there?

    Thanks!



  • Hello,
    When “hiding” a module, does that also stop it from executing? I’m looking for a way to reduce the number of API calls made, by disabling a module at night.
    If not, any other suggestion on how to achieve this?

    Thanks in advance.



  • @Henrik

    It’s not possible for MMM-ModuleScheduler to affect the behaviour of the modules it hides/shows.

    However, it is possible for a modules to ‘react’ to being shown/hidden.

    To reduce the API calls the developer of the modules you use could implement/subclass the suspend and resume methods.



  • @ianperrin hi thanks for this module.

    I used it to turn my uknationalrail module on and off at certain times. However what I noticed was that your module disables my uknationalrail module I.e. it turns it on but then it doesn’t update. If I remove your module and the settings of your module on my module it works fine.

    Is this a bug?

    Thanks


  • Project Sponsor

    @bachoo786 I had the same issue with MMM-googlemaps-route. The module was switched on at the defined time, but the map was not updated, only the travel times. Unfortunately, I had to find turn off the scheduler, but found a workaround for the route module to reduce the number of API calls.



  • @Fozi ah right well i would like to turn it on and off I have used remote control module as well but I face the same issue. I can adjust to reduce the number of API calls but thats least of my worries as I would like to have a clean MM interface hence turning off the module would be awesome provided it worked.



  • @bachoo786 MMM-ModuleScheduler (and MMM-RemoteControl) are only sending hide/show requests via the MagicMirror API, so have no control over the target modules upstream API calls.

    However, it may be possible something is amiss. Can you post your config and I’ll see if I can spot anything?



  • @ianperrin thanks for the reply.

    here is my config:

    /* Magic Mirror Config Sample
     *
     * By Michael Teeuw http://michaelteeuw.nl
     * MIT Licensed.
     *
     * For more information how you can configurate this file
     * See https://github.com/MichMich/MagicMirror#configuration
     *
     */
    
    var config = {
    	address: "0.0.0.0", // Address to listen on, can be:
    	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
    	                      // - another specific IPv4/6 to listen on a specific interface
    	                      // - "", "0.0.0.0", "::" to listen on any interface
    	                      // Default, when address config is left out, is "localhost"
    	port: 8181,
    	ipWhitelist: [], // Set [] to allow all IP addresses
    	                                                       // or add a specific IPv4 of 192.168.1.5 :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
    	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
    
    	language: "en",
    	timeFormat: 24,
    	units: "metric",
    //        customCss: 'css/custom.css',
    
    	modules: [
    //		{
    //			module: "alert",
    //		},
    		{
    			module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    		},
    
    
        { 
           module: 'MMM-ModuleScheduler',
        },
    
    
    
            {
    		module: 'MMM-SystemStats',
    		position: 'bottom_bar', // This can be any of the regions.
    		// classes: 'small dimmed', // Add your own styling. OPTIONAL.
    		// header: 'System Stats', // Set the header text OPTIONAL
    		config: {
    			updateInterval: 10000, // every 10 seconds
    			align: 'right', // align labels
                            units: 'metric',
    			view: 'textAndIcon',
    		},
    	},
    
    
            {
                module: "currentweather",
                position: "top_right",
                config: {
                    location: "London",
                    locationID: "xx",  //ID from http://bulk.openweathermap.org/sample/; unzip the gz file and find your city
                    appid: "xx"
                }
            },
            {
                module: "weatherforecast",
                position: "top_right",
                header: "Weather Forecast",
                config: {
                    location: "xx",
                    locationID: "xx",  //ID from http://www.openweathermap.org/help/city_list.txt
                    appid: "xx"
                }
            },
    
    
    
                {
                    module: 'random_quotes',
                    position: 'lower_third',
                    config: {
                                    updateInterval: '8',
                                    fadeSpeed: '4'
                    }
                },
    
                    {
                            module: 'MMM-homeassistant-sensors',
                            position: 'top_left',
                            config: {
                            host: "xx",
                            port: "xx",
                            https: true,
                            token: "xx",
                            prettyName: false,
    //                        updateInterval: "1000",
                            title: "Shower",
                            stripName: false,
                            values: [{
                              sensor: "sensor.shower",
                              icons: [{
                              "default": "shower"
                           }
                           ]
                             },{
                              sensor: "timer.water",
                              icons: [{
                              "default": "water-pump"
                           }
                           ]
                             }
                           ]
                        }
                    },
    
    {
                            module: 'MMM-homeassistant-sensors',
                            position: 'top_left',
                            config: {
                            host: "xx",
                            port: "xx",
                            https: true,
                            token: "xx",
                            prettyName: false,
    //                        updateInterval: "1000",
                            title: "Namaaz Time",
                            stripName: false,
                            values: [{
                              sensor: "sensor.fajr",
                              icons: [{
                              "default": "clock-outline"
                           }
                           ]
                             },{
                              sensor: "sensor.zohr",
                              icons: [{
                              "default": "clock-outline"
                           }
                           ]
                             },{
                              sensor: "sensor.maghrib",
                              icons: [{
                              "default": "clock-outline"
                          }
                          ]
                            }
                          ]
                        }
                    },
    
    
    
    
    
    
    
    
    {
            module:         'MMM-UKNationalRail',
            position:       'bottom_left',
            header:         'Wealdstone Departures',
            classes: 'scheduler',
            config: {
                module_schedule: {from: '0 9 * * 3', to: '0 18 * * 3' },
                stationCode:        'HRW',      // CRS code for station
                app_id:             'xx',         // TransportAPI App ID
                app_key:            'xx',         // TransportAPI App Key
                updateInterval: 1 * 60 * 1000,
                maxResults:         5,          //Optional - Maximum results to display.
                showOrigin:         false,      //Optional - Show the origin of the train in the table
                            destination:            'EUS',
                            to_offset:              'PT02:00:00',
                            operator:               'LM'
            }
        },
    
    
    
    {
          module: 'MMM-TFL',
          position: 'bottom_left',
          config: {
            updateTime: 600000,
            modes: ['tube'],
            lines: 'metropolitan'
          }
        },
    
    
    
    
    
    //{
    //  module: "MMM-AssistantMk2",
    //  position: "bottom_right",
    //  config: {
    //   assistantConfig: {
    //     latitude: 51.508530,
    //     longitude: -0.076132, 
    //    },
    //    micConfig: { // put there configuration generated by auto-installer
    //      sampleRate    : 16000,      // audio sample rate
    //      threshold     : 0.1,        // silence threshold (rec only)
    //      thresholdStart: null,       // silence threshold to start recording, overrides threshold (rec only)
    //      thresholdEnd  : null,       // silence threshold to end recording, overrides threshold (rec only)
    //      verbose       : false,      // log info to the console. Use this when you want to check mic working or not.
    //      silence       : 0,
    //      recorder: "arecord",
    //      device: "plughw:AK5371",
    //    },
    //    responseConfig: {
    //      useHTML5: true,
    //      useScreenOutput: true,
    //      useAudioOutput: true,
    //      useChime: true,
    //      timer: 2000,
    //      myMagicWord: false,
    //      delay: 0.5
    ////      playProgram: "mpg321"
    //    },
    ////      recorder: "arecord",
    // //     device: "plughw:AK5371",
    ////    },
    //    recipes: [ "with-MMM-Hotword.js"],
    //  }
    
    //},
    
    
    
    
    
    
    
    // {
    //   module: "MMM-Hotword",
    //    position: "bottom_right",
    //    config: {
    //      useDisplay: false,
    //      chimeOnFinish: null,
    //      recipes: ["with-AMk2v3_smart-mirror.js"],
    //      mic: {
    //        recordProgram: "arecord",
    //        device: "plughw:AK5371",
    //      },
    //    },
    //  },
    
    
    
    
    
    
    
    
    
    
    
    {
        module: 'newsfeed',
        position: 'bottom_bar',
        config: {
            feeds: [
                {
                    title: "BBC News UK",
                    url: "http://feeds.bbci.co.uk/news/england/rss.xml"
                },
                {
                    title: "Sky News",
                    url: "http://feeds.skynews.com/feeds/rss/world.xml"
                }
            ],
            showSourceTitle: true,
            showPublishDate: true,
            ignoreOldItems: true,
            ignoreOlderThan: 50400000,
            updateInterval: 10000
    
            }
          },
    
    
    
    	]
    
    };
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== "undefined") {module.exports = config;}
    


  • @ianperrin hi

    Did you have a chance to look at my configuration?