MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Google calendar refresh rate



  • Hi guys, I had successfully loaded the main core MagicMirror(MM) by MichMich, and begin playing around with it.

    I noticed when I input a new appointment in my Google Calendar via my Smart phone, the refresh on MM is slow and could hardly appear on the MM.

    But if I input the appointment via my google web login, the update can be as fast as 1 min.

    Question:

    1. Why does my smart phone took so long to update my Google calendar?
    2. Where can I change the refresh rate in MM?

    Thanks


  • Module Developer

    The calendar module has a config setting fetchInterval. Please see calendar documentation for details.



  • @pindorf, Thanks for the documentation.

    According to the doc “To use this module, add it to the modules array in the config/config.js file”, may I know the module should be added under which section?

    Appreciate your guidance.


  • Module Developer

    Well, if you have created your config.js from the config.js.sample then you should already have a configuration sequence like below.

    modules: [
    ...
    {
        module: "clock",
        position: "top_left"
    },
    {
        module: "calendar",
        header: "US Holidays",
        position: "top_left",
        config: {
            calendars: [ {
    	    symbol: "calendar-check-o ",
                url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics"
            } ]
        }
    },
    ...
    ]
    

    You have to put the fetchInterval setting into the config setting section of the calendar module. The result would look like this (just typing the calendar module’s part for simplicity):

    {
        module: "calendar",
        header: "US Holidays",
        position: "top_left",
        config: {
            fetchInterval: 1000 * 60 * 1,
            calendars: [ {
    	    symbol: "calendar-check-o ",
                url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics"
            } ]
        }
    },
    

    The value 60 * 1000 * 1 retrieves the calendar from the source (see parameter url) every minute. Please note that the interval time value is given in milliseconds according to the documentation. When you pick a value make sure that your fetching is not too aggressiv. Too frequent syncs take bandwidth on your network, increases CPU load on Raspberry Pi, and there might be limitation enforced by the calendar provider.



  • Thank you @pinsdorf , I have got the fetchInterval value changed.

    You are really a great help.