Plug & Play Weather

For a few weeks now, users of 13.0 nightlies have stumbled across a ‘Weather’ category in their Settings dashboard, and rightfully wondered what it was (and why it’s empty). We’re now ready to provide some exposition on our newest feature to our mainline code.

Historically, we’ve used Yahoo! Weather and OpenWeatherMap to power the weather in the status bar or with our weather widget. Like most things these have had their pros and cons.

Yahoo! has been our default for some time, but they have made some recent changes to their API and policies, causing many bug reports of weather no longer working. Maintaining API compatibility is usually a trivial maintenence task, but Yahoo! Weather now requests every weather query go through an OAUTH implementation, and since these are traceable, counts against a quota limit 100k requests daily (which our millions of users quickly exceed even via previously anonymous requests) should we have just tried to use one static key. The quota and OAUTH changes make it so Yahoo! Weather no longer ‘just works’ out of the box without user intervention.

Around the same 6 month timeframe that Yahoo! Weather made these changes, we were asked by OpenWeatherMap to start using tokenized calls for our requests – but without a limit at that time – and we obliged. In doing their research, it was no surprise that our userbase quickly exceeded what a normal ‘developer’ account would reasonably use. Their pricing structure is not condusive of our use case, and as such we agreed to move away from our usage pattern of their platform.

This left an unfortuante gap, but also an opportunity. Our install base will exceed any weather provider’s caps for free, open-source or developer tiers if reported as all coming from one entity. However, each individual phone is usually making 12-24 requests a day (on average) and well below personal limits. With that in mind, we’ve built a pluggable model for our weather functionality, and through our platform SDK, one that can be repurposed by other apps or use cases beyond just our own.

As of nightlies April 17th and forward, you can download your own weather provider and have it seamlessly power the features mentioned above. This allows us to not have to worry about API limits and the like, as each user is reported independently. The first such weather provider is on the Play Store now (we are looking into FDroid and APK Mirror deployment for those that prefer that route) – WeatherUnderground CM Weather Provider.

We’d like to emphasize this is the just first of many that will be compatible, and work for a sample OpenWeatherMap app under this new model is already under way. Likewise, developers worldwide have the capability to create and upload their own providers for regions and areas where our sample apps aren’t well suited.

Looking at our first sample, let’s answer a few questions preemptively.

1) Do I have to pay for your apps?
No – our samples are free (and the code is open sourced).

2) WeatherUnderground is saying there is a fee for signup?
The pricing structure of our samples all allow for a free ($0.00) developer account for personal usage. You do not have to pay to use this functionality with the providers we are starting with.

3) The UX (user flow) is clunky!
Unfortunately, as the pain points in the post above describe, we can’t seed an API token into the OS, meaning there is some user setup involved. We’d love to avoid this, and provide one that ‘just works’, but the folks that power these things have a right to establish their own rules for usage.

4) Will I have to pay in the future?
For CyanogenMod uploaded samples, no. However, since this is now a public API for anyone to develop against, it’s up to individual publishers to set their pricing – just like any other app on the store.

5) Where is the source code for these samples?
On our Github of course!

6) I don’t like/trust the information from your WeatherUnderground app, what about other samples?
We’re working through other samples (eg OpenWeatherMap) and other developers can upload their own as well.

