Scootercam Current Conditions

A WordPress plugin that provides individual shortcodes for displaying real-time weather data from your Scootercam weather station. Each weather metric has its own shortcode for maximum flexibility in page design.

Features

  • 🌡️ Temperature – Current temperature with customizable units
  • 💧 Humidity – Relative humidity percentage
  • 🧭 Wind Direction – Cardinal direction (N, NE, E, SE, etc.)
  • 💨 Wind Speed – Current wind speed in mph
  • 🔽 Barometric Pressure – Pressure reading with trend
  • 📊 Pressure Trend – Rising, Falling, or Steady
  • 🌫️ Air Quality – AQI value and description
  • ☀️ UV Index – UV index value, description, and safety remarks
  • ⚙️ Customizable UV Remarks – Admin panel for custom safety messages
  • 📱 Flexible Display – Use shortcodes anywhere in posts, pages, or widgets

Installation

1. Create Plugin Directory

cd /home/scootercam/public_html/notes/wp-content/plugins/
mkdir scootercam-conditions

2. Upload Plugin File

Save the plugin file as:

scootercam-conditions/scootercam-conditions.php

3. Set Permissions

chmod 755 scootercam-conditions
chmod 644 scootercam-conditions/scootercam-conditions.php

4. Activate Plugin

  1. Log into WordPress admin
  2. Navigate to Plugins → Installed Plugins
  3. Find “Scootercam Current Conditions”
  4. Click Activate

5. Configure UV Remarks (Optional)

  1. Go to Settings → Current Conditions
  2. Customize UV safety remarks for each level
  3. Click Save UV Remarks

Available Shortcodes

Temperature

[sc-temperature]

Output: 72°F

Attributes:

  • units="true/false" – Show temperature unit (default: true)
  • round="true/false" – Round to whole number (default: true)

Examples:

[sc-temperature]                    → 72°F
[sc-temperature units="false"]      → 72
[sc-temperature round="false"]      → 72.3°F

Humidity

[sc-humidity]

Output: 65%

Attributes:

  • units="true/false" – Show percentage symbol (default: true)
  • round="true/false" – Round to whole number (default: true)

Examples:

[sc-humidity]                       → 65%
[sc-humidity units="false"]         → 65

Wind Direction

[sc-wind-direction]

Output: NW

Converts wind degrees to 16-point cardinal directions:

  • N, NNE, NE, ENE, E, ESE, SE, SSE
  • S, SSW, SW, WSW, W, WNW, NW, NNW

Wind Speed

[sc-wind-speed]

Output: 12 mph

Attributes:

  • units="true/false" – Show mph unit (default: true)

Examples:

[sc-wind-speed]                     → 12 mph
[sc-wind-speed units="false"]       → 12

Barometric Pressure

[sc-pressure]

Output: 29.92 inHg

Attributes:

  • units="true/false" – Show inHg unit (default: true)

Examples:

[sc-pressure]                       → 29.92 inHg
[sc-pressure units="false"]         → 29.92

Pressure Trend

[sc-pressure-trend]

Output: Rising | Falling | Steady

Automatically determines trend based on pressure change rate:

  • Rising: Change > +0.05 inHg/hr
  • Falling: Change < -0.05 inHg/hr
  • Steady: Between -0.05 and +0.05 inHg/hr

Air Quality Index

[sc-air-quality]

Output: 45

Returns the numeric AQI value.

Air Quality Description

[sc-air-quality-desc]

Output: Good | Moderate | Unhealthy for Sensitive Groups | Unhealthy | Very Unhealthy | Hazardous

AQI Scale:

  • 0-50: Good
  • 51-100: Moderate
  • 101-150: Unhealthy for Sensitive Groups
  • 151-200: Unhealthy
  • 201-300: Very Unhealthy
  • 301+: Hazardous

UV Index

[sc-uv-index]

Output: 6.5

Returns the numeric UV index value (0-11+).

UV Index Description

[sc-uv-desc]

Output: Low | Moderate | High | Very High | Extreme

UV Scale:

  • 0-2: Low
  • 3-5: Moderate
  • 6-7: High
  • 8-10: Very High
  • 11+: Extreme

UV Index Remarks

[sc-uv-remarks]

Output: Displays customizable safety message based on current UV level

Returns appropriate safety advice based on UV index. Remarks are customizable in Settings → Current Conditions.

Default Remarks:

  • Low (0-2): “No protection required. You can safely stay outside.”
  • Moderate (3-5): “Seek shade during midday hours. Slip on a shirt, slop on sunscreen and slap on hat.”
  • High (6-7): “Protection required. Seek shade during midday hours, cover up, wear a hat and sunglasses, and apply sunscreen.”
  • Very High (8-10): “Extra protection required. Avoid being outside during midday hours. Shirt, sunscreen and hat are essential.”
  • Extreme (11+): “Stay inside during midday hours. If you must go out, seek shade and wear protective clothing, hat, sunglasses and sunscreen.”

Usage Examples

Simple Weather Display

Current Temperature: [sc-temperature]
Humidity: [sc-humidity]

Complete Weather Summary

