• 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.

New Default Weather Module: Hourly Forecast

Scheduled Pinned Locked Moved Requests
6 Posts 4 Posters 1.3k Views 4 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.
  • M Offline
    MagicJake
    last edited by Aug 11, 2020, 2:13 PM

    Greetings.

    In the latest MagicMirror update, the new default weather module was added, which is designed such that it can work for multiple different API providers.

    In this new module, there is pre-coded support for the Met Office’s Data Hub, a service which for me, living in the UK, is a better service than other providers such as OpenWeather.

    The module can offer two modes: Daily Forecast and Current Weather.
    I’m wondering whether anyone would be able to create a third mode: Hourly Forecast.

    The Met Office Data Hub API offers free global hourly spot data, so I hope I’m not just requesting it for myself, but instead this would be available and useful to anyone.

    The “Current Weather” mode already uses the hourly forecast to receive its data.
    I believe there is some relatively straightforward way to combine the requests of the hourly forecast for the current weather in the format of the “daily forecast”.

    I get the feeling this wouldn’t be too difficult for someone with their head screwed on who knows what they’re doing.

    Many thanks and kind regards,

    MagicJake

    1 Reply Last reply Reply Quote 0
    • R Offline
      robertybob
      last edited by Aug 11, 2020, 10:34 PM

      @MagicJake I can’t help with your issue, however I wondered how you managed to get the Met Office data working? I’ve not ever managed to get it to work - and I’m desperate to as every other weeather module’s data provider seems to be majorly inaccurate when it comes to the great British weather (forecasting)

      1 Reply Last reply Reply Quote 0
      • M Offline
        MagicJake
        last edited by Aug 12, 2020, 10:21 AM

        @robertybob No worries, I’ll lay out the steps clear as I can here:

        This is for the newly created default module “Weather”, created in the MM update v2.12, so make sure it’s updated to that to get it.

        The first thing to note is that the Met Office offers two API services: “Data Point” and “Data Hub”.
        Data Hub is the better option which they say will take over the other one at some point - so I’d highly suggest using that over Data Point.

        Just scroll down a bit on this page to get Data Hub:
        https://www.metoffice.gov.uk/services/data

        Register an account, and log in - might need to verify email.

        Once logged in, you’ll need to register an application - this will be the magic mirror. Click on your email in the top right and go to “My Applications”. Register an application, give it the name you want, accept the terms and continue.

        IMPORTANT: The next page will give you the “client secret”, click to show it and copy it down somewhere onto a notepad document and save it - you will need it later. You will no longer be able to see the client secret unless you reset it!

        Scroll down and it will show your new application, make sure you copy the “Client ID” as well to go with the Client Secret.

        On the top bar, go to API Usage Plans, scroll down and select “Global spot data bundle (1.1.1)”.
        This takes you to a page with the plans on - you want the free one, so click subscribe and match it with the application you have just created.

        You also need the latitude and longitude of the place you want - a quick google can bring it up.
        For example Lat and Lon of London is (51.509865, -0.118092)

        Now you have all the information, you can input it into your config file.
        IMPORTANT: It wasn’t stated in the documentation, but the value for “weatherProvider” is “ukmetofficedatahub”.

        Here’s what’s in my config file if that will help too:

                       {
        			module: "weather",
        			position: "top_left",
        			config: {
        				weatherProvider: "ukmetofficedatahub",
        				type: "forecast",
        				apiBase: "https://api-metoffice.apiconnect.ibmcloud.com/metoffice/production/v0/forecasts/point/",
        				lat: "51.509865",
        				lon: "-0.118092",
        				apiKey: "YOUR CLIENT ID",
        				apiSecret: "YOUR CLIENT SECRET",
        				showPrecipitationAmount: true,
        				fade: false,
        			}
        		},
        

        Hope that helps, if there’s anything else, DM me, and I’ll see what I can do!

        R 1 Reply Last reply Aug 12, 2020, 7:57 PM Reply Quote 1
        • R Offline
          robertybob @MagicJake
          last edited by Aug 12, 2020, 7:57 PM

          @MagicJake wow thank you for such a thorough reply, I’ll give a try and report back !

          1 Reply Last reply Reply Quote 0
          • A Offline
            ardmhacha24
            last edited by Aug 22, 2020, 11:23 PM

            @MagicJake said in New Default Weather Module: Hourly Forecast:

            module: “weather”,
            position: “top_left”,
            config: {
            weatherProvider: “ukmetofficedatahub”,
            type: “forecast”,
            apiBase: “https://api-metoffice.apiconnect.ibmcloud.com/metoffice/production/v0/forecasts/point/”,
            lat: “51.509865”,
            lon: “-0.118092”,
            apiKey: “YOUR CLIENT ID”,
            apiSecret: “YOUR CLIENT SECRET”,
            showPrecipitationAmount: true,
            fade: false,
            }

            Thanks for this - so so helpful…

            1 Reply Last reply Reply Quote 0
            • C Offline
              cowboysdude Module Developer
              last edited by Aug 23, 2020, 12:05 AM

              The best way to do that is to open the default weather and grab the url and follow it. IF that data is available then it wouldn’t be that hard to do…

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