7) Why not just bundle these into the OS?
For starters, the UX leaves a lot to be desired, especially since there is no solid out of the box working state with zero user setup. Additionally, more apks equate to larger zip downloads, and since you would only need one provider setup & selected, any others would be a waste of space and bandwidth. Finally, in the event of API breakage or compatibility needs, this gives us an opportunity to fix issues without requiring end users to update their OS version to a newer build.

  • Raj

    I am kidding. The S4 should make the snapshots soon seeing the international variant uses a snapdragon. If its the Exynos then it may involve more waiting.

  • Mohn Jadden

    I think your reply got redacted out. Any chance you could share the apk with me as well?

  • ld

    Are you blocking the access to the download site from Cuba?

  • Piotr Plata

    Weather forecast shows wrong days of the week, eg. forecast for wednesday is in fact forecast for thursday etc. Please fix this.

  • Manuel Fotoschlampe Hornsteine

    Hanving the same issue.. Drop down shows Fahrenheit but I use/choose Metric (Celsius) in cLock widget.. What can I do :(

  • Manuel Fotoschlampe Hornsteine

    Same here

  • Manuel Fotoschlampe Hornsteine

    Any bugfix?

  • Dimmer

    How to install this weather ? In custom recovery : wrong zip file -.-

  • Winston Ma

    Since it is not part of the cLock so I would understand that changing the setting in cLock widget would not affect the Weather Provider setting.

    It would be great if the weather provider (Weather Underground & Yahoo) would have the option to switch to metric system

  • Kulas

    Same issue here.

  • Holger Jacobsen

    In “settings” it shows temperature in Fahrenheit, but when I touch the symbol it opens up a window where everything is metric.

  • Manuel Fotoschlampe Hornsteine

    fix with newest nightly (08/05/2016)

  • Kulas

    Hey Thanks. This indeed fixed it. Though, I lost the Weather details in the desktop widget. It only shows the clock and alarm. Again, thanks!

  • Ricardo De Angelis León

    Has not compatibility with S4 mini (serranoltexx). What that’s supose to mean? I will not have to update the application?

  • VN

    In the UK metoffice beats everyone else in providing accurate forecasts. Can anyone develop an app to incorporate that into the cyanogen mod weather settings?

  • Nika Nikoloza

    CMmod better or CMos ?

  • Hexlattice

    Maybe a totally noob question, but I went through the process of getting the WU weather provider and API key, but I don’t see weather in my status bar/notification shade… So I have to enable this somewhere? Or is that what this this is even meant to do?

  • Guilherme De Sousa

    Congratulations for cm13. I really enjoy it. I have only one suggestion, in the new camera app, please add a grid option, like the previous app had. The grid is extremely useful for taking aligned and perfect photos. Thank you very much for your excellent work.

  • Kulas

    I think this was fixed thru the 20160512 nightly build in my GS5

  • Leonardo Ranaldo Bettarini

    i have have the same problem whit the snapshot of cm 12 for s5.
    the clock show me only the time and the alarm but no the weather

  • Daniele Ser

    I have installed both plugin (Weather underground and Yahoo) but in C-lock widget always see Openweathermap. Somebody have an idea to solve this issue?

  • Kitt3

    Which is the key?

  • Kitt3

    Key?

  • Pavel Santos

    My problem is that the weather disappears when I put the clock widget on the desktop with CyanogenMod 13, leaving only the date and time even when the configuration is correct.

  • jenny

    How do I download apps???? From where my ph has no play store no Google. I’m used to Samsung got my ph back from repair and he said it will be like an LG now. Ugh help please

  • Jessie Brooks

    How did you do that?! I’d like to see the weather on my clock as well! >,< Please??

  • M.C.

    Weather not working in latest snapshot for Nexus 6P. Trying to set it up, slows down the phone even the Yahoo provider is installed. Is this really a snapshot?!

  • Gregory Su

    I cannot get WU to a weather service provider. I have an account with WU, I have an API Key, but only Yahoo shows up in the Weather widget as a Weather Provider, even though WU is installed on my Galaxy S4 with CM 13 SNAPSHOT-ZNH5YAO0J3-jfltetmo. If I click on Add Weather provider, it takes me to the Play Store which shows that both Yahoo CM (from Cyanogenmod) and WU (from WU) are both installed.

  • http://paskal.my Paskal

    Somehow WU doesn’t show up in my Weather setting options. Only Yahoo is available to choose. What should I do?

  • saurav singh

    Google clock preventing me from using cm clock

  • dave

    Just tried downloading, but the play store says the app isn’t available for my country. I’m in the US. Is this right?

  • Dark Lord

    Anybody know any other weather provider

  • Jack Carver

    No its Legen……WAIT FOR IT ….dary