Scootercam Current Conditions Plugin

A comprehensive WordPress plugin for displaying current weather conditions with temperature, humidity, wind, pressure, UV index, air quality, moon phase, and more.

Features

  • Three Display Modes – Dashboard, Compact, and Detailed layouts
  • Comprehensive Data – Temperature, humidity, wind, pressure, UV, AQI, visibility, dew point, feels like
  • Atmospheric Trends – Pressure trend indicator (rising/falling/steady)
  • Astronomical Data – Sunrise, sunset, moon phase with illumination percentage
  • W3.CSS Styling – Clean, responsive design that matches your site
  • Real-time Updates – Data refreshes every 2 minutes from Visual Crossing API
  • Local Integration – Works alongside your existing local weather station data

Requirements

  • WordPress 5.0 or higher
  • PHP 7.0 or higher
  • W3.CSS loaded on your site
  • Enhanced weather parsing script (see Installation)
  • Visual Crossing API access

Installation


Part 1: WordPress Plugin

1. Create plugin directory:

cd /var/www/scootercam.net/wp-content/plugins/
mkdir scootercam-current-conditions
cd scootercam-current-conditions

2. Upload plugin file:

nano scootercam-current-conditions.php

Copy the plugin code, save and exit.

chmod 644 scootercam-current-conditions.php

3. Activate in WordPress:

  • WordPress Admin → Plugins
  • Find “ScooterCam Current Conditions”
  • Click Activate

4. Verify installation:

  • Go to Settings → Current Conditions
  • Should see green “✓ Data file found and valid” message
  • Check the preview at bottom of page

Usage

Three Display Modes

1. Dashboard (Default)

Partially cloudy
55°F
Feels like 55°F
Partially cloudy
Humidity
63%
Dew Point
43°F

Wind
2 mph
SSE (150°)
Pressure
28.97 inHg
↓ Falling
UV Index
1
Low
Visibility
1.9 mi
Cloud cover: 88%

☀️ Sun
Rise: 8:05 AM
Set: 6:52 PM
🌙 Moon
New Moon
100% illuminated
Last updated: 4 hours ago
[scootercam_current]

Full dashboard display with:

  • Large temperature with icon
  • Feels like temperature
  • Humidity and dew point
  • Wind speed and direction
  • Barometric pressure with trend
  • UV index with level
  • Visibility and cloud cover
  • Air quality (if available)
  • Sunrise and sunset times
  • Moon phase and illumination

Options:

Partially cloudy
55°F
Feels like 55°F
Partially cloudy
Humidity
63%
Dew Point
43°F

Wind
2 mph
SSE (150°)
Pressure
28.97 inHg
↓ Falling
UV Index
1
Low
Visibility
1.9 mi
Cloud cover: 88%

☀️ Sun
Rise: 8:05 AM
Set: 6:52 PM
Last updated: 4 hours ago

Partially cloudy
55°F
Feels like 55°F
Partially cloudy
Humidity
63%
Dew Point
43°F

Wind
2 mph
SSE (150°)
Pressure
28.97 inHg
↓ Falling
UV Index
1
Low
Visibility
1.9 mi
Cloud cover: 88%

🌙 Moon
New Moon
100% illuminated
Last updated: 4 hours ago

Partially cloudy
55°F
Feels like 55°F
Partially cloudy
Humidity
63%
Dew Point
43°F

Wind
2 mph
SSE (150°)
Pressure
28.97 inHg
↓ Falling
UV Index
1
Low
Visibility
1.9 mi
Cloud cover: 88%

☀️ Sun
Rise: 8:05 AM
Set: 6:52 PM
🌙 Moon
New Moon
100% illuminated
Last updated: 4 hours ago

[scootercam_current show_moon="false"]  <!-- Hide moon data -->
[scootercam_current show_sun="false"]   <!-- Hide sunrise/sunset -->
[scootercam_current show_aqi="false"]   <!-- Hide air quality -->

2. Compact Display

Partially cloudy 55°F Partially cloudy 💧 63% 💨 2 mph SSE
[scootercam_current_compact]

Single-line display perfect for:

  • Website headers
  • Sidebars
  • Mobile navigation
  • Quick reference

Shows: Icon, temperature, conditions, humidity, wind


3. Detailed Display

🌡️ Temperature

55°F
Feels like:55°F
Dew point:43°F
Humidity:63%

💨 Wind

2 mph
Direction:SSE (150°)
Conditions:Partially cloudy
Cloud cover:88%

🌍 Atmospheric

28.97 inHg
Trend:↓ Falling
Visibility:1.9 mi
UV Index:1 (Low)

☀️ Sun & Moon

Sunrise:8:05 AM
Sunset:6:52 PM
Moon phase:New Moon
Illumination:100%
[scootercam_current_detailed]

Multi-card layout with separate sections:

  • 🌡️ Temperature Card – Current, feels like, dew point, humidity
  • 💨 Wind Card – Speed, direction, conditions, cloud cover
  • 🌍 Atmospheric Card – Pressure with trend, visibility, UV index
  • 🌫️ Air Quality Card – AQI with level description (if available)
  • ☀️ Sun & Moon Card – Sunrise, sunset, moon phase, illumination

Data Structure

Enhanced current.json Format

{
  "lastUpdated": "2025-10-20T12:18:00+00:00",
  
  "temp": 44.3,
  "humidity": 82.1,
  "conditions": "Clear",
  "icon": "clear-day",
  
  "windDir": 40,
  "windSpeed": 0.0,
  "windCompass": "NE",
  
  "pressure": 1015.2,
  "pressureTrend": "rising",
  
  "visibility": 9.9,
  "cloudcover": 4.5,
  "uvindex": 0,
  "aqius": null,
  
  "dewPoint": 39.1,
  "feelsLike": 44.3,
  
  "sunrise": "08:04:19",
  "sunset": "18:54:23",
  
  "moonPhase": 0.58,
  "moonPhaseText": "Waning Gibbous",
  "moonIllumination": 58.2,
  
  "localTime": "2025-10-20 08:18:00",
  "severerisk": 10.0
}

Pressure Trend Calculation

The plugin tracks barometric pressure over time and calculates trends:

  • Rising (↑) – Pressure increased > 0.05 mb in 3 hours
  • Steady (→) – Pressure changed < 0.05 mb in 3 hours
  • Falling (↓) – Pressure decreased > 0.05 mb in 3 hours
  • Unknown (?) – Not enough history yet (< 3 hours)

Pressure history file:

/home/scootercam/public_html/wx/pressure_history.json

Stores 24 hours of pressure readings for trend calculation.


Moon Phase Calculation

Moon phases are calculated astronomically and displayed as:

Phase ValuePhase Name
0.00 – 0.06New Moon
0.06 – 0.19Waxing Crescent
0.19 – 0.31First Quarter
0.31 – 0.44Waxing Gibbous
0.44 – 0.56Full Moon
0.56 – 0.69Waning Gibbous
0.69 – 0.81Last Quarter
0.81 – 0.94Waning Crescent
0.94 – 1.00New Moon

Illumination percentage is also calculated and displayed.


Display Examples

Example 1: Main Weather Page

<h1>Current Conditions</h1>
Partially cloudy
55°F
Feels like 55°F
Partially cloudy
Humidity
63%
Dew Point
43°F

Wind
2 mph
SSE (150°)
Pressure
28.97 inHg
↓ Falling
UV Index
1
Low
Visibility
1.9 mi
Cloud cover: 88%

☀️ Sun
Rise: 8:05 AM
Set: 6:52 PM
🌙 Moon
New Moon
100% illuminated
Last updated: 4 hours ago

<h2>Hourly Forecast</h2>

[scootercam_24hour]

<h2>7-Day Outlook</h2>

Today
Rain, Partially cloudy
57°
44°
100%
Wed
Rain, Overcast
52°
44°
99%
Thu
Rain, Partially cloudy
51°
43°
91%
Fri
Rain, Partially cloudy
52°
42°
53%
Sat
Partially cloudy
56°
39°
17%
Sun
Partially cloudy
58°
43°
23%
Mon
Partially cloudy
60°
45°
32%

Example 2: Homepage Widget

<div class="weather-widget">
Partially cloudy 55°F Partially cloudy 💧 63% 💨 2 mph SSE

</div>

Example 3: Detailed Dashboard

<h1>Weather Dashboard</h1>

🌡️ Temperature

55°F
Feels like:55°F
Dew point:43°F
Humidity:63%

💨 Wind

2 mph
Direction:SSE (150°)
Conditions:Partially cloudy
Cloud cover:88%

🌍 Atmospheric

28.97 inHg
Trend:↓ Falling
Visibility:1.9 mi
UV Index:1 (Low)

☀️ Sun & Moon

Sunrise:8:05 AM
Sunset:6:52 PM
Moon phase:New Moon
Illumination:100%

<h2>Alerts</h2>

[scootercam_alerts]


Styling & Customization

The plugin uses W3.CSS classes. You can override styles in your theme:

/* Larger temperature display */
.scootercam-current .w3-xxxlarge {
    font-size: 60px !important;
}

/* Custom pressure trend colors */
.scootercam-pressure-rising {
    color: #4CAF50 !important;
}

.scootercam-pressure-falling {
    color: #f44336 !important;
}

/* Compact display adjustments */
.scootercam-current-compact {
    background: #f1f1f1 !important;
}

Troubleshooting

“Data file not available”

Check file exists:

ls -lh /home/scootercam/public_html/wx/current.json

Check file permissions:

chmod 644 /home/scootercam/public_html/wx/current.json

Check file contents:

cat /home/scootercam/public_html/wx/current.json | python -m json.tool

Verify parser is running:

crontab -l | grep api-get-viscross

Pressure trend shows “unknown”

This is normal for the first 3 hours after installation. The system needs 3 hours of data to calculate trends.

Check pressure history:

cat /home/scootercam/public_html/wx/pressure_history.json

After 3+ hours, you should see multiple readings and trend will update.


Missing fields in display

Verify enhanced parser is running:

cat /home/scootercam/public_html/wx/current.json | grep -E "dewPoint|feelsLike|moonPhase|pressureTrend"

All four fields should appear. If missing, your parser may not be the enhanced version.


AQI not showing

Visual Crossing often returns null for AQI. This is normal – the field only shows when data is available. The widget automatically hides the AQI section when no data exists.


Data not updating

Check last update time:

stat /home/scootercam/public_html/wx/current.json

Should be within last 2 minutes.

Check cron is running:

sudo systemctl status cron

Check for errors:

tail -50 /var/log/syslog | grep CRON

File Locations

/home/scootercam/
├── php/
│   └── api-get-viscross.php          # Enhanced parser script
└── public_html/
    └── wx/
        ├── current.json               # Enhanced current conditions
        ├── hourly.json                # 24-hour forecast
        ├── daily.json                 # 7-14 day forecast
        ├── alerts.json                # Weather alerts
        ├── pressure_history.json      # For trend calculation
        ├── raw_weather.json           # Visual Crossing raw data
        ├── weather.json               # Combined data
        └── summary.json               # Compact summary

/var/www/scootercam.net/
└── wp-content/
    └── plugins/
        └── scootercam-current-conditions/
            └── scootercam-current-conditions.php

API Integration

Visual Crossing API

The enhanced parser fetches additional fields from Visual Crossing:

  • pressure – Barometric pressure
  • dew – Dew point temperature

API URL includes:

elements=temp,humidity,windspeed,winddir,aqius,precipprob,conditions,icon,
datetime,tempmax,tempmin,preciptype,sunrise,sunset,description,visibility,
uvindex,cloudcover,severerisk,pressure,dew

Local Weather Station

The plugin also integrates with your local weather station data in local.json:

  • Beach sensor (temperature, humidity)
  • Veranda sensor (temperature, humidity)
  • Main station (pressure, wind, rain)

Performance

  • Data file size: ~2KB (current.json)
  • Load time: < 5ms per shortcode
  • Update frequency: Every 2 minutes via cron
  • Cache: Browser caches JSON files
  • Server load: Minimal (< 0.01% CPU)

Compatibility

Tested With

  • WordPress 5.x, 6.x
  • PHP 7.4, 8.0, 8.1, 8.2
  • W3.CSS 4.x
  • All modern browsers

Works With Other Plugins

  • ✅ ScooterCam 7-Day Forecast
  • ✅ ScooterCam 24-Hour Forecast
  • ✅ ScooterCam Weather Snips
  • ✅ ScooterCam Wave Height
  • ✅ ScooterCam Hero Image
  • ✅ ScooterCam Remote Sensors

All plugins share the same data source (Visual Crossing) and stay synchronized.


Admin Panel

Access via Settings → Current Conditions

Features:

  • Live data status indicator
  • Current conditions summary
  • Shortcode usage examples
  • Live previews of all three display modes
  • Troubleshooting tips

Changelog

Version 1.0.0 (2025-10-20)

  • Initial release
  • Three display modes (dashboard, compact, detailed)
  • Enhanced current conditions display
  • Pressure trend calculation
  • Moon phase display
  • Dew point and feels like temperature
  • Wind compass directions
  • UV index with level descriptions
  • Air quality integration
  • Sunrise/sunset times
  • W3.CSS responsive styling

Support

Check Logs

# Parser errors
tail -50 /var/log/syslog | grep php

# WordPress errors
tail -50 /var/www/scootercam.net/wp-content/debug.log

Test Manually

# Run parser
php /home/scootercam/php/api-get-viscross.php

# Check output
cat /home/scootercam/public_html/wx/current.json | python -m json.tool

Verify WordPress

  • Go to Settings → Current Conditions
  • Check status indicator
  • Review previews
  • Test shortcodes on a test page

Related Plugins

  • ScooterCam 7-Day Forecast – Week ahead horizontal widget
  • ScooterCam 24-Hour Forecast – Next 24 hours detailed
  • ScooterCam Weather Snips – Modular current condition snippets
  • ScooterCam Remote Sensors – Raspberry Pi temperature sensors
  • ScooterCam Wave Height – Lake Michigan wave conditions

License

GPL v2 or later


Credits

Developed for: ScooterCam.net
Data Source: Visual Crossing Weather API
Version: 1.0.0
Last Updated: October 20, 2025


Quick Reference

Installation Checklist

  • [ ] Backup original parser
  • [ ] Install enhanced parser
  • [ ] Test parser manually
  • [ ] Verify enhanced current.json
  • [ ] Create plugin directory
  • [ ] Upload plugin file
  • [ ] Activate plugin in WordPress
  • [ ] Check Settings → Current Conditions
  • [ ] Test shortcodes
  • [ ] Wait 3 hours for pressure trend

Essential Commands

# Test parser
php /home/scootercam/php/api-get-viscross.php

# Check data
cat /home/scootercam/public_html/wx/current.json | python -m json.tool

# View pressure history
cat /home/scootercam/public_html/wx/pressure_history.json

# Check cron
crontab -l | grep api-get-viscross

# Monitor updates
watch -n 120 'stat /home/scootercam/public_html/wx/current.json'

Shortcode Quick Reference

[scootercam_current]                           # Full dashboard
[scootercam_current show_moon="false"]         # Dashboard without moon
[scootercam_current_compact]                   # Single line
[scootercam_current_detailed]                  # Multi-card layout