MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

How to run two instances of one module?



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



  • @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…


  • Project Sponsor

    @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…


  • Project Sponsor Module Developer

    @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


  • Project Sponsor

    @Mykle1

    Thanks! Now it works perfect!!


  • Project Sponsor Module Developer

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

    Thanks! Now it works perfect!!

    Excellent! 👍


Log in to reply