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

MMM-CalendarExt2 how to rotate scenes?



  • @Sean My understanding of your wiki is that the scenes are to rotate automatically at each update interval, but I am not seeing that. Ultimately I want to use notifications to go back and forth between sense, but one thing at a time. Here is some of my config.

    views: [
          {
            Name: "This Month",
            mode: "month",
            calendars:[],
            position: "fullscreen_above",
            timeFormat: "h:mm A",
            slotMaxHeight: "175px",
            slotAltTitleFormat: "MMM D",
            slotTitleFormat: "MMM D",
            slotSubTitleFormat: "dddd",
            fromNow: 0,
          },
          {
            Name: "Last Month",
            mode: "month",
            calendars:[],
            position: "fullscreen_above",
            timeFormat: "h:mm A",
            slotMaxHeight: "175px",
            slotAltTitleFormat: "MMM D",
            slotTitleFormat: "MMM D",
            slotSubTitleFormat: "dddd",
            fromNow: -1,
          },
          {
            Name: "Next Month",
            mode: "month",
            calendars:[],
            position: "fullscreen_above",
            timeFormat: "h:mm A",
            slotMaxHeight: "175px",
            slotAltTitleFormat: "MMM D",
            slotTitleFormat: "MMM D",
            slotSubTitleFormat: "dddd",
            fromNow: +1,
          },
        ],
        scenes: [
    		{
    		name: "last Month",
    		},
    		{
    		name: "This Month",
    		},
    		{
    		name: "Next Month",
    		},		
        ],
    

  • Module Developer

    @Bestboy4
    All your scenes have same views(the default [] - all views). You didn’t specify views for each scene.
    I think this something similar will be your intention.

    rotateInterval: 30000,
    scenes: [
      {
        name: "ThisMonth",
        views: ["This Month"]
      },
      {
        name: "NextMonth",
        views: ["Next Month"]
      },
      {
        name: "LastMonth",
        views: ["Last Month"]
      },
    ],
    views: [
      {
        name: "This Month",
        ...
      },
      {
        name: "Next Month",
        ...
      },
      {
        name: "Last Month",
        ...
      }
    ],
    


  • @Sean Thanks for the reply. Unfortunately when I implement the flowing config, the entire module doesn’t even appear.

    module: 'MMM-CalendarExt2',
      config: {
    	rotateInterval: 30*1000,
            calendars : [
    			{
    			name: "bestfam5",
    			icon: "emojione-v1:family-man-woman-girl-girl",
    			url: "https://calendar.google.com/calendar/ical/***/basic.ics",
    			},
    			{
                name: "Andrew",
                url: "https://calendar.google.com/calendar/ical/***/basic.ics",
    			},
    			{
    			name: "PlantHS",
    			icon: "emojione:school",
    			url: "http://plantptsa.com/?a=eventtypes.ical&type_id=aac7c4c3-44cd-4190-b4a6-f0750f4aa4ca"
    			},
    			{
    			name: "Holidays",
    			url: "https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics"
    			},
    			{
    			name: "Heather",
    			url: "https://calendar.google.com/calendar/ical/***/basic.ics"
    			},
        ],
        views: [
          {
            Name: "This Month",
            mode: "month",
            calendars:[],
            position: "fullscreen_above",
            timeFormat: "h:mm A",
            slotMaxHeight: "175px",
            slotAltTitleFormat: "MMM D",
            slotTitleFormat: "MMM D",
            slotSubTitleFormat: "dddd",
            fromNow: 0,
          },
         {
            Name: "Last Month",
            mode: "month",
            calendars:[],
            position: "fullscreen_above",
            timeFormat: "h:mm A",
            slotMaxHeight: "175px",
            slotAltTitleFormat: "MMM D",
            slotTitleFormat: "MMM D",
            slotSubTitleFormat: "dddd",
            fromNow: -1,
          },
          {
            Name: "Next Month",
            mode: "month",
            calendars:[],
            position: "fullscreen_above",
            timeFormat: "h:mm A",
            slotMaxHeight: "175px",
            slotAltTitleFormat: "MMM D",
            slotTitleFormat: "MMM D",
            slotSubTitleFormat: "dddd",
            fromNow: +1,
          }, 
        ],
        scenes: [
    		{
    		name: "ThisMonth",
    		views: ["This Month"]
    		},
    		{
    		name: "LastMonth",
    		views: ["Last Month"]
    		},
    		{
    		name: "NextMonth",
    		views: ["Next Month"]
    		},		
        ],
      },
    },		
    

    I must have fat-fingered something, but i can’t figure out what. Any thoughts?


  • Module Developer

    @Bestboy4
    Not Name, name is right.
    Try this;

    {
      module: 'MMM-CalendarExt2',
      config: {
        rotateInterval: 10*1000,
        calendars : [
          {
            name: "PlantHS",
            icon: "emojione:school",
            url: "http://plantptsa.com/?a=eventtypes.ical&type_id=aac7c4c3-44cd-4190-b4a6-f0750f4aa4ca"
          },
          {
            name: "Holidays",
            url: "https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics"
          },
        ],
        defaultSet: {
          view: {
            mode: "month",
            calendars:[],
            position: "fullscreen_above",
            timeFormat: "h:mm A",
            slotMaxHeight: "120px",
            slotAltTitleFormat: "MMM D",
            slotTitleFormat: "D",
            slotSubTitleFormat: "dddd",
          }
        },
        views: [
          {
            name: "ThisMonth",
            mode: "month",
            fromNow: 0,
          },
          {
            name: "NextMonth",
            mode: "month",
            fromNow: +1,
          },
          {
            name: "LastMonth",
            mode: "month",
            fromNow: -1,
          },
        ],
        scenes: [
          {
            name: "THISMONTH",
            views: ["ThisMonth"]
          },
          {
            name: "NEXTMONTH",
            views: ["NextMonth"]
          },
          {
            name: "LASTMONTH",
            views: ["LastMonth"]
          },
        ],
      },
    },
    

    0_1566323770424_m.png



  • @Sean Yep, that did it! i knew it was something silly. Thanks.

    Now on to phase two, which is rotating scenes via notification. I think I’ll try to integrate MMM-Buttons module. If i understand you wiki correctly, would I do something like this?

    module: 'MMM-Buttons',
        config: {
            buttons: [
                {
                    pin: 25,
                    name: "calendar_control",
                    shortPress: {
                        notification: {
                           exec: "nextScene",
                           payload: null
                           }                
                      }
                 }
            ]
         },
    

  • Module Developer

    @Bestboy4
    I don’t know the structure of MMM-Buttons, however you can use the notification CALEXT2_SCENE_NEXT.

    https://github.com/eouia/MMM-CalendarExt2/wiki/3.-Usage#with-notification