• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 3.6k 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.
  • E Offline
    enderflop
    last edited by Mar 16, 2023, 10:03 PM

    https://github.com/EnderFlop/MMM-Moon

    There’s an indepth README on the GitHub page for anyone interested in installing this. If there is interest I can add more configuration options for customizing the image, but right now all you do is set your location and timezone. Let me know what you think!

    R S H 3 Replies Last reply Mar 17, 2023, 6:49 PM Reply Quote 2
    • R Offline
      Rags @enderflop
      last edited by Mar 17, 2023, 6:49 PM

      @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

      R 1 Reply Last reply Mar 20, 2023, 4:45 PM Reply Quote 0
      • S Offline
        siboy73 @enderflop
        last edited by Mar 19, 2023, 4:43 PM

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

        S 1 Reply Last reply Mar 26, 2023, 2:13 PM Reply Quote 0
        • R Offline
          Rags @Rags
          last edited by sdetweil Mar 20, 2023, 8:18 PM Mar 20, 2023, 4:45 PM

          @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 Mar 26, 2023, 2:34 PM Reply Quote 0
          • S Offline
            siboy73 @siboy73
            last edited by Mar 26, 2023, 2:13 PM

            @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 Offline
              sdetweil @Rags
              last edited by Mar 26, 2023, 2:34 PM

              @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 Mar 31, 2023, 3:48 PM Reply Quote 0
              • R Offline
                Rags @sdetweil
                last edited by Mar 31, 2023, 3:48 PM

                @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 Mar 31, 2023, 3:49 PM Reply Quote 0
                • S Offline
                  sdetweil @Rags
                  last edited by Mar 31, 2023, 3:49 PM

                  @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 May 4, 2023, 9:40 AM

                    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 Jul 1, 2023, 5:25 PM Reply Quote 0
                    • L Offline
                      LanceInMN @Zippyczech
                      last edited by Jul 1, 2023, 5:25 PM

                      @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 Jul 2, 2023, 6:24 PM 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