MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. Veldrovive
    3. Best
    V
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 53
    • Best 12
    • Controversial 0
    • Groups 1

    Best posts made by Veldrovive

    • MMM-Bob-Ross: For putting a happy little painting up on your mirror

      Demo
      Bottom Left Corner

      Description

      Bob Ross is the quintessential wholesome TV guy, and now he can be on your mirror too. His paintings of nature scenes are sure to put you in a good mood and his voice could calm a charging bull so about what you need after a stressful day.

      Usage

      modules: [
          ...
          {
            module: "MMM-Bob-Ross",
            position: "bottom_left",
            config: {
              imgHeight: "30vh", //Defines the height of the painting.
              videoHeight: "30vh", //Defines the height of the video.
              updateInterval: 1*60*60*1000, //How often does the painting change?
              autoPlay: true //Should the video start as soon as it switches?
            }
          }
          ...
        ]
      

      More specifics available on the GitHub page.

      Interaction

      Any other module can control the behavior of MMM-Bob-Ross through the notification system. For specifics of the notifications and payloads, refer to the GitHub page.

      posted in Entertainment
      V
      Veldrovive
    • RE: How to keep a history of values on Mirror

      The only way I could see not having to modify other modules would be to only use modules that already emit notifications when events happen. Then all you would need to do is create a simple module that receives, saves, and recalls those notifications and looks for changes. You could use something like json-store to make the whole process even easier. If you wanted to get more information, you could do a very simple modification to modules to just spit out more notifications with more data.

      posted in General Discussion
      V
      Veldrovive
    • MMM-Page-Selector: A page switcher that can set positions of modules

      I just finished up the final touches on MMM-Page-Selector and I feel like it turned out quite well. I couldn’t find a module that would do pages/profiles the way I wanted them done so I created my own.

      Description

      Well, it’s pretty simple. You define the page names and positions and then Page-Selector manages the visibility and positions of your modules to give you a seamless transition between fully configurable pages.

      demo

      On top of just switching visibility of modules, the position can also be swapped in an aesthetically pleasing way.

      Basic Usage

      Setting up pages is easy, all you need to do is add

      pages: {"page_name_one": "position", "page_name_two": "another_position"}
      

      below the position string in its config for any modules you want to appear on separate pages.
      For more information, look at the GitHub page

      Interaction

      This was developed alongside MMM-Voice-Commands so it works well with that. I also added support for MMM-page-indicator, but it is also really easy to add support to any other module. To switch pages, simply send a notification to “PAGE_SELECT” with a payload that contains either the name of the page as a string or the index of the page.

      There have been no major issues I have seen with compatibility while I have been developing, but that doesn’t mean they don’t exist. If you find any, feel free to create an issue on github or reply below.

      posted in System
      V
      Veldrovive
    • MMM-Inspirational-Quotes is now here

      The moment we have all been waiting for is upon us. That is if you have been waiting for the moment when bot-created inspirational quotes can be delivered directly to you through the medium of a magic mirror.
      Just to be clear, most of these quotes will not make you inspired, but they will all make you laugh so I think that’s a good trade-off.
      The image generation is done using inspirobot and this module is simply a wrapper for it.
      demo2

      Download and usage instructions can be found on the Github Page

      posted in Entertainment
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      I’ve worked with changing the classes of modules on the fly during my work on this module.
      In order to change the class of a module or some modules:

      MM.getModules().withClass(/*Your module name or list of names*/).enumerate(module => {
          ref = document.getElementById(module.data.identifier);
          if(ref === null){
              Log.log("Module does not exist")
          }else{
              ref.classList.add("Your new class")
              // Or if you want to get rid of a class
              ref.classList.remove("Your old class")
          }
      })
      
      posted in System
      V
      Veldrovive
    • RE: How to run as "https"?

      As far as I know, it is pretty simple.
      In your js/server.js file, you are going to want to convert the http server it is using to an https one.
      First thing you are going to want to do is to create a self-signed certificate which is explained much better than I can on stack overflow.

      You can store those in any folder you want, but I just put them under js/https/* in order to have them close by.

      Then, in the server.js file, comment out var server = require("http").Server(app); near the top of the file. Underneath the imports, add a line importing your key and cert like so:

      var options = {
        key: fs.readFileSync(path.join(__dirname, "/https/key.pem")),
        cert: fs.readFileSync(path.join(__dirname, "/https/cert.pem"))
      };
      

      Underneath that, insert the line var server = require("https").Server(options, app); to substitute an https server for the http one. Finally, copy the line var io = require("socket.io")(server); below that and start your mirror.

      posted in Troubleshooting
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      Changes that edit the way users must set up their config.js file have been made to this module. The position prop is no longer necessary to have inside the module config and the way to exclusions are handled has changed. For more information, look at the updated readme in the development branch of the GitHub page.
      These changes will be merged into the master branch in a couple of days which will cause errors if your config is not updated.

      posted in System
      V
      Veldrovive
    • RE: How to run as "https"?

      As a slightly more easy to deal with version, you can just add

      var server = require("http").Server(app);
      if(config.useHttps){
          var options = {
              key: fs.readFileSync(path.join(config.httpCertPath, "key.pem")),
              cert: fs.readFileSync(path.join(config.httpCertPath, "cert.pem"))
          }
          server = require("https").Server(options, app);
      }
      
      
      var io = require("socket.io")(server);
      

      in the same server.js file right under the var Server = function(config, callback) { line.
      In your config.js, you can modify it to be

      var config = {
          useHttps: true,
          httpCertPath: "ABSOLUTE_PATH",
      }
      

      and then you can switch back and forth if you need.

      posted in Troubleshooting
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @Brandenborg
      This is not a default function of this module. However, if you can edit a small amount of code, it should be easy to implement.
      Just copy these lines of code right after line 235 of MMM-Page-Selector.js. This lines should be selectPage(payload);

      clearTimeout(self.default_timeout);
      if(![0, this.config.defaultPage].includes(payload)){
          self.default_timeout = setTimeout(() => {
              selectPage(this.config.defaultPage);
          }, TIME)
      }
      

      Then just replace TIME with the number of milliseconds you want to remain on the page before it automatically switches back to default. You may also have to change the 0 in the if statement if your default page isn’t at the 0th position.

      posted in System
      V
      Veldrovive
    • RE: MMM-Page-Selector: A page switcher that can set positions of modules

      @Brandenborg
      The 0 should be the position of your default page in the page list. The furthest left is 0.

      posted in System
      V
      Veldrovive
    • 1
    • 2
    • 1 / 2