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.

    How to run two instances of one module?

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    6 Posts 4 Posters 2.6k 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.
    • S Offline
      sdetweil @AndrewEscobar
      last edited by

      @AndrewEscobar typically, you copy the module to another folder name, mmm-hue-lights1,
      then edit the mmm-hue-lights.js and chaneg the name there to mmm-hue-lights1, then rename that file to mmm-hue-lights1.js

      then in the config use the module: ‘mmm-hue-lights1’

      but, some modules think there will be only one instance, and find and edit the single copy of the html
      and of course the api usage may have limits too…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      qu1queQ 1 Reply Last reply Reply Quote 0
      • qu1queQ Offline
        qu1que Project Sponsor @sdetweil
        last edited by

        @sdetweil

        Hi, the same happens to me with https://github.com/lavolp3/MMM-DailyDilbert module. I’ve tried to use two instances of the same module, one with Dilbert, and another with Garfield comic. For that, I’ve git cloned one time the module, change name to MMM-DailyDilbert_Dilbert, git clone again and rename MMM-DailyDilbert_Garfield. Added two tricky-modules to config.js, each one with its own configuration, but doesn’t work, does not show any module or just show only one…

        Mykle1M 1 Reply Last reply Reply Quote 0
        • Mykle1M Offline
          Mykle1 Project Sponsor Module Developer @qu1que
          last edited by Mykle1

          @qu1que

          Clone https://github.com/lavolp3/MMM-ComicStrips into modules folder.
          Copy and paste that folder, renaming it to MMM-ComicStrips2
          Open MMM-ComicStrips2 folder and rename MMM-ComicStrips.js to MMM-ComicStrips2.js
          Open MMM-ComicStrips2.js file and change line 1 to Module.register("MMM-ComicStrips2", {

          Make config.js entry

          {
              module: 'MMM-ComicStrips',
              position: 'top_center',
              config: {
                comic: "dilbert",         // Choose between  ["dilbert", "xkcd", "garfield", "peanuts", "nichtlustig", "ruthe", "dilbert_de"]
                updateInterval : 1000 * 60 * 30,  // 30 minutes
                coloredImage: false,      //colored or black&white (inverted) image
                comicWidth: 500,
                timeForDaily: [7, 9]    //time frame to show the most recent (or daily) comic.
              }
            },
            {
              module: 'MMM-ComicStrips2',
              position: 'middle_center',
              config: {
                comic: "garfield",         // Choose between  ["dilbert", "xkcd", "garfield", "peanuts", "nichtlustig", "ruthe", "dilbert_de"]
                updateInterval : 1000 * 60 * 30,  // 30 minutes
                coloredImage: false,      //colored or black&white (inverted) image
                comicWidth: 500,
                timeForDaily: [7, 9]    //time frame to show the most recent (or daily) comic.
              }
            },
          

          0_1566088219125_Screenshot from 2019-08-17 20-21-53.png

          Create a working config
          How to add modules

          qu1queQ 1 Reply Last reply Reply Quote 0
          • qu1queQ Offline
            qu1que Project Sponsor @Mykle1
            last edited by

            @Mykle1

            Thanks! Now it works perfect!!

            Mykle1M 1 Reply Last reply Reply Quote 0
            • Mykle1M Offline
              Mykle1 Project Sponsor Module Developer @qu1que
              last edited by

              @qu1que said in How to run two instances of one module?:

              Thanks! Now it works perfect!!

              Excellent! :thumbsup:

              Create a working config
              How to add modules

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