MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. UncleRoger
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 15
    • Posts 101
    • Groups 0

    Posts

    Recent Best Controversial
    • Config option with array of multiple values?

      I’m working on a module and it mostly works. I’d like to expand its functionality a bit though and to do that I’m thinking about changing an array I have into an array of multiple values. That is, I currently have defined and am using:

      validSenders: [ "mom@example.com",
                      "dad@example.com",
                      "son@example.com",
                    ]
      

      My code uses it thusly:

      if (!that.config.validSenders || that.config.validSenders.includes(mailObj.sender[0].address)) {
      
      

      What I’d like to do is change that to look like this:

      validSenders: [ { "mom@example.com", "Mom", "#ff0000" },
                      { "dad@example.com", "Dad", "#00ff00" },
                      { "son@example.com", "Son", "#0000ff" },
                    ]
      

      but I don’t know a) if that’s right, b) how I would do the check in the if statement above, and c) how I would access the other parts of each element. Heck, I don’t even know if that syntax is right. (I know nothing of Javascript.)

      Any help with this would be much appreciated. It’s totally unnecessary but I think it could enhance the usability of the module for others.

      And if I might digress for a moment, I have this code in my module:

      if (that.config.validSenders.includes(mailObj.sender[0].address)) {
         if (daysAgo >= 0 && daysAgo <= that.config.daysToDisplay) {
      

      which works fine.

      But if I combine those two IF statements, it doesn’t.

      if (that.config.validSenders.includes(mailObj.sender[0].address) && \
          daysAgo >= 0 && daysAgo <= that.config.daysToDisplay) {
      

      It doesn’t work even if I remember to remove the second closing brace at the end.

      Thanks!

      posted in Development
      UncleRogerU
      UncleRoger
    • RE: Request for a dinner plan

      I don’t know if this will work for you but I’ve set up a google calendar called “Dinner Menu” that I use for planning meals for the week. I enter an all-day event for each day with the main dish and, occasionally, sides. Actually, I mostly duplicate previous events as I’ve put the ingredients in the description for most of the meals to help with planning the weekly shopping.

      I’m now setting up a MagicMirror and am using an instance of the stock calendar module to list the next 7 days of dinners. (One of the primary reasons for setting this up is to get my son to stop asking “What’s for dinner” every day.)

      Here’s what it looks like on the MM:

      012338d3-1a00-4ff4-8e71-8dcebbfb85a7-image.png

      Actually, that’s from a few days ago; I got rid of the icon on the left for a cleaner look. So far, it’s pretty much solved the problem and it’s not even properly set up yet.

      I haven’t looked into recipe modules yet; I might look for a calendar module that can show the description for an event to show today’s meal and the comments I’ve entered for it (usually a list of ingredients) but that’s down the road.

      posted in Requests
      UncleRogerU
      UncleRoger
    • RE: MMM-Moon shows only "No Image!"

      @sdetweil Thanks to a comment on another thread, I’ve found the answer – I needed to restart the RPi. Once I did that, both the MoonPhase and MMM-Earth modules started working.

      posted in Troubleshooting
      UncleRogerU
      UncleRoger
    • RE: MMM-Moon shows only "No Image!"

      I tried using MMM-MoonPhase and didn’t have any luck there either. Here is my config for that:

                      {
                              module: "MMM-MoonPhase",
                              position: "top_left",
                              config: {
                                      updateInterval: 43200000,
                                      hemisphere: "N",
                                      resolution: "detailed",
                                      basicColor: "white",
                                      title: true,
                                      phase: true,
                                      size: 200,
                                      moonAlign: "center",
                                      textAlign: "center",
                                      alpha: 0.7,
                                      riseAndSet: {
                                          display: false,
                                          lat: 37.xxxxx,
                                          lon: -122.xxxxx,
                                          gmtOffset: -8.0
                                      }
                              }
                      },
      

      Here’s what I’m seeing:
      84344962-5bf5-4b2c-852a-366ef454ae69-387451827_1708599592982589_729151378905253751_n.jpg

      I’m starting to think that maybe it’s something more basic with my setup as MMM-SystemStats doesn’t work either (just shows “Loading…” for each item).

      The moon phase isn’t, of course, critical, but it would be nice to get working.

      posted in Troubleshooting
      UncleRogerU
      UncleRoger
    • RE: Want to show full-screen images and switch to MM on keypress

      @sdetweil

      Oh dear. Looks like I’ve got my work cut out for me. 8^) I think I’ll see if I can dig up another RPi to use for testing so I don’t muck up the “production” one. 8^)

      Thanks for your help!

      posted in General Discussion
      UncleRogerU
      UncleRoger
    • RE: Stock calendar module does not honor options

      @sdetweil Okay, I think that makes sense. Thanks!

      posted in Troubleshooting
      UncleRogerU
      UncleRoger
    • MMM-Moon shows only "No Image!"

      I installed the MMM-Moon module and put in the default config from the git page and all I see is “No Image!”. Has anyone else gotten this to work?

      Here’s my config:

                          {
                            module: "MMM-Moon",
                            position: "top_left",
                            config: {
      //                      Coordinates for my place:
                              lat: 37.nnnnn,
                              lon: -122.nnnnn,
                              timezone: "America/Los_Angeles"
                            }
                          },
      
      posted in Troubleshooting
      UncleRogerU
      UncleRoger
    • RE: Want to show full-screen images and switch to MM on keypress

      @sdetweil Thanks again! That gives me what I need to move further.

      It looks like I need a module to display the images (I know I’ve seen some modules that do that) and one to handle the keypress that can send a notification to the image module (and the image module needs to be able to process the notification.)

      Or, I’ve seen modules that (I think) can change the layout dynamically, perhaps that could work too.

      Thanks!

      posted in General Discussion
      UncleRogerU
      UncleRoger
    • RE: Stock calendar module does not honor options

      @sdetweil Thank you so much! That did the trick!

      I guess everything goes inside the config block other than the module name and position? I’ll re-read the docs to get more info on that.

      Thanks again!

      posted in Troubleshooting
      UncleRogerU
      UncleRoger
    • Stock calendar module does not honor options

      I’m new to this so I suspect I’ve done something wrong. I also don’t know what info is needed for folks to help me.

      I started with a fresh OS install and then used sdeitwell’s install script. I’ve added a few modules, including MMM-MonthlyCalendar to display 4 weeks of a calendar. Because that module uses the calendars specified in the stock calendar’s config, I have all my calendars listed in the stock calendar with hiddenOnStartup set to true.

      Then I also have another instance of the stock calendar with just one calendar. That one, my Dinner Menu, has a single all-day event each day and what I want is to list the next week or so’s dinners (so I don’t have to keep answering my son’s question of “what’s for dinner?”).

      That works except that I don’t want the symbol shown next to it and I think I’d like to turn off the fade. Neither works, however. Whatever I try, the symbol shows next to the entries and the fade is there. Here’s what I’ve got in my config file (I also tried MMM-CalendarExt3Agenda which works but I actually prefer the stock calendar’s layout for this.):

      //----------------------------------------------------------------------------------------------
                      {
                              module: "calendar",
                              // disabled: true,
                              hiddenOnStartup: true,
                              header: "Dinner Menu",
                              position: "top_left",
                              coloredText: true,
                              coloredBackground: true,
                              fade: false,
                              displaySymbol: false,
                              config: {
                                      calendars: [
                                              {  // Roger's Calendar
                                                      name: "Roger",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents:    "true",
                                                      color: "#ffcc00"
                                              },
                                              {  // Rachel's Calendar
                                                      name: "Rachel",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: true,
                                                      color: "#07790e",  // "#21ff00",
                                              },
      
                                              {  // Jared's Calendar
                                                      name: "Jared",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: true,
                                                      color: "#fd0018", // "#e3240a"
                                              },
                                              {  // Sara's Calendar
                                                      name: "Sara",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: true,
                                                      color: "#2c48cf",  // "#ba10fc",  // "#2c48cf",
                                                      bgColor: "#dd3367"
                                              },
                                              {  // Ezra's Calendar
                                                      name: "Ezra",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: true,
                                                      color: "$1313fc",  // "#ffad46"
                                              },
                                              {  // Cal Poly SLO Calendar
                                                      name: "CalPoly",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: true,
                                                      color: "#ca7319"
                                              },
                                              {  // SUNY Cortland Calendar
                                                      name: "SUNYCortland",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: true,
                                                      color: "#2c48cf"
                                              },
                                              {  // SFUSD Academic Calendar
                                                      name: "SFUSD",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: true,
                                                      color: "#ffad46"
                                              }
      
                                      ]
                              }
                      },
      //-------------------------------------------------------------------------
                      {
                              module: "calendar",
                              header: "Dinner Menu",
                              position: "top_left",
                              coloredText: true,
                              coloredBackground: true,
      //                      maximumNumberOfDays: 7,
      //                      maximumEntries: 4,
      //                      displaySymbol: false,
      //                      limitDays: 7,
                              fade: false,
                              config: {
                                      calendars: [
                                              {  // Dinner Menu
                                                      name: "Dinner Menu",
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: "true",
                                                      color: "#3333ff",
                                                      displaySymbol: false,
      //                                              maximumNumberOfDays: 7,
                                                      maximumEntries: 8,
      //                                              limitDays: 7,
                                               },
                                      ]
                              }
                      },
      
      
                      {
                        module: "MMM-CalendarExt3Agenda",
                        position: "top_left",
                        title: "My Agenda",
                        config: {
                          instanceId: "basicCalendar",
      //                  locale: 'de-DE',
                          firstDayOfWeek: 1,
                          startDayIndex: 0,
                          endDayIndex: 10,
                          calendarSet: ['Dinner Menu'],
                          useWeather: false,
                          onlyEventDays: 8,
                          showMiniMonthCalendar: false,
                        }
                      },
      
      //------------------------------------------------------------------------
      
      

      Here’s the config for the MonthlyCalendar. Note that I don’t think the calendar set does anything there; I just haven’t taken it out yet:

                      {
                              module: "MMM-MonthlyCalendar",
                              position: "bottom_right",
                              config: { // See "Configuration options" for more information.
                                mode: "fourWeeks",
                                firstDayOfWeek: "monday",
                                hideCalendars: [ "Dinner Menu" ],
                                      calendars: [
                                              {  //  Dinner Menu
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      broadcastPastEvents: "true",
                                                      bgColor: "#3333ff"
                                              },
                                              {  //  Roger's Calendar
                                                      url: "https://calendar.google.com/calendar/ical/
                                                      braodcastPastEvents: "true",
                                                      color: "#00ff00"
                                              }
                                      ]
                              }
                      },
      
      
      

      Lastly, here’s what I’m seeing:

      b80c0ae2-a09d-470a-a46d-a89598092eb3-394299905_1290422785711967_1431063864895985721_n.jpg

      Any tips or suggestions would be most welcome. Thanks!

      posted in Troubleshooting calendar config setup and configure
      UncleRogerU
      UncleRoger
    • 1 / 1