• 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-MealViewer

Scheduled Pinned Locked Moved Development
48 Posts 6 Posters 18.9k Views 6 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.
  • C Offline
    cowboysdude Module Developer @gonzonia
    last edited by Aug 27, 2019, 8:36 AM

    @gonzonia PHP won’t work in this software. If he doesn’t answer you I will be happy to help you get this going…

    G 1 Reply Last reply Oct 6, 2019, 4:39 PM Reply Quote 1
    • G Offline
      gonzonia @cowboysdude
      last edited by Oct 6, 2019, 4:39 PM

      @cowboysdude Thanks. I’m happy to use a JS implementation as well. The family calendar I created is just hitting a wordpress site I’m hosting on a mac mini. PHP was just so that it could load pre-render but the main thing is just to get the meal list populated on the calendar screen instead of having a separate tab open in the browser. I haven’t had a lot of time to try to look into this or switching to MM. I hate to be hijacking a MM thread but this is literally the only discussion I’ve found of anyone accessing the MealViewer data like this.

      1 Reply Last reply Reply Quote 0
      • G Offline
        gonzonia
        last edited by Oct 13, 2019, 6:28 PM

        This post is deleted!
        G 1 Reply Last reply Oct 13, 2019, 11:37 PM Reply Quote 0
        • G Offline
          gonzonia @gonzonia
          last edited by Oct 13, 2019, 11:37 PM

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • G Offline
            gonzonia
            last edited by Oct 13, 2019, 11:56 PM

            Okay. I’ve decided to build a MagicMirror to replace my homegrown and now I’m trying to implement this module. I’ve downloaded the repository for this from GitHub and ran npm install.
            I’ve added some config info to set the school and position. It’s showing breakfast and “Tomorrow’s Undefined”. I’d like it to show lunch. Help?

            1 Reply Last reply Reply Quote 0
            • S Away
              sdetweil
              last edited by Oct 14, 2019, 1:14 AM

              Open the developers window, ctrl-shift-i on the keyboard. Select the console tab and scroll up to see any errors. Usually red text

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              G 1 Reply Last reply Oct 14, 2019, 1:49 AM Reply Quote 0
              • G Offline
                gonzonia @sdetweil
                last edited by Oct 14, 2019, 1:49 AM

                @sdetweil Thank you. That’s helpful (I’m still learning the ins and outs of Magic Mirror) but there’s no errors. The “Undefined” is coming up while it’s loading the data. There’s no documentation for the module, I’m thinking there’s something that’s missing in the setup.

                S 1 Reply Last reply Oct 14, 2019, 11:36 AM Reply Quote 0
                • S Away
                  sdetweil @gonzonia
                  last edited by sdetweil Oct 14, 2019, 11:44 AM Oct 14, 2019, 11:36 AM

                  @gonzonia can u should your config info?

                  looking at the code, these are the options that are configurable

                    defaults: {
                      schools: [],
                      maxWidth: "300px",
                      updateInterval: 5 * 60 * 1000,
                      interval: 1000 * 60 * 15,
                    }
                  

                  where schools is an array of names
                  [ ‘school1’,school2’, ‘school3’]

                  used to call the api

                  https://api.mealviewer.com/api/v4/school/’ + this.config.schools[i]

                  school names can be found here
                  https://schools.mealviewer.com/

                  comment says only for one day
                  // Currently set to only pull one day’s data so endDayFormatted = todayFormatted

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  G 1 Reply Last reply Oct 14, 2019, 1:35 PM Reply Quote 0
                  • G Offline
                    gonzonia @sdetweil
                    last edited by Oct 14, 2019, 1:35 PM

                    @sdetweil
                    Thanks. I actually went in to the code and tweaked it. It was pulling the data fine, I think the issue was that the original developer’s usage only had a single meal (Lunch) available at the school and so it worked as is. Our school has Breakfast and Lunch I added an additional iteration to show all the meals or just what was placed in the config. The header now also reflects that. I’m not sure what that was supposed to do before because I couldn’t figure out where it was expecting the data.header to come from since nothing was loaded.

                    My changes can be found here.

                    https://github.com/gonzonia/MMM-MealViewer/tree/patch-1
                    added shortName to config to replace text based on config option instead of hardcoded
                    changed className to menuWrapper to allow for style control without interfering with other modules
                    added config option for showing single or multiple meals based on name, default is All

                    Still need to add some documentation but it might be a couple of weeks.

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      gonzonia
                      last edited by Nov 12, 2019, 12:16 PM

                      The module works great on the initial load. The problem is that it doesn’t seem to be updating. After 12pm it’s supposed to start showing the next days meals but doesn’t. Even the next day it doesn’t update. I’ll try to dig into the core aspects of developing a module and see if I can find out why, but if anyone with more experience has any ideas where I should start looking I’d appreciate it.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 3 / 5
                      • 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