I made a weather widget using the OpenWeather API.
I was using Weather Line for my weather widget, but I saw that you need a subscription to get a “pure black” theme so I decided to make one myself, and while doing it I noticed that the weather line predictions were inaccurate at my location, so that’s a plus.
Features: it displays the weather in a graph like WeatherLine, It can be tweaked (colors, element positions, how many temps to show)
Documentation is in the script itself, but if you have a problem you can ask me directly.
You will need an OpenWeather API Key, you can get one for free at: https://home.openweathermap.org/api_keys (account needed).
One thing to note, you need to know the size in pixels that widgets have on your screen (at least the medium one, since the small one is an square) I made this on an iPhone SE (2016), so the default config is made to fit this size.
If for some reason there is something broken (I modified the file for the documentation so maybe I deleted or modified where I’m weren’t supposed to (but i don’t think really)), tell me please.
Sorry if the comments have typo’s (English is not my main language).
Thanks for such great app!
PS: I made a calendar widget too (as shown in the images) and I will publish it too, but I need to document that code.
Very nice job!
There’s a little bug in your widget param Elvis operator. You have to escape all ’ " ’ characters in the provided default json (using a backslash), otherwise the script throws an exception.
It may be a good idea to add a boolean for the ability to hide the clock (I just commented out the line), since there’s a clock on every home screen anyway.
Yep, you can cut it off if you want, but it’s not intented to be a clock to show the current time, it shows the last time when the weather got updated. For example if for some reason you have no internet for a few hours, when looking it, at least you know it’s not “the current weather”, in case it starts raining outside without any warning or previous indication.
I wish we could have an AQI number in there too (maybe instead of the last update time)? I don’t think AQI is available through OpenWeatherMap, but can we merge @jsnell’s AQI widget script created here?
I have no doubt that’s possible, but to be honest I don’t have intentions to do it, I like it clean and simple as it is, and using only the OpenWeather API.
In addition to being a different API, it would be a configuration hassle because there’s no way I can find to get a purpleair station ID from lat/long. That said, you could definitely Frankenstein these two projects together if you wanted!
It works I’ve tested before posting, you should also considerer the 24h patch that @bmichotte put on git, it have one line mistake, the correct one is this: