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

Made a birthday module

Scheduled Pinned Locked Moved Entertainment
39 Posts 4 Posters 3.5k Views 5 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
    cgillinger
    last edited by Jan 19, 2025, 11:43 AM

    I got inspired by MMM-Fireworks and decided to make a birthday module with fireworks and confetti. Its not a “birthday reminder” module, rather it sits quietly, and only erupts when someone has a birthday:
    24b5b63d-b220-492d-9b17-b1d2a5f6f985-image.png

    At that time a message is presented in the middle of the screen, fireworks and confetti is displayed.

    Its somewhat multilingual (machine translated) and has a few different messages to pick from.

    Things I haven’t solved: Currently there is a timer, that is per default set to “infinite” - because its of no use if its invisible. It would probably make sense to make some sortof “off button”, but my main display has no touch or input. So as of now it is as default showed until the day ends.

    Here it is: https://github.com/cgillinger/MMM-Birthday

    P 1 Reply Last reply Jan 22, 2025, 2:57 AM Reply Quote 7
    • P Offline
      plainbroke @cgillinger
      last edited by Jan 22, 2025, 2:57 AM

      @cgillinger
      I installed your module, it does nothing when its turn comes up in MMM-pages.
      I am running Bookworm, MM 2.30 on a Pi 4 8gb. How do I pick the messages?
      Not quite enough information to run this module.
      Please help with the setup…

      Slow learner. But trying anyways.

      C 1 Reply Last reply Jan 22, 2025, 11:22 AM Reply Quote 1
      • C Offline
        cgillinger @plainbroke
        last edited by sdetweil Jan 22, 2025, 12:20 PM Jan 22, 2025, 11:22 AM

        @plainbroke Im running Linux Mint and this is my config from config.js:

         {
           module: "MMM-Birthday",
              position: "middle_center", 
              config: {
                  birthdays: [
                      { name: "Eric", date: "01-26" },
                      { name: "Lisa", date: "07-01" },
                      { name: "Sigrid", date: "07-15" },
                      { name: "Lars", date: "07-17" },
                      { name: "Firas", date: "11-26" }
                  ],
                  fireworkDuration: "infinite",
                  confettiDuration: "infinite"
              }
            },
        

        This works for me. Mind sharing your config.js, to see if something is up there? Have you run npm install?

        And you dont pick messages, the module picks for you (or you can just edit the correct language json and enter the same message. This is for instance the en.json for english:

        {
        “MESSAGES”: [
        “🎉 Happy Birthday, {name}! 🎂”,
        “🎈 Best wishes on your special day, {name}! 🎁”,
        “🌟 Have a fantastic birthday, {name}! 🎊”,
        “✨ Wishing you a wonderful birthday, {name}! 🎈”,
        “🎊 May your day be filled with joy, {name}! 🌟”
        ]
        }

        And to be clear: The module only activates on birthdays. Otherwise it just sits invisble.

        P 1 Reply Last reply Jan 23, 2025, 2:56 AM Reply Quote 0
        • P Offline
          plainbroke @cgillinger
          last edited by Jan 23, 2025, 2:56 AM

          @cgillinger
          Yes did the npm install
          Here is the section out of my config.js

                          {
                                  module: "MMM-Birthday",
                                  position: "middle_center", // Module will be centered during celebrations
                                  config: {
                                          birthdays: [
                                                  { name: "Test1", date: "1-21" },
                                                  { name: "Test2", date: "1-22" },
                                                  { name: "Test3", date: "1-23" },
                                                  { name: "Test4", date: "1-24" },
                                                  { name: "Test5", date: "1-25" }
                                          ],
                                          fireworkDuration: "infinite", // or specific duration in milliseconds
                                          confettiDuration: "infinite"  // or specific duration in milliseconds
                                  }
                          },
          
          

          Slow learner. But trying anyways.

          C 1 Reply Last reply Jan 23, 2025, 11:18 AM Reply Quote 0
          • C Offline
            cgillinger @plainbroke
            last edited by cgillinger Jan 23, 2025, 11:19 AM Jan 23, 2025, 11:18 AM

            @plainbroke Question: Have you tried running it without MMM-Pages? Im not familiar with the functionality of that module (but I’ll look into it)

            C 1 Reply Last reply Jan 23, 2025, 3:03 PM Reply Quote 0
            • C Offline
              cgillinger @cgillinger
              last edited by Jan 23, 2025, 3:03 PM

              After looking at MMM-pages I think the issue is that MMM-Birthday uses special positioning to ensure its celebrations are always visible (it needs to be on top of everything else to work properly). However, this means it doesn’t play nicely with MMM-Pages’ normal way of showing and hiding modules.

              First suggestion: Add MMM-Birthday to MMM-Pages’ fixed modules:

              config: {
              fixed: [“MMM-page-indicator”, “MMM-Birthday”]
              }

              This should tell MMM-Pages to leave MMM-Birthday alone and let it handle its own visibility, which should resolve the issue while maintaining all the celebration effects.

              S P 2 Replies Last reply Jan 23, 2025, 3:11 PM Reply Quote 0
              • S Offline
                sdetweil @cgillinger
                last edited by sdetweil Jan 24, 2025, 12:00 AM Jan 23, 2025, 3:11 PM

                @cgillinger the other thing you can do is add support for the

                suspend(){}
                and resume{}

                methods in your modulename.js

                suspend means being hidden

                resume means being shown

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                C 1 Reply Last reply Jan 24, 2025, 8:53 AM Reply Quote 1
                • P Offline
                  plainbroke @cgillinger
                  last edited by Jan 24, 2025, 12:07 AM

                  @cgillinger
                  Well I tried your idea about putting MMM-Birthday in the “fixed” area in Pages.
                  I guess I can try your idea of using it without MMM-Pages, but it would be better if you could fix your module per sdetweil’s suggestion.

                  Slow learner. But trying anyways.

                  P 1 Reply Last reply Jan 24, 2025, 12:40 AM Reply Quote 0
                  • P Offline
                    plainbroke @plainbroke
                    last edited by Jan 24, 2025, 12:40 AM

                    @cgillinger
                    I tried your idea, I renamed my config.js to config.js2
                    copied the config.js.sample to config.js
                    added this to the new config.js

                    /* Config Sample
                     *
                     * For more information on how you can configure this file
                     * see https://docs.magicmirror.builders/configuration/introduction.html
                     * and https://docs.magicmirror.builders/modules/configuration.html
                     *
                     * You can use environment variables using a `config.js.template` file instead of `config.js`
                     * which will be converted to `config.js` while starting. For more information
                     * see https://docs.magicmirror.builders/configuration/introduction.html#enviromnent-variables
                     */
                    let config = {
                            address: "192.168.1.222",       // Address to listen on, can be:
                                                                            // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
                                                                            // - another specific IPv4/6 to listen on a specific interface
                                                                            // - "0.0.0.0", "::" to listen on any interface
                                                                            // Default, when address config is left out or empty, is "localhost"
                            port: 8080,
                            basePath: "/",  // The URL path where MagicMirror² is hosted. If you are using a Reverse proxy
                            ipWhitelist: [],        // Set [] to allow all IP addresses
                    
                            useHttps: false,                        // Support HTTPS or not, default "false" will use HTTP
                            httpsPrivateKey: "",    // HTTPS private key path, only require when useHttps is true
                            httpsCertificate: "",   // HTTPS Certificate path, only require when useHttps is true
                    
                            language: "en",
                            locale: "en-US",   // this variable is provided as a consistent location
                    
                            logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
                            timeFormat: 12,
                            units: "imperical",
                    
                            modules: [
                                    {
                                            module: "MMM-Birthday",
                                            position: "middle_center", // Module will be centered d>
                                            config: {
                                                    birthdays: [
                                                            { name: "Test1", date: "1-21" },
                                                            { name: "Test2", date: "1-22" },
                                                            { name: "Test3", date: "1-23" },
                                                            { name: "Test4", date: "1-24" },
                                                            { name: "Test5", date: "1-25" }
                                                    ],
                                                    fireworkDuration: "infinite", // or specific du>
                                                    confettiDuration: "infinite"  // or specific du>
                                            }
                                    },
                            ],
                    };
                    
                    /*************** DO NOT EDIT THE LINE BELOW ***************/
                    if (typeof module !== "undefined") { module.exports = config; }
                    
                    

                    Still does not work.
                    I removed and reinstalled
                    Still nothing. Maybe it only works on MINT?

                    Slow learner. But trying anyways.

                    S 1 Reply Last reply Jan 24, 2025, 12:47 AM Reply Quote 0
                    • S Offline
                      sdetweil @plainbroke
                      last edited by Jan 24, 2025, 12:47 AM

                      @plainbroke you can also use the environment variable to set the config file

                      export MM_CONFIG_FILE=config/xxxxx.js
                      npm start
                      or
                      npm run server

                      Both will use that config

                      export MM_CONFIG_FILE=

                      To reset it

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      P 1 Reply Last reply Jan 24, 2025, 1:27 AM Reply Quote 1
                      • 1
                      • 2
                      • 3
                      • 4
                      • 1 / 4
                      1 / 4
                      • First post
                        1/39
                        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