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.

    Trouble Integrating MMM-OpenWeatherMapForecast with OpenWeather API v3.0

    Scheduled Pinned Locked Moved Solved Troubleshooting
    29 Posts 2 Posters 1.4k Views 2 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
      Socrates
      last edited by

      I’m having trouble getting the MMM-OpenWeatherMapForecast module to work. It was functioning fine until a few months ago when OpenWeather switched to API v3.0. I generated a new API key for v3.0, removed the old v2.5 key from the MMM-OpenWeatherMapForecast section of my config file, and replaced it with the new key. However, the module still isn’t working. Below is a snippet of my code.

      {
        module: "MMM-OpenWeatherMapForecast",
        header: "Weather",
        position: "top_right",
        classes: "default everyone",
        disabled: false,
        config: {
          apikey: "v3.0 api",
          latitude: "29.714670",
          longitude: "-95.836860",
          iconset: "5c",
          units: "imperial",
          concise: true,
          forecastLayout: "tiled",
          showExtraCurrentConditions: true,
          showForecastTableColumnHeaderIcons: true,
          showSummary: false,
          showWind: true,
          hourlyForecastInterval: "1",
          forecastHeaderText: false,
          showPrecipitation: true,
          showCurrentConditions: false,
          maxDailiesToShow: 5,
          maxHourliesToShow: 4
        }
      },
      
      
      S 1 Reply Last reply Reply Quote 0
      • S Offline
        Socrates @sdetweil
        last edited by

        @sdetweil

        Hello and good evening again. The issue has been resolved. Even after reinstalling the module it did not work. Then i thought about something i would have done years back as a Linux System admin if a rpm package was not able to find depedencies already installed, i went and granted chmod -R 777 * to the MMM-OWMF folder, thus giving it recursive permission to read write and execute to self and guest users. After that i restarted and now I can see the module in my dashboard.

        Thank you so much for standing with me since yesterday and helping me out with this issue. This has been a great learning curve.

        Thanks again!!!

        S S 2 Replies Last reply Reply Quote 0
        • S Away
          sdetweil @Socrates
          last edited by sdetweil

          @Socrates do a git pull in the module folder to update the code

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 3 Replies Last reply Reply Quote 0
          • S Offline
            Socrates @sdetweil
            last edited by

            @sdetweil
            Thanks for your replies. I forgot to mention that, before posting this here, i did update the module. Infact to be on the safe side i renamed the folder MMM-OpenWeatherMapForecast to preserve it as a backup, and then used git clone to download the new module and ran npm install from within the MMM-OpenWeatherMapForecast folder.

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

              @sdetweil

              Did a git pull no, luck.

              S 1 Reply Last reply Reply Quote 0
              • S Away
                sdetweil @Socrates
                last edited by

                @Socrates ok, edit the node_helper.js

                and change the end of line 63 from

                 HH:mm") + " ** ERROR ** " + error);
                

                to

                 HH:mm") + " ** ERROR ** " + response .statusCode);
                

                then restart MagicMirror and look at the output of npm start

                im guessing its 401, access denied

                is your new apikey with a credit card?

                Sam

                How to add modules

                learning how to use browser developers window for css changes

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

                  @sdetweil
                  Also wanted to let you know I am using one openweather api for a different module in mm and thats working fine, only this module its not working, the module wont even show up on mm screen.

                  S 1 Reply Last reply Reply Quote 0
                  • S Away
                    sdetweil @Socrates
                    last edited by

                    @Socrates I took your config, used my v3 apikey and it works…

                    Screenshot at 2024-09-09 21-06-28.png

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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

                      @sdetweil
                      hello and good evening again. No i do not have a credit card on file with Openweathermap. Its a free tier.
                      Also, may i request you to guide me where to find the output file? I have mm on auto start while rebooting

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

                        @sdetweil
                        So do i need to sign up for a paid API using a credit card? Or do u think there is an inconsistency with my MMM-OWMF module? I have made the changes to the node_helper.js file just as you suggested and restarted MM, still no avail.

                        S 1 Reply Last reply Reply Quote 0
                        • S Away
                          sdetweil @Socrates
                          last edited by sdetweil

                          @Socrates i believe the 3.0 free tier also requires a credit card on file…
                          they give you 1000 calls no charge per day, but if you go over they charge you
                          see the link ‘Pay as you call’

                          Screenshot at 2024-09-09 21-42-48.png

                          (vs prevent the api from working)
                          this is new for 3.0
                          the linked pages says

                          'One Call API 3.0 is included to the “One call by call” subscription plan only, users pay for the actual use of the product. '
                          

                          if you are using pm2 to autolaunch then the output will be here

                          pm2 logs --lines=xxxx
                          

                          where xxxx is the number of the most recent lines of the log to display,
                          default 15

                          you may need more

                          I always recommend using manual start mode while debugging, this makes the output easier to access

                          pm2 status 
                          

                          will show the running apps

                          pm2 stop all 
                          

                          will stop them all

                          manual start

                          cd ~/MagicMirror
                          npm start 
                          

                          ctrl-c at the terminal or
                          ctrl-q on the mm screen to stop mm

                          once things are resolved

                          pm2 status
                          pm2 start x
                          

                          where x is the number of the line for the app to start or the name on that line
                          0 or MagicMirror as shown below on one of my systems

                          ┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
                          │ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
                          ├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
                          │ 0  │ MagicMirror        │ fork     │ 5    │ online    │ 0%       │ 2.5mb    │
                          └────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘
                          

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

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