Scootercam Tempest Weather Plugin v4.0
A comprehensive WordPress plugin for displaying weather data from your WeatherFlow Tempest weather station.
📋 Table of Contents
🚀 Installation
- Upload
scootercam-tempest-weather.phpto/wp-content/plugins/scootercam-tempest-weather/ - Activate the plugin through the ‘Plugins’ menu in WordPress
- Go to Settings → Tempest Weather to configure
⚙️ Configuration
Getting Your API Credentials
- Visit tempestwx.com/settings/tokens
- Click “Create Token” to generate your Personal Access Token
- Copy the token
Finding Your Station ID
Your Station ID is in your Tempest dashboard URL:
https://tempestwx.com/station/198109
^^^^^^ This is your Station ID
Finding Your Device ID
IMPORTANT: Your Device ID is NOT the same as your serial number!
- ❌ Serial Number: ST-00194473 (printed on device)
- ✅ Device ID: 461557 (internal API ID)
How to Find Your Device ID:
Method 1 – Use the Diagnostic Tool:
- Download
tempest-test-198109.php(included with plugin) - Upload to your WordPress root directory
- Visit
https://yoursite.com/tempest-test-198109.php - Find your Device ID in the results
Method 2 – API Endpoint: Visit this URL (replace YOUR_STATION_ID and YOUR_TOKEN):
https://swd.weatherflow.com/swd/rest/stations/YOUR_STATION_ID?token=YOUR_TOKEN
Look for the “device_id” field in the JSON response.
WordPress Settings
Settings → Tempest Weather:
- API Token: Your Personal Access Token
- Station ID: Your numeric station ID (e.g., 198109)
- Device ID: Your numeric device ID (e.g., 461557)
- Cache Settings: Configure how long data is cached (see Cache Management)
📊 Available Shortcodes
Display Shortcodes (Cards & Tables)
Current Conditions
[scootercam_tempest_current]
Displays current weather conditions in a classic table format.
[scootercam_tempest_current_card]
Displays current conditions in a modern card layout.
Forecasts
[scootercam_tempest_daily_forecast]
Displays 10-day forecast in table format.
[scootercam_tempest_hourly_forecast]
Displays 24-hour forecast in table format.
Chart Shortcodes
24-Hour Chart
[scootercam_tempest_chart_24hr]
Last 24 Hours (1438 observations)
Attributes:
metrics– Comma-separated list: temp, wind, pressure, humidity, rain (default: temp,wind)height– Chart height in pixels (default: 400)
7-Day Chart
[scootercam_tempest_chart_7day]
Last 7 Days (8 days)
Attributes:
metrics– Available: temp, rain, wind (default: temp,rain,wind)height– Chart height in pixels (default: 400)
Custom Time Range Chart
[scootercam_tempest_chart_custom hours="12" metrics="temp" height="300" title="Last 12 Hours"]
Attributes:
hours– Number of hours to display (default: 24)metrics– Same as 24hr chart (default: temp)height– Chart height in pixels (default: 400)title– Custom chart title (default: blank)
Statistics Shortcodes
Display high/low/max values for a time period with timestamps.
[scootercam_tempest_stats_today]
Today’s statistics (midnight to now in your timezone).
[scootercam_tempest_stats_yesterday]
Yesterday’s statistics.
[scootercam_tempest_stats_week]
This week’s statistics (Monday to now).
[scootercam_tempest_stats_month]
This month’s statistics.
Output includes:
- High/Low Temperature (with time occurred)
- Max Wind Speed (with time)
- Total Rainfall
- High/Low Pressure (with time)
Records Shortcodes
Display all-time or monthly record values with dates.
[scootercam_tempest_records_all]
All-time records (last 90 days of data).
[scootercam_tempest_records_month]
This month’s records.
Output includes:
- Highest/Lowest Temperature (with date)
- Max Wind Speed (with date)
- Max Daily Rainfall (with date)
- Highest/Lowest Pressure (with date)
Individual Data Shortcodes
Display single data points inline with text.
[tempest-temp]
27.9°F
Current temperature (default: Fahrenheit, 1 decimal).
[tempest-humidity]
88%
Current humidity percentage.
[tempest-pressure]
30.27 inHg
Current barometric pressure (units: inhg or mb).
[tempest-wind-speed]
2.7 mph
Current wind speed (units: mph, kph, or mps).
[tempest-wind-gust]
Current wind gust speed.
[tempest-wind-direction]
SSW
Wind direction (format: degrees or cardinal like “NW”).
[tempest-rain-rate]
0.00 in/hr
Current rain rate (units: in or mm).
[tempest-rain-today]
Total rainfall today.
[tempest-uv]
Current UV index.
[tempest-solar]
Current solar radiation (W/m²).
[tempest-lightning]
—
Last lightning strike distance (units: mi or km).
[tempest-feels-like]
27.9°F
Feels-like temperature.
[tempest-dewpoint]
24.8°F
Dew point temperature.
[tempest-data field="field_name"]
Any raw API field value.
Trend Shortcode (NEW!)
Display trend indicators showing whether values are rising, falling, or steady.
[tempest-trend field="temp_f" hours="3" format="icon"]
Attributes:
field– Available: temp_f, temp_c, humidity, pressure, wind, rain (default: temp_f)hours– Time period to compare (default: 3)format– Output format:icon– Just arrow: ↑ ↓ → (default)text– Just text: Rising, Falling, Steadyvalue– Just change amount: +2.5all– Everything: ↑ Rising (+2.5 over 3h)
Examples:
Temperature: [tempest-temp] [tempest-trend field="temp_f" hours="3"]
Output: Temperature: 42.5°F ↑
↓ Falling (-0.5 over 6h)
Output: ↑ Rising (+2.5 over 6h)
Example Usage
<h2>Current Conditions</h2>
Current Conditions
As of 1:43 PM<p>The temperature is currently 27.9°F ↓ with winds at 3 mph mph from the SSW.</p> <h2>Today’s Weather</h2>
Today's Statistics
<h2>Last 24 Hours</h2>
Last 24 Hours (1438 observations)
<h2>10-Day Forecast</h2>
10-Day Forecast
| Day | Conditions | High | Low | Precip | Wind |
|---|---|---|---|---|---|
| Sat, Nov 29 | ❄️ Snow Likely | 34° | 27° | 100% (0") | 0 mph |
| Sun, Nov 30 | ❄️ Snow Likely | 36° | 32° | 90% (0") | 0 mph |
| Mon, Dec 1 | ❄️ Snow Likely | 32° | 28° | 60% (0") | 0 mph |
| Tue, Dec 2 | ❄️ Snow Likely | 30° | 28° | 70% (0") | 0 mph |
| Wed, Dec 3 | ⛅ Partly Cloudy | 28° | 27° | 10% (0") | 0 mph |
| Thu, Dec 4 | 🌨️ Snow Possible | 27° | 23° | 20% (0") | 0 mph |
| Fri, Dec 5 | 🌨️ Snow Possible | 28° | 23° | 30% (0") | 0 mph |
| Sat, Dec 6 | 🌨️ Snow Possible | 30° | 25° | 30% (0") | 0 mph |
| Sun, Dec 7 | 🌨️ Snow Possible | 30° | 27° | 30% (0") | 0 mph |
| Mon, Dec 8 | 🌨️ Snow Possible | 28° | 25° | 30% (0") | 0 mph |
<h2>All-Time Records</h2>
All-Time Records
🎯 Features
Smart Caching
- Configurable cache durations for different data types
- Current conditions: 5 minutes (default)
- Historical data: 15 minutes (default)
- Forecasts: 30 minutes (default)
- Manual cache clearing available
Timezone Aware
- All times display in your WordPress timezone setting
- Statistics periods calculated correctly for your timezone
- No more UTC confusion!
Responsive Design
- Charts automatically resize for mobile
- Grid layouts adapt to screen size
- Touch-friendly interfaces
Auto-Refresh
- Current conditions cards refresh every 5 minutes via JavaScript
- No page reload needed
Debug Mode
- Admins see detailed debug information
- Shows observation counts, time ranges, cache status
- Helps troubleshoot issues
🔧 Cache Management
Cache Durations
Configure in Settings → Tempest Weather:
- Current Conditions Cache: How long to cache live weather data (default: 300 seconds = 5 minutes)
- Historical Data Cache: How long to cache charts/stats (default: 900 seconds = 15 minutes)
- Forecast Cache: How long to cache forecasts (default: 1800 seconds = 30 minutes)
Best Practices
For public websites with moderate traffic:
- Current: 5 minutes (fresh enough for visitors)
- Historical: 15-30 minutes (historical data doesn’t change)
- Forecast: 30 minutes (forecasts update hourly)
For low-traffic sites:
- Can increase all values to reduce API calls
- Historical data can cache for 1+ hours
For real-time monitoring:
- Reduce current conditions to 2-3 minutes
- Keep historical/forecast longer
Manual Cache Clear
Settings → Tempest Weather → Cache Management
Click “Clear All Cached Data” button to immediately clear all cached weather data. Useful when:
- Testing changes
- Data seems stale or incorrect
- After changing API credentials
- Troubleshooting issues
🐛 Troubleshooting
Charts Not Displaying
Symptom: Blank gray area where chart should be
Solutions:
- Check browser console (F12) for JavaScript errors
- Clear WordPress cache
- Hard refresh browser (Ctrl+Shift+R)
- Verify Chart.js is loading (check Network tab in browser dev tools)
Wrong Times Displayed
Symptom: Times are off by several hours
Solution:
- Go to Settings → General → Timezone
- Set to your city or manual UTC offset
- Clear plugin cache (Settings → Tempest Weather)
- Refresh page
“No Historical Data” Errors
Symptoms: Charts or stats show errors
Solutions:
- Verify your Device ID is correct (not serial number!)
- Use diagnostic tool to confirm:
tempest-test-198109.php - Ensure station has been online for 24+ hours
- Check error log for API errors
API Errors (404, 401, etc.)
Solutions:
- 401 Unauthorized: API token is invalid or expired
- Generate new token at tempestwx.com/settings/tokens
- 404 Not Found: Station ID or Device ID is incorrect
- Use diagnostic tool to verify IDs
- Check error log for specific API URLs and responses
Stats Show Future Times
Symptom: “Low temp at 7:00 PM” but it’s only 11 AM
Solution:
- Clear the plugin cache
- This was a timezone issue fixed in v4.0
- Make sure you’re running v4.0 or later
High and Low Temps Are Same
Symptom: High and low show identical values
Solutions:
- Verify your Device ID is numeric (e.g., 461557, not ST-00194473)
- Check that station has been recording for several hours
- Clear cache to force fresh data
- Check debug info (visible to admins) for observation count
📝 Changelog
v4.0 (November 2025)
- FIXED: Major timezone issue – stats periods now correctly calculated in WordPress timezone
- FIXED: Times showing in UTC instead of local time
- FIXED: “Today” starting at wrong time for non-UTC timezones
- ADDED: Cache clear button in settings
- IMPROVED: Debug output now shows timezone-aware timestamps
v3.9 (November 2025)
- ADDED: Timestamps to statistics displays (high/low temps now show when they occurred)
- ADDED: Times show as “3:15 PM” for today/yesterday, “Nov 15, 3:15 PM” for longer periods
- FIXED: All date formatting now uses WordPress timezone (wp_date function)
- IMPROVED: Better styling for record dates
v3.8 (November 2025)
- ADDED: ↓ shortcode for showing rising/falling indicators
- IMPROVED: Reduced logging – only errors logged, not successful API calls
- IMPROVED: Better stat and record styling with CSS
v3.7 (November 2025)
- ADDED: CSS styling for records and stats displays
- FIXED: Record dates now visible and properly formatted
- IMPROVED: Grid layouts for stats and records
v3.6 (November 2025)
- ADDED: Trend shortcode functionality
- IMPROVED: Documentation in admin panel
v3.5 (November 2025)
- FIXED: Charts rendering – fixed “Canvas exceeds max size” error
- FIXED: Canvas elements properly constrained by height attribute
- IMPROVED: Chart.js loads in header for faster initialization
- ADDED: Better error messages and debugging for charts
v3.4 (November 2025)
- ADDED: Configurable cache durations in settings
- ADDED: Separate cache settings for current/historical/forecast data
- IMPROVED: Better cache strategy
v3.3 (November 2025)
- FIXED: Historical data now works – added time_start and time_end parameters to all API calls
- FIXED: Stats now show actual high/low temps instead of same value
- FIXED: Charts display full time ranges with hundreds of observations
v3.2 (November 2025)
- FIXED: Corrected API endpoint format – now uses /observations/device/{id}
- CLARIFIED: Device ID vs Serial Number in documentation
- IMPROVED: Better error messages and setup instructions
v3.1 (November 2025)
- ADDED: Chart shortcodes (24hr, 7-day, custom)
- ADDED: Statistics shortcodes (today, yesterday, week, month)
- ADDED: Records tracking (all-time, monthly)
- FIXED: API endpoint issues
v3.0 (November 2025)
- ADDED: Modern card-based current conditions display
- IMPROVED: Responsive design
- ADDED: Auto-refresh functionality
v2.x and earlier
- Basic weather data display
- Forecast tables
- Individual data shortcodes
🔗 Resources
- WeatherFlow API Documentation: weatherflow.github.io/Tempest
- Your Tempest Dashboard: tempestwx.com
- API Token Management: tempestwx.com/settings/tokens
- Support: Check WordPress error log for detailed API errors
📄 License
This plugin is provided as-is for use with WeatherFlow Tempest weather stations.
🙏 Credits
Developed for ScooterCam.net weather monitoring system. Uses WeatherFlow Tempest API for data. Charts powered by Chart.js.
Version: 4.0
Last Updated: November 20, 2025
Requires: WordPress 5.0+, PHP 7.4+
Compatible: WeatherFlow Tempest Personal Weather Stations