Skip to content

About

Yandex Weather module for MagicMirror2

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MMM-YandexWeather

A MagicMirrorÂē module for displaying weather information from Yandex Weather API v3.

PR Checks License: MIT

Features

  • ðŸŒĄïļ Current weather — temperature, "feels like", wind speed/direction
  • 📅 Daily forecast — up to N days with min/max temperatures and icons
  • ⏰ Hourly forecast — configurable number of hours (disabled by default)
  • ðŸŽĻ Customizable display — colored icons, fade effects, table size
  • 🌍 Multi-language — Russian and English
  • 🔒 Rate limit protection — built-in 30 req/day counter for free tier

Note: Humidity is not available in the Yandex Weather free tier and is not displayed.

Screenshot

Example of MMM-YandexWeather

Prerequisites

  • MagicMirrorÂē version 2.1.0 or higher
  • Yandex Weather API key (free tier supports up to 30 requests/day)

Getting a Yandex Weather API Key

  1. Go to Yandex Weather API Console
  2. Sign in with your Yandex account (or create one)
  3. Subscribe to the API service and choose a plan (free "Test" plan is available)
  4. Generate and copy your API key

Installation

cd ~/MagicMirror/modules
git clone https://github.com/isemenov/MMM-YandexWeather
cd MMM-YandexWeather
npm install --production

Update

cd ~/MagicMirror/modules/MMM-YandexWeather
git pull
npm install --production

Configuration

Add to the modules array in config/config.js:

Minimal Configuration

{
    module: 'MMM-YandexWeather',
    position: 'top_right',
    config: {
        apiKey: 'YOUR_YANDEX_WEATHER_API_KEY',
        lat: 55.75396,    // Your location latitude
        lon: 37.620393    // Your location longitude
    }
}

Full Configuration

{
    module: 'MMM-YandexWeather',
    position: 'top_right',
    config: {
        // Required
        apiKey: 'YOUR_YANDEX_WEATHER_API_KEY',

        // Location
        lat: 55.75396,                    // Latitude (Moscow by default)
        lon: 37.620393,                   // Longitude (Moscow by default)

        // Update interval — default 3600000 (60 min) = 24 req/day for free tier
        updateInterval: 3600000,          // 60 minutes
        animationSpeed: 1000,             // Animation speed in ms
        lang: 'ru',                       // Language: 'ru' or 'en'

        // Forecast
        showForecast: true,               // Show daily forecast
        maxNumberOfDays: 7,               // Number of forecast days
        showHourlyForecast: false,        // Show hourly forecast
        maxHourlyForecastEntries: 12,     // Number of hourly entries

        // Display
        showFeelsLike: true,              // Show "feels like" temperature
        showWind: true,                   // Show wind speed and direction
        showDescription: true,            // Show weather condition text
        roundTemp: true,                  // Round temperatures to integers
        colored: false,                   // Colored weather icons
        fade: true,                       // Fade out forecast items
        fadePoint: 0.25,                  // Where fading starts (0–1)
        tableClass: 'small'               // Icon/text size: xsmall, small, medium, large, xlarge
    }
}

Configuration Options

Option Type Default Description
apiKey string Required Yandex Weather API key
lat number 55.75396 Location latitude
lon number 37.620393 Location longitude
updateInterval number 3600000 Update interval in ms (60 minutes — see Rate Limits)
animationSpeed number 1000 DOM update animation speed in ms
lang string 'ru' Display language: 'ru' or 'en'
showForecast boolean true Show daily forecast section
maxNumberOfDays number 7 Number of forecast days to display
showHourlyForecast boolean false Show hourly forecast section
maxHourlyForecastEntries number 12 Number of hourly entries to display
showFeelsLike boolean true Show "feels like" temperature
showWind boolean true Show wind speed and direction
showDescription boolean true Show weather condition description
roundTemp boolean true Round temperatures to integers
colored boolean false Colored weather icons
fade boolean true Fade out forecast/hourly items
fadePoint number 0.25 Point where fading begins (0–1)
tableClass string 'small' Size class: xsmall, small, medium, large, xlarge

API Rate Limits

The Yandex Weather free tier allows 30 requests per day. The module enforces this limit automatically:

  • Daily limit: 30 requests (1 request per update — all data in one query)
  • Default interval: 60 minutes → 24 requests/day ✅
  • Rate counter: stored in .api_rate_limit.json, resets at midnight
  • On limit reached: module shows an error until midnight

All data (current weather, daily forecast, hourly forecast) is fetched in a single GraphQL request regardless of which sections are displayed.

Requests per day by interval

Interval ms Requests/day
48 min 2880000 30 ✅ minimum
60 min 3600000 24 ✅ ← default
120 min 7200000 12 ✅

Finding Your Coordinates

  1. Open Google Maps, right-click your location → copy coordinates
  2. Or use latlong.net

First number = lat, second = lon.

Troubleshooting

"API key is missing"

  • Check that apiKey is set in your config
  • Verify the key is active in Yandex API Console

"Daily API limit reached"

  • The free tier limit of 30 requests/day has been exhausted
  • Module will resume automatically at midnight
  • Increase updateInterval to prevent this in future

Error or no data shown

  • Verify API key and internet connection
  • Check browser console (F12) for errors
  • Check MagicMirror logs for backend errors

Icons show N/A

  • This was a known issue with condition names — fixed in v1.0.0
  • Ensure you're on the latest version (git pull)

Weather data not updating

  • Check updateInterval setting
  • Verify the rate limit hasn't been reached (check .api_rate_limit.json)

Development

Quality Checks

./check.sh           # Run all checks
./check.sh --fix     # Run checks and auto-fix issues
./check.sh --help    # Show usage

The script performs: linting, security audit, outdated dependencies, JSON validation, file checks, code issues detection, and git status.

Available npm Scripts

npm run lint          # ESLint check
npm run lint:fix      # Auto-fix ESLint issues
npm run check         # Run all quality checks
npm run audit         # Security audit only

CI/CD

GitHub Actions workflows run automatically:

  • On every PR — linting, audit, structure check across Node.js 18/20/22
  • On version tag (v*.*.*) — quality checks + GitHub Release with archive
  • Weekly (Monday) — dependency check; creates issue if vulnerabilities found

See .github/workflows/ for details.

Branding

Per Yandex Weather API terms: if weather data is publicly displayed, you may be required to show a "Powered by Yandex.Weather" notice. Check the official documentation for current requirements.

Credits

License

MIT — see LICENSE.md.

Changelog

See CHANGELOG.md.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Run ./check.sh to ensure code quality
  4. Commit your changes (git commit -m 'Add AmazingFeature')
  5. Push to the branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request — CI checks will run automatically

Support

About

Yandex Weather module for MagicMirror2

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages