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-Timetable

    Scheduled Pinned Locked Moved Productivity
    43 Posts 12 Posters 23.9k Views 13 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.
    • ? Offline
      A Former User @zdenek
      last edited by A Former User

      @zdenek
      0) display 2 timetables together;
      Hmmm… I think it’s hard. I had considered that case at the development, but gave up. because I thought the screen was too small to display complex timetables.

      1. display 2 timetables by rotation
      refreshInterval: 1000*60,
      schedules: [
        {
          title: "Even Weeks",
          schedule: [ ... ]
        },
        {
          title: "Odd Weeks",
          schedule: [ ... ]
        }
      

      This would make a rotation of timetables per every 1 minutes.

      1. Display right timetable of that week.
        I think it could be done by new feature - reading schedule from file.
        Prepare 2 csv files, - even.csv, odd.csv
        And you can add below code into your crontab to change from each .csv to thisweek.csv
      0 8 * * 6 test $((10#$(date +\%W)\%2)) -eq 1 && cp /your/path/odd.csv /your/paht/thisweek.csv || cp /your/path/even.csv /your/path/thisweek.csv
      

      This will copy odd.csv or even.csv to thisweek.csv on each Saturday.

      The configuration could be like this;

      refreshInterval: 1000*60,
      schedules: [
        {
          title: "My Kids Timetable",
          file: "thisweek.csv",
        },
      

      I didn’t test but you can catch the idea.

      1 Reply Last reply Reply Quote 2
      • V Offline
        Vauxdvihl
        last edited by

        @Sean
        Thanks a lot for this module
        For testing i have simply copied your example to my config.
        But i am not able to get it running
        The screen stays black
        Any idea
        Do i have to use the lastest version of the magic mirror sw?

        Thanks a lot
        Greetz

        0|mm       | Shutting down server...
        0|mm       | > magicmirror@2.4.1 start /home/pi/MagicMirror
        0|mm       | > sh run-start.sh
        0|mm       | Starting MagicMirror: v2.4.1
        0|mm       | Loading config ...
        0|mm       | Loading module helpers ...
        0|mm       | No helper found for module: clock.
        0|mm       | No helper found for module: alert.
        0|mm       | No helper found for module: MMM-Timetable.
        0|mm       | All module helpers loaded.
        0|mm       | Starting server on port 8080 ... 
        0|mm       | Server started ...
        0|mm       | Sockets connected & modules started ...
        0|mm       | Launching application.
        
        
        	{
          //disabled:true,
          module: "MMM-Timetable",
          position: "top_right",
          config: {
            timeFormat: "hh:mm A",
            height: "800px",
            width: "150px",
            mode: "5days", // "today", "5days", "7days"
            refreshInterval: 1000*60,
            displayEndTime:true, //whether display endTime on timeline or not.
            schedules: [ //array of schedules
              {
                title: "Slytherin 2nd Year",
                file: null, // or "test.csv" - comma separated text file. (see `test.csv`)
                schedule: [
                  // [weekday, starttime(24h), endtime(24h), title, subtitle, backgroundColor(optional)]
                  // weekday : 1 for Monday, 2 for Tuesday, ... 7 for Sunday
                  [1, "0730", "0900", "Breakfast", "", "rgba(0,255,0, 0.5)"],
                  [2, "0730", "0900", "Breakfast", "", "rgba(0,255,0, 0.5)"],
                  [3, "0730", "0900", "Breakfast", "", "rgba(0,255,0, 0.5)"],
                  [4, "0730", "0900", "Breakfast", "", "rgba(0,255,0, 0.5)"],
                  [5, "0730", "0900", "Breakfast", "", "rgba(0,255,0, 0.5)"],
                  [1, "1200", "1300", "Lunch", "", "rgba(0,255,0, 0.5)"],
                  [2, "1200", "1300", "Lunch", "", "rgba(0,255,0, 0.5)"],
                  [3, "1200", "1300", "Lunch", "", "rgba(0,255,0, 0.5)"],
                  [4, "1200", "1300", "Lunch", "", "rgba(0,255,0, 0.5)"],
                  [5, "1200", "1300", "Lunch", "", "rgba(0,255,0, 0.5)"],
                  [1, "1800", "1900", "Dinner", "", "rgba(0,255,0, 0.5)"],
                  [2, "1800", "1900", "Dinner", "", "rgba(0,255,0, 0.5)"],
                  [3, "1800", "1900", "Dinner", "", "rgba(0,255,0, 0.5)"],
                  [4, "1800", "1900", "Dinner", "", "rgba(0,255,0, 0.5)"],
                  [5, "1800", "1900", "Dinner", "", "rgba(0,255,0, 0.5)"],
                  [1, "1100", "1145", "Transfiguration", "w/Ravenclaw"],
                  [1, "1315", "1400", "Charms", "w/Hufflepuff"],
                  [2, "0915", "1045", "Transfiguration", "w/Ravenclaw"],
                  [2, "1500", "1630", "Herbology", "w/Ravenclaw"],
                  [3, "0915", "1045", "Defense Against The Dark Art", "w/Gryffindor", "rgba(255,0,0,0.5)"],
                  [3, "1100", "1145", "Charms", "w/Hufflepuff"],
                  [3, "1315", "1445", "History of Magic", "w/Hufflepuff"],
                  [3, "1500", "1630", "Potions", "w/Gryffindor"],
                  [4, "1100", "1145", "Defense Against The Dark Art", "w/Gryffindor"],
                  [5, "1315", "1400", "Potions", "w/Gryffindor"],
                ]
              },
              {
                title: "Slytherin 2nd Year (only classes)",
                schedule: [
                  [1, "1100", "1145", "Transfiguration", "w/Ravenclaw"],
                  [1, "1315", "1400", "Charms", "w/Hufflepuff"],
                  [2, "0915", "1045", "Transfiguration", "w/Ravenclaw"],
                  [2, "1500", "1630", "Herbology", "w/Ravenclaw"],
                  [3, "0915", "1045", "Defense Against The Dark Art", "w/Gryffindor", "rgba(255,0,0,0.5)"],
                  [3, "1100", "1145", "Charms", "w/Hufflepuff"],
                  [3, "1315", "1445", "History of Magic", "w/Hufflepuff"],
                  [3, "1500", "1630", "Potions", "w/Gryffindor"],
                  [4, "1100", "1145", "Defense Against The Dark Art", "w/Gryffindor"],
                  [5, "1315", "1400", "Potions", "w/Gryffindor"],
                ]
              },
            ]
          }
        },
        
        ? 1 Reply Last reply Reply Quote 0
        • ? Offline
          A Former User @Vauxdvihl
          last edited by A Former User

          @vauxdvihl
          I have no problem…
          Try this;

          {
                //disabled:true,
                module: "MMM-Timetable",
                position: "top_right",
                config: {
                  file:"test.csv"
                }
              },
          

          Or just

          {
            module: "MMM-Timetable",
            position: "top_right",
          }
          
          V 1 Reply Last reply Reply Quote 0
          • V Offline
            Vauxdvihl
            last edited by

            @sean said in MMM-Timetable:

            {
            module: “MMM-Timetable”,
            position: “top_right”,
            }

            This is strange
            No error message and nothing shown on the screen
            I have generated a test config file (contains only the timeline)
            Hmm i need to check it

            1 Reply Last reply Reply Quote 0
            • V Offline
              Vauxdvihl
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • V Offline
                Vauxdvihl @Guest
                last edited by Vauxdvihl

                @sean
                I have done it

                Thanks

                V 1 Reply Last reply Reply Quote 0
                • V Offline
                  Vauxdvihl @Vauxdvihl
                  last edited by

                  @Sean
                  Can i change the timeformat to European one?
                  like 22:30?

                  Thanks

                  ? 1 Reply Last reply Reply Quote 0
                  • ? Offline
                    A Former User @Vauxdvihl
                    last edited by

                    @vauxdvihl
                    Set timeFormat as “HH:mm”

                    1 Reply Last reply Reply Quote 0
                    • V Offline
                      Vauxdvihl
                      last edited by Vauxdvihl

                      @Sean
                      Thanks it works

                      But i see there comes something strange
                      Setting these value to “HH:MM” the time datas from my conifg are not matching with the displayed datas.
                      Can you reproduce this?
                      Thanks
                      Regards

                      ? 1 Reply Last reply Reply Quote 0
                      • ? Offline
                        A Former User @Vauxdvihl
                        last edited by

                        @vauxdvihl
                        Not ‘HH:MM’, it’s ‘HH:mm’

                        V 1 Reply Last reply Reply Quote 0
                        • V Offline
                          Vauxdvihl @Guest
                          last edited by

                          @sean
                          Thanks a lot

                          1 Reply Last reply Reply Quote 0
                          • L Offline
                            lovesicker
                            last edited by

                            @Sean

                            How can I redefine the rows to equal altitude, regardless of time interval? I’d like to define equal altitude for each rows.

                            0_1553123605564_5ce28455-b1df-4bd9-ba9a-a81bfa191b15-image.png

                            Could you or anyone give me some suggestions? Thanks in advance.

                            ? 1 Reply Last reply Reply Quote 0
                            • ? Offline
                              A Former User @lovesicker
                              last edited by

                              @lovesicker
                              Not possible currently. Heights are dependent on duration.
                              I’ll consider it on next update but You’d better to display static table your own with some iframe or html module.(My MMM-HTMLBox can show static html on MM)

                              L 1 Reply Last reply Reply Quote 0
                              • L Offline
                                lovesicker @Guest
                                last edited by

                                @Sean

                                OK, I got it. Thanks for your reply.Let me try your MMM-HTMLBox.

                                Hahahah, I found I already become one of your fans. After trying out a module several days,I found it is coded by you,ig.,MMM-GroveGesture,MMM-CalendarExt.
                                I’m looking forward to next version about MMM-Timetable.

                                Have a good day!

                                L 1 Reply Last reply Reply Quote 0
                                • L Offline
                                  lovesicker @lovesicker
                                  last edited by lovesicker

                                  @Sean

                                  Another problem: under the MMM-page or MMM-page-select module environment, when you start MagicMirror, sometimes you will see the following MMM-Timeable UI:
                                  0_1553217622112_29dfbf21-47f4-4345-8b00-c570e16743af-image.png

                                  Until the modules refresh, the UI will be OK:

                                  0_1553218374412_77b46ec5-52af-4154-9dad-a70d45a8b580-image.png

                                  The issue only happened when Magic Mirror start. I know this is not a serious problem because you will not frequently restart Magic Mirror and switch to the MMM-Timeable page.

                                  Do you have some suggestions about it?

                                  ? 2 Replies Last reply Reply Quote 0
                                  • ? Offline
                                    A Former User @lovesicker
                                    last edited by

                                    @lovesicker
                                    This module would detect it’s position and dimensions to draw itself. To calculate proper size it needs. On start and each refresh interval it will recalculate.
                                    But some page modules prevent this detection by hiding module on start. And will show this module suddenly so module cannot have proper values. Of course after showing, on the next refeshing period, it could complete detection then will be no more problem.
                                    To avoid this, put this module on first page or shorten refreshing time.

                                    1 Reply Last reply Reply Quote 0
                                    • ? Offline
                                      A Former User @lovesicker
                                      last edited by A Former User

                                      @lovesicker
                                      In a few days, I’ll look inside my code and try to make its work better way. I think I can add recalculation logic on module’s resume.
                                      Anyway, so many courses. :D. but it’s usual in Far east Asia like China and Korea. I’m from Korea, but living in Germany now… In my highschool days of Korea, My classes began at 7:00AM and finished at 10:00PM LITERALLY. Not so worst to me but… :)

                                      L Cr4z33C 2 Replies Last reply Reply Quote 0
                                      • L Offline
                                        lovesicker @Guest
                                        last edited by lovesicker

                                        @Sean

                                        Hahaha, it’s my son’s school timetable. He is only ten years old. He like this timetable very much. I told him a foreign uncle coded this timetable for him. He is very pride for it…

                                        Thank you so much for bringing much happiness to our family.

                                        1 Reply Last reply Reply Quote 1
                                        • Cr4z33C Offline
                                          Cr4z33 @Guest
                                          last edited by

                                          @Sean said in MMM-Timetable:

                                          and finished at 10:00PM LITERALLY.

                                          :face_screaming_in_fear: :dizzy_face:

                                          ? 1 Reply Last reply Reply Quote 0
                                          • ? Offline
                                            A Former User @Cr4z33
                                            last edited by A Former User

                                            @Cr4z33
                                            30 years ago, that was usual for who wanted to enter Univ. in S.Korea. :D
                                            Nowadays, Highschool itself doesn’t go that way, but Students are studying very hard personally at Home or private institutes or with private teachers to take better score.

                                            Cr4z33C 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • 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