• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 - Module Schedules and Notifications

Scheduled Pinned Locked Moved System
moduleschedulecronnotifications
82 Posts 20 Posters 120.6k Views 20 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.
  • A Offline
    ArkantosArk
    last edited by Sep 11, 2017, 8:21 PM

    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!

    1 Reply Last reply Reply Quote 0
    • H Offline
      Henrik
      last edited by Mar 1, 2018, 10:36 PM

      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.

      I 1 Reply Last reply Apr 26, 2018, 9:27 PM Reply Quote 1
      • I Offline
        ianperrin @Henrik
        last edited by Apr 26, 2018, 9:27 PM

        @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.

        "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

        B 1 Reply Last reply Feb 2, 2020, 11:40 PM Reply Quote 2
        • B Offline
          bachoo786 @ianperrin
          last edited by Feb 2, 2020, 11:40 PM

          @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

          F 1 Reply Last reply Feb 3, 2020, 5:29 AM Reply Quote 0
          • F Offline
            Fozi Project Sponsor @bachoo786
            last edited by Feb 3, 2020, 5:29 AM

            @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.

            HowTo: Replace PIR Sensor with a RCWL-0516 Microwave Sensor

            B 1 Reply Last reply Feb 3, 2020, 11:28 AM Reply Quote 0
            • B Offline
              bachoo786 @Fozi
              last edited by Feb 3, 2020, 11:28 AM

              @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.

              I 1 Reply Last reply Feb 3, 2020, 10:01 PM Reply Quote 0
              • I Offline
                ianperrin @bachoo786
                last edited by ianperrin Feb 3, 2020, 10:04 PM Feb 3, 2020, 10:01 PM

                @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?

                "Live as if you were to die tomorrow. Learn as if you were to live forever." - Mahatma Gandhi

                B 2 Replies Last reply Feb 3, 2020, 11:09 PM Reply Quote 0
                • B Offline
                  bachoo786 @ianperrin
                  last edited by Feb 3, 2020, 11:09 PM

                  @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;}
                  
                  1 Reply Last reply Reply Quote -1
                  • B Offline
                    bachoo786 @ianperrin
                    last edited by Feb 7, 2020, 10:02 PM

                    @ianperrin hi

                    Did you have a chance to look at my configuration?

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      nagaculun
                      last edited by Apr 19, 2020, 11:45 PM

                      Can I configure to display a module dimmed from x to y; but turn off from y to x ?

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 5
                      • 6
                      • 7
                      • 8
                      • 9
                      • 8 / 9
                      • 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