Is the weather outside delightful? Or is it frightful? And what about in the coming days? In this guide we'll show you how to use an Adafruit MagTag to create a weather display for today and future conditions.
Using the MagTag's WiFi capability, we connect to a weather API service and get weather information. We then parse that and display it up in a nice summary.
Deep sleep is also used to only run the update once a day around midnight, so we can run for many weeks on one charge.
Weather API Services
The original code for this guide used the free weather API service provided by OpenWeatherMap. There have been several updates to the code to keep up with API changes. However, OpenWeather now requires credit card information to obtain an API key - even if only using the free API access. As a result, this guide no longer uses the OpenWeatherMap API. The old code is still provided for reference.
The current version of this guide is based on the weather API provided by Open-Meteo. This is a truly free weather API which currently does not even require an API key. It is also open source, with the code available in a GitHub repo. This isn't a 100% drop in replacement in terms of weather forecast information provided. As a result, there are some minor differences relative to the original version.
![Angled shot of Adafruit MagTag development board with ESP32-S2 and E-Ink display.](https://cdn-shop.adafruit.com/640x480/4800-07.jpg)
![Lithium Ion Polymer Battery 3.7v 420mAh with JST 2-PH connector and short cable](https://cdn-shop.adafruit.com/640x480/4236-04.jpg)
![Angled shot of four magnet feet.](https://cdn-shop.adafruit.com/640x480/4631-00.jpg)
OR these items are also available together as a kit:
![MagTag dev board with enclosure pieces, four magnet feet, and lipoly battery](https://cdn-shop.adafruit.com/640x480/4819-02.jpg)
Text editor powered by tinymce.