MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED How to run two instances of one module?

    Troubleshooting
    4
    6
    982
    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.
    • A
      AndrewEscobar last edited by AndrewEscobar

      eya guys,

      So I found a perfect module to manage my hue-lights: Crypto Casino

      But since I have my rooms spread out across two hue bridges I cant display all my rooms.

      This is going to sound so stupid, but I tried renaming all the instances of the modules name in order to make another bridge config possible.
      It did work, kinda - but the renamed module acts weird and prompts the HUE API until it gives up after a couple of minutes. It also causes a memory leak which leads MM to crash after a couple of minutes.

      Help would be very much appreciated!

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

        Create a working config
        How to add modules

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

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

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

              @Mykle1

              Thanks! Now it works perfect!!

              Mykle1 1 Reply Last reply Reply Quote 0
              • Mykle1
                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! 👍

                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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy