
OpenWeather is a weather data provider offering global weather information through a REST API. The TapHome template connects to the free OpenWeather API v2.5 via HTTPS and reads current weather conditions, a 3-hour forecast and a 24-hour forecast for a configured location.
The template makes two API calls every 5 minutes — one for current weather and one for the 5-day/3-hour forecast. It provides 18 read-only devices covering air temperature, feels-like temperature, humidity, atmospheric pressure, visibility, wind speed and weather conditions. All temperatures are in Celsius (metric units) and no paid subscription is required.
Configuration
Obtaining the API key
- Register a free account at openweathermap.org — no credit card required
- After registration, the API key (APPID) is sent via confirmation email
- The key is also available on the account page under the API key tab
- New keys activate automatically, typically within 10 minutes to 2 hours
The free tier allows 60 calls per minute and 1,000,000 calls per month. The TapHome template makes approximately 576 calls per day (2 calls every 5 minutes), which is well within the free limits.
Import parameters
When importing the template in TapHome, three parameters are required:
| Parameter | Description | Example |
|---|---|---|
latitude | Location latitude in decimal degrees | 48.1778 |
longitude | Location longitude in decimal degrees | 17.1426 |
appid | OpenWeather API key from account dashboard | a1b2c3d4e5f6... |
To find the coordinates for a location, right-click on Google Maps and select the coordinates from the context menu.
API endpoints
The module connects to api.openweathermap.org over HTTPS (port 443) and calls two endpoints per poll cycle:
| |
The first request returns current weather conditions. The second returns a forecast list where list[0] is the next 3-hour slot and list[8] is the +24-hour slot (8 x 3h = 24h).
Device capabilities
The template exposes 18 read-only devices organized into three groups: current weather (6 devices), 3-hour forecast (6 devices) and 24-hour forecast (6 devices). Each group provides the same six measurements.
Temperature and humidity
- Current Air Temperature — current temperature in Celsius with humidity as a secondary value (API returns 0–100%, converted to 0–1 ratio for TapHome)
- Current Feels Like Temperature — apparent temperature accounting for wind chill and humidity. The humidity capability is disabled (returns NaN) — only the temperature value is used
- Forecast (+3h) Air Temperature — temperature and humidity for the next 3-hour forecast slot. Includes a Forecast Date service attribute showing the timestamp of the data point
- Forecast (+3h) Feels Like Temperature — apparent temperature for the next 3-hour slot
- Forecast (+24h) Air Temperature — temperature and humidity for the +24h forecast slot. Includes a Forecast Date service attribute
- Forecast (+24h) Feels Like Temperature — apparent temperature for the +24h slot
Atmospheric pressure and visibility
- Current Air Pressure — atmospheric pressure in hPa
- Current Visibility — visibility distance in meters (maximum 10,000 m)
- Forecast (+3h) Air Pressure — atmospheric pressure for the next 3-hour slot
- Forecast (+3h) Visibility — visibility for the 3-hour forecast
- Forecast (+24h) Air Pressure — atmospheric pressure for the +24h slot
- Forecast (+24h) Visibility — visibility for the 24-hour forecast
The Forecast (+3h) Visibility and Forecast (+24h) Visibility devices have their data indices swapped in the current template version. The +3h device reads from list[8] (the 24h position) and the +24h device reads from list[0] (the 3h position). The values are reversed until this is corrected in a future template update.
Wind speed
- Current Wind Speed — wind speed in m/s
- Forecast (+3h) Wind Speed — wind speed for the next 3-hour slot
- Forecast (+24h) Wind Speed — wind speed for the +24h slot
Weather conditions
Three multi-value switch devices display the weather condition category:
- Current Weather — current weather condition
- Forecast (+3h) Weather — weather condition for the next 3-hour slot
- Forecast (+24h) Weather — weather condition for the +24h slot
Each weather device maps the API weather[0].main field to one of 7 categories:
| Switch Value | Label | API weather groups |
|---|---|---|
| 0 | Clear | Clear |
| 1 | Clouds | Clouds |
| 2 | Rain | Rain |
| 3 | Drizzle | Drizzle |
| 4 | Thunderstorm | Thunderstorm |
| 5 | Snow | Snow |
| 6 | Atmosphere | Mist, Smoke, Haze, Dust, Fog, Sand, Ash, Squall, Tornado |
If the API returns an unrecognized weather group, the switch defaults to 0 (Clear). Switch values 7, 8 and 9 are defined in the template configuration but have no mapping in the script logic — they are unused placeholders.
Additional capabilities
The OpenWeather API also provides wind direction, wind gusts, cloudiness percentage, rain and snow volume (1h), and sunrise/sunset times. Humidity is only exposed as a secondary value on temperature sensors, not as a standalone device. These can be added in a future template update.
Troubleshooting
All devices show NaN or no data
- Verify that the TapHome Core has internet access — the template requires outbound HTTPS connectivity to
api.openweathermap.org - Check that the API key is valid — open
https://api.openweathermap.org/data/2.5/weather?lat=48.18&lon=17.14&appid=YOUR_KEY&units=metricin a browser to test - New API keys may take up to 2 hours to activate after registration
- Confirm the latitude and longitude values are correct decimal coordinates (not degrees/minutes/seconds)
Forecast data seems incorrect
The forecast API returns data in 3-hour intervals. The +3h devices read the first forecast slot (list[0]), which is the next available 3-hour block — not exactly 3 hours from now. Similarly, the +24h devices read list[8] (the 9th slot), which represents approximately 24 hours ahead.
Note the visibility index swap described in the warning above — if the +3h and +24h visibility values seem exchanged, this is the known template bug.
Device name typo
Device #17 in the template is named “Forecast (+24h)Weather” (missing space before “Weather”). This is a cosmetic issue in the template XML and does not affect functionality. The device is displayed correctly in the TapHome device table using its enriched name.