🌡️ Temperature: [sc-temperature]
💧 Humidity: [sc-humidity]
💨 Wind: [sc-wind-speed] from the [sc-wind-direction]
🔽 Pressure: [sc-pressure] and [sc-pressure-trend]

UV Index Report

☀️ UV Index: [sc-uv-index] - [sc-uv-desc]

Air Quality Status

🌫️ Air Quality: [sc-air-quality] ([sc-air-quality-desc])

Complete Conditions Panel

<div class="weather-conditions">
    <h3>Current Conditions</h3>
    
    <div class="condition-row">
        <strong>Temperature:</strong> [sc-temperature]
    </div>
    
    <div class="condition-row">
        <strong>Humidity:</strong> [sc-humidity]
    </div>
    
    <div class="condition-row">
        <strong>Wind:</strong> [sc-wind-speed] from the [sc-wind-direction]
    </div>
    
    <div class="condition-row">
        <strong>Pressure:</strong> [sc-pressure] and [sc-pressure-trend]
    </div>
    
    <div class="condition-row">
        <strong>UV Index:</strong> [sc-uv-index] ([sc-uv-desc])
    </div>
    
    <div class="uv-remarks">

</div> <div class=”condition-row”> <strong>Air Quality:</strong>N/A –N/A </div> </div>

Using Without Units

Temperature is [sc-temperature units="false"] degrees
Wind speed: [sc-wind-speed units="false"] mph

Data Source

The plugin reads weather data from:

/home/scootercam/public_html/wx/summary.json

Expected JSON Structure

{
  "local": {
    "beach": {
      "temp_f": 72.5,
      "humidity": 65,
      "wind_dir": 315,
      "wind_mph": 12.3,
      "pressure_in": 29.92,
      "pressure_trend": 0.08,
      "uv_index": 6.5
    }
  },
  "air_quality": {
    "aqi": 45
  }
}

Admin Settings

Access Settings Page

Navigate to Settings → Current Conditions in WordPress admin.

Features

  • UV Remarks Editor: Customize safety messages for each UV level
  • Live Shortcode Examples: See current weather data in real-time
  • Shortcode Reference: Complete documentation with examples
  • Usage Guide: Quick copy-paste examples

Customizing UV Remarks

  1. Go to Settings → Current Conditions
  2. Find the “UV Index Remarks” section
  3. Edit remarks for each level:
    • Low (0-2)
    • Moderate (3-5)
    • High (6-7)
    • Very High (8-10)
    • Extreme (11+)
  4. Click Save UV Remarks

Remarks support plain text and basic HTML.

Troubleshooting

Shortcodes Show “N/A”

Cause: Weather data file not found or missing data points

Solutions:

  1. Verify file exists: /home/scootercam/public_html/wx/summary.json
  2. Check file permissions (should be readable)
  3. Verify JSON structure matches expected format
  4. Check that specific data point exists in JSON

Air Quality Shows “N/A”

Air quality data is optional. If not available in your weather station data, this is normal. The shortcode will display “N/A” when data is unavailable.

Wind Direction Shows Wrong Values

Ensure wind_dir in JSON is in degrees (0-360) format. The plugin automatically converts to cardinal directions.

Pressure Trend Not Updating

Verify pressure_trend value exists in JSON and represents the rate of change in inHg per hour.

Technical Details

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • Read access to weather data file

File Structure

scootercam-conditions/
└── scootercam-conditions.php    # Main plugin file

Performance

  • Weather data is cached per page load
  • Single file read per request
  • Minimal database queries
  • No external API calls

Browser Compatibility

  • All modern browsers supported
  • No JavaScript required
  • Pure server-side rendering

Styling Shortcodes

Shortcodes output plain text by default. Add custom CSS to style them:

/* Example styling */
.weather-temperature {
    font-size: 2em;
    color: #ff6b6b;
    font-weight: bold;
}

.uv-remarks {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 10px 0;
}

.air-quality-good {
    color: #28a745;
}

.air-quality-unhealthy {
    color: #dc3545;
}

Integration with Other Plugins

Elementor

Shortcodes work in Elementor text widgets, shortcode widgets, and dynamic content.

Gutenberg

Use the Shortcode block to add weather data to block editor pages.

Page Builders

Compatible with all major page builders that support WordPress shortcodes.

Changelog

Version 1.0.0

  • Initial release
  • 11 weather shortcodes
  • Temperature, humidity, wind, pressure
  • Air quality index support
  • UV index with customizable remarks
  • Admin settings page
  • Real-time data from summary.json

Future Enhancements

Potential features for future versions:

  • Historical data trends
  • Weather alerts integration
  • Forecast data shortcodes
  • Multiple location support
  • Data caching options
  • Widget support
  • REST API endpoints
  • Graph/chart generation

Support

For issues or questions:

  1. Check weather data file exists and is readable
  2. Verify JSON format matches expected structure
  3. Test shortcodes in admin settings page
  4. Check WordPress error logs for PHP errors

Enable WordPress debugging:

// Add to wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Credits

Plugin Name: Scootercam Current Conditions
Version: 1.0.0
Author: Scootercam
License: GPL v2 or later

License

This plugin is licensed under GPL v2 or later.


Made with ⛅ for real-time Lake Michigan weather monitoring