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.

    MMM-Moon, See the moon phases and rise/set times!

    Scheduled Pinned Locked Moved Utilities
    13 Posts 7 Posters 5.0k Views 7 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
      siboy73 @enderflop
      last edited by

      @enderflop I have given this a try and all i get is the No Image! message. Any ideas?

      S 1 Reply Last reply Reply Quote 0
      • R Offline
        Rags @Rags
        last edited by sdetweil

        @Rags said in MMM-Moon, See the moon phases and rise/set times!:

        @enderflop
        Okay, so i tried it out and it is working fine. Nice effort. However, You have forgotten to add the sample config.js entries, though you have given the configuration options. Is there a way to enlarge the size of the image in the configuration file?
        Thanks

        To add lines of code to configure the size of the image, you can modify the getDom function as follows:

        getDom: function() {
          var outerDiv = document.createElement("div");
          if (this.content) {
            var img = document.createElement("img");
            img.src = this.content;
            img.style.width = this.config.width || "100%"; // add this line to set the width of the image
            img.style.height = this.config.height || "auto"; // add this line to set the height of the image
            outerDiv.appendChild(img);
          } else {
            outerDiv.innerText = "No image!";
          }
          return outerDiv;
        },
        
        add this in config.js;
        {
          module: "MMM-Moon",
          position: "top_right",
          config: {
            width: "400px",      //    as per requirement
            height: "400px"       //    as per requirement
          }
        }
        

        code blocks please, by sdetweil

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          siboy73 @siboy73
          last edited by

          @enderflop further to before mentioned, I have changed my location in the js file from the standard US location you had and if I leave my location out of the config file I get an image(not sure if this a correct image or generic) but when I add my location in the config I get the no image message.

          1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @Rags
            last edited by

            @Rags a much better way is to use css to set the size instead of changing the code

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              Rags @sdetweil
              last edited by

              @sdetweil said in MMM-Moon, See the moon phases and rise/set times!:

              @Rags a much better way is to use css to set the size instead of changing the code

              Sure. Understood. Just learning.

              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @Rags
                last edited by

                @Rags its ok, we are all learning every day… i learn new MM stuff every day due to different modules and uses

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • Z Offline
                  Zippyczech
                  last edited by

                  Guys, can somebody please post sample config? Im having troubles setting it up with something else than empty config. Thanks

                  L 2 Replies Last reply Reply Quote 0
                  • L Offline
                    LanceInMN @Zippyczech
                    last edited by

                    @Zippyczech

                    I initially put the lat/lon in quotes, but they must be integer values:

                    		module: "MMM-Moon",
                    		//disabled: true,
                    		position: "top_right",
                    		config: 
                    		{
                    			lat: 44.55555,    // Latitude
                    			lon: -93.55555,   // Longitude
                    			timezone: "America/Chicago"
                    		}
                    
                    S 1 Reply Last reply Reply Quote 0
                    • L Offline
                      LanceInMN @Zippyczech
                      last edited by

                      @Zippyczech
                      module: “MMM-Moon”,
                      //disabled: true,
                      position: “top_right”,
                      config:
                      {
                      lat: 44.55555, // Latitude
                      lon: -93.55555, // Longitude
                      timezone: “America/Chicago”
                      }

                      1 Reply Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @LanceInMN
                        last edited by

                        @LanceInMN I’m gonna be picky in case someone else reads this and doesn’t pay attention.

                        integers have no decimal places
                        u meant numeric

                        with quotes it’s a text string

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

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