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.

    Weatherforecast Wunderground module question

    Scheduled Pinned Locked Moved Development
    17 Posts 7 Posters 14.1k Views 5 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.
    • RedNaxR Offline
      RedNax Module Developer
      last edited by

      Not very experienced in developing in js, so forgive me if this is an easy one ;)

      I’ve been hacking away at the default weatherforecast module to have it use weatherunderground. That worked out great! However wu also provides human readable forecasts. (see pic below). Unfortunately the table resizes to accomodate the text. forcing the table to 50% width wraps teh text, but places the table immediately right of the center on the page.

      So the question is… how do i get the text to wrap in a reasonably sized table…

      0_1463126659852_wunder.png

      1 Reply Last reply Reply Quote 0
      • MichMichM Offline
        MichMich
        last edited by

        If you wrap the text in a div, you can specify the width of the div using CSS.

        Or, what you could do, is:

        forecastString = forecastString.replace(". ", ".<br>");
        

        This way the text will be wrapped after a period.

        1 Reply Last reply Reply Quote 0
        • RedNaxR Offline
          RedNax Module Developer
          last edited by RedNax

          Thanks!

          As your example only works on the first ". ", i’m now using

          this.forecastText.replace(/\.\ /g, “.
          ”);

          btw, the current weather and forecast are in a single api call to wunderground so i’v incorporated both displays in this one module. Also using the current weathericons (windspeed/direction).

          1 Reply Last reply Reply Quote 0
          • MichMichM Offline
            MichMich
            last edited by

            Just curious: what’s the benefit of Wunderground?

            1 Reply Last reply Reply Quote 0
            • RedNaxR Offline
              RedNax Module Developer
              last edited by

              For me it’s the availability of local weatherstations (@ a location close to me). OpenWeatherMap’s closest match to my location is > 10km away.
              Also there’s an extreme amount of data available. Language settings which will provide texts (as in the pic above) in your local language…
              Also (i understand) it’s used a lot in domotica systems.

              Plus i thought it’d be fun to try :D

              1 Reply Last reply Reply Quote 0
              • MichMichM Offline
                MichMich
                last edited by

                Interesting. Don’t know how much time you want to spent on building it, but is would be awesome if you can change the current weather modules in a way a user can configure the weather source. So make it configurable.

                If you’re able to make a good stable solution for it (and built it in a way we can add other feeds as well), we could update the core modules.

                1 Reply Last reply Reply Quote 1
                • KirAsh4K Offline
                  KirAsh4 Moderator
                  last edited by

                  I’m actually working on my own WUnderground module as well. I like them also for finding a closest station, but also because for some dumb reason, OpenWeatherMap is often REALLY wrong when it comes to the current conditions. The forecast is fairly accurate, but many times it would say it’s 20-30 degrees cooler than it actually is in the current conditions. It’s the same thing when I look on their web site too, so I know it’s not the module messing up. It’s whatever they are using for data collecting, it’s horribly wrong.

                  A Life? Cool! Where can I download one of those from?

                  1 Reply Last reply Reply Quote 2
                  • D Offline
                    desq
                    last edited by

                    I´m also a heavy user of wunderground and appreciate such a Modul.
                    (So I could use, indirectly, the weather station of my neighbor.

                    M 1 Reply Last reply Reply Quote 0
                    • M Offline
                      mattlugar @desq
                      last edited by

                      I’m modifying for wunderground now too. I’m finding openweathermap horribly wrong sometimes (today they say showers here and every other forecast system says sun).

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        mattlugar
                        last edited by

                        I’ve modified the existing weatherforecast module to utilize weather underground… I’m utilizing the weather underground default icons for now. Not sure if it is something of interest for me to modularize or not?

                        alt text

                        1 Reply Last reply Reply Quote 0
                        • pugslyP Offline
                          pugsly
                          last edited by

                          yes, very interested. Please if it wouldn’t be too much trouble, a module would be great, including the colors.

                          M 1 Reply Last reply Reply Quote 0
                          • M Offline
                            mattlugar
                            last edited by

                            I just finished getting it all coded up. The colors are simply css modifications (I can post how I did that in the README). About to grab some dinner then I’ll finish documentation and figure out how to set it up on GitHub.

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              mattlugar @pugsly
                              last edited by

                              Posted!!! Let me know what you think.

                              link text

                              1 Reply Last reply Reply Quote 0
                              • cowboysdudeC Offline
                                cowboysdude Module Developer
                                last edited by cowboysdude

                                This is awesome. I’ve installed added the info to the modules directory, adjusted the config.js and defaultmodules.js but it just sits and says “Loading…” and never loads.

                                I have api key and my info is loaded as NY/Elmira and I’ve also tried NY/Pine_City

                                Did I miss something here?

                                OH by the way this module is truly awesome!! Great job! Thank you

                                cowboysdudeC 1 Reply Last reply Reply Quote 0
                                • cowboysdudeC Offline
                                  cowboysdude Module Developer @cowboysdude
                                  last edited by

                                  @cowboysdude said in Weatherforecast Wunderground module question:

                                  This is awesome. I’ve installed added the info to the modules directory, adjusted the config.js and defaultmodules.js but it just sits and says “Loading…” and never loads.

                                  I have api key and my info is loaded as NY/Elmira and I’ve also tried NY/Pine_City

                                  Did I miss something here?

                                  OH by the way this module is truly awesome!! Great job! Thank you

                                  UPDATE I found the issue… wrong api key… It’s working GREAT now!!!

                                  1 Reply Last reply Reply Quote 0
                                  • KirAsh4K Offline
                                    KirAsh4 Moderator
                                    last edited by

                                    There shouldn’t be any reason to edit 'defaultmodules.js', that’s only specific to the default modules that MM comes with. Any modules that you install does not go in the default folder, but simply in MagicMirror/modules/<module_name> …

                                    A Life? Cool! Where can I download one of those from?

                                    cowboysdudeC 1 Reply Last reply Reply Quote 1
                                    • cowboysdudeC Offline
                                      cowboysdude Module Developer @KirAsh4
                                      last edited by

                                      @KirAsh4 Ok got it!! Thank you!!! :)

                                      1 Reply Last reply Reply Quote 0

                                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                      With your input, this post could be even better 💗

                                      Register Login
                                      • 1 / 1
                                      • 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