Skip to main content

Weather

GeoPulse can attach weather samples to timeline stays and trips, then show those conditions on the Timeline map, timeline cards, Journey Insights, and weather-related badges. Weather is a system-wide integration managed by administrators.

Weather is enabled by default for ongoing timeline activity. Historical weather backfill is disabled by default, so existing timeline history is not sent for weather enrichment unless an administrator opts in. Open-Meteo is the default provider. Pirate Weather can be enabled with an API key and selected as the primary provider or as a secondary fallback provider.

Admin Setup​

Open Admin Dashboard > System Settings > Weather. Admin Settings are stored in the database and override environment defaults.

Configure the provider first:

Admin SettingDefaultDescription
Enable WeatherOnMaster switch for weather collection and display data.
Primary ProviderOpen-MeteoProvider used first for new weather targets.
Secondary ProviderNoneOptional fallback provider used when the primary provider cannot return a sample.
Enable Open-MeteoOnKeep Open-Meteo available as a weather provider.
Forecast URLhttps://api.open-meteo.comOpen-Meteo forecast and current-weather API base URL.
Archive URLhttps://archive-api.open-meteo.comOpen-Meteo historical archive API base URL.
Open-Meteo API KeyEmptyOptional API key. Values saved in Admin Settings are encrypted.
Enable Pirate WeatherOffEnables Pirate Weather as a selectable provider. Requires an API key.
Pirate Weather Forecast URLhttps://api.pirateweather.netPirate Weather forecast API base URL.
Pirate Weather Time Machine URLhttps://timemachine.pirateweather.netPirate Weather historical time machine API base URL.
Pirate Weather API KeyEmptyEncrypted Pirate Weather API key.

Use Test Connection to verify the configured forecast and historical endpoints before starting production collection.

note

Open-Meteo public endpoints do not require an API key for normal free usage. Add one only when your Open-Meteo account or deployment requires it.

How Collection Works​

Weather collection has two independent phases:

  1. Discovery checks timeline stays and trips and creates missing weather targets.
  2. The fetch worker claims pending targets and stores samples while respecting quota and provider health.

Targets are deduplicated by user, provider, coordinate bucket, and hour. The default coordinate precision of 2 keeps roughly neighborhood-level buckets and reduces duplicate provider calls.

Timeline rebuilds and imports record affected user ranges after their timeline transaction commits. Historical reconciliation processes those ranges incrementally without loading a complete user timeline into backend memory:

  • Each chunk covers at most 90 days for one user.
  • Each run processes a global maximum number of chunks across all users.
  • A user's pending range remains queued until its complete time range has been checked.
  • Remaining work resumes on later scheduled runs, backend startup, or relevant timeline/settings events.
  • The newest two hours wait before becoming eligible for historical processing.

Stored weather samples remain available until the owning user data is deleted. Target cleanup removes queue records, not stored samples.

Sampling And Backfill​

Admin SettingDefaultDescription
Ongoing WeatherOnCreate targets for each active user's latest stay or trip.
Ongoing Interval60 minutesMinimum interval between ongoing samples. Minimum: 30.
Historical Weather BackfillOffDiscover historical targets from existing timeline stays and trips.
Historical Backfill Chunks per Run4Global maximum of 90-day user-range chunks checked by one reconciliation run. Minimum: 1.
Coordinate Precision2Decimal places used for location buckets. Valid range: 0 to 5.
Retry Failed TargetsOnRetry stale failed targets after their cooldown.
Failed Retry Cooldown24 hoursTime before a failed target can be retried.

Short stays and trips get one sample near the midpoint. Longer timeline items are sampled about every two hours, with caps that keep target creation bounded.

The chunk limit is global, not per user. With the default value, one invocation checks at most four 90-day chunks in total. Increasing it clears a backlog faster but increases CPU, database work, and memory pressure during each run. Admin changes apply to the next reconciliation run without a backend restart.

Quota​

Admin SettingDefaultDescription
Daily Request Limit10000GeoPulse-side provider request cap per UTC day.
Ongoing Reserve500Requests reserved for ongoing samples before backfill can consume quota.

Ongoing targets can use the full remaining daily quota. Historical targets can use only the quota left after the ongoing reserve.

If the daily limit is reached, fetching pauses until shortly after the next UTC day starts. If the provider reports quota or rate-limit exhaustion, GeoPulse pauses calls until the provider retry time or daily reset. Administrators receive in-app notifications when collection is limited and restored.

Status Panel​

The Weather tab refreshes its status automatically.

StatusMeaning
StateDisabled, Not configured, or Enabled.
Requests todayRequests used compared with the configured daily limit.
Samples storedTotal stored weather samples.
Pending targetsTargets waiting to be fetched.
Claimable pendingPending targets currently eligible for a worker.
Fetch statusReason fetching is ready or blocked.
Provider healthCurrent provider circuit status.
In progress targetsTargets currently claimed by a worker.
Completed targetsQueue records that produced a sample.
Skipped targetsQueue records skipped because data existed or was unavailable.
Failed targetsTargets that exhausted retries or hit an unrecoverable error.

Manual Backfill​

Enable Historical Weather Backfill before running automatic or targeted historical discovery. An administrator can queue a specific range with:

POST /api/admin/weather/backfill
Content-Type: application/json

{
"startTime": "2026-01-01T00:00:00Z",
"endTime": "2026-01-31T23:59:59Z"
}

Add userId to limit the request to one user. The response reports targets created, already known, and skipped. Samples are fetched asynchronously under quota and provider-health rules.

Environment Variables​

Environment variables provide first-boot defaults and support immutable deployments. A value saved in Admin Settings takes precedence for settings marked Admin configurable. Changing an environment variable requires a backend restart.

Admin Configurable​

VariableDefaultAdmin Setting
GEOPULSE_WEATHER_ENABLEDtrueEnable Weather
GEOPULSE_WEATHER_PRIMARY_PROVIDEROPEN_METEOPrimary Provider
GEOPULSE_WEATHER_SECONDARY_PROVIDEREmptySecondary Provider
GEOPULSE_WEATHER_OPEN_METEO_ENABLEDtrueEnable Open-Meteo
GEOPULSE_WEATHER_OPEN_METEO_FORECAST_URLhttps://api.open-meteo.comForecast URL
GEOPULSE_WEATHER_OPEN_METEO_ARCHIVE_URLhttps://archive-api.open-meteo.comArchive URL
GEOPULSE_WEATHER_OPEN_METEO_API_KEYEmptyOpen-Meteo API Key
GEOPULSE_WEATHER_PIRATE_ENABLEDfalseEnable Pirate Weather
GEOPULSE_WEATHER_PIRATE_BASE_URLhttps://api.pirateweather.netPirate Weather Forecast URL
GEOPULSE_WEATHER_PIRATE_TIME_MACHINE_URLhttps://timemachine.pirateweather.netPirate Weather Time Machine URL
GEOPULSE_WEATHER_PIRATE_API_KEYEmptyPirate Weather API Key
GEOPULSE_WEATHER_ONGOING_ENABLEDtrueOngoing Weather
GEOPULSE_WEATHER_ONGOING_INTERVAL_MINUTES60Ongoing Interval
GEOPULSE_WEATHER_BACKFILL_ENABLEDfalseHistorical Weather Backfill
GEOPULSE_WEATHER_QUOTA_DAILY_REQUEST_LIMIT10000Daily Request Limit
GEOPULSE_WEATHER_QUOTA_ONGOING_RESERVE500Ongoing Reserve
GEOPULSE_WEATHER_COORDINATE_PRECISION2Coordinate Precision
GEOPULSE_WEATHER_FAILED_TARGET_RETRY_ENABLEDtrueRetry Failed Targets
GEOPULSE_WEATHER_FAILED_TARGET_RETRY_COOLDOWN_HOURS24Failed Retry Cooldown

Runtime Only​

These controls are available only as environment variables and apply after a backend restart.

VariableDefaultDescription
GEOPULSE_WEATHER_OPEN_METEO_CONNECT_TIMEOUT_SECONDS5Provider connection timeout.
GEOPULSE_WEATHER_OPEN_METEO_READ_TIMEOUT_SECONDS15Provider response timeout.
GEOPULSE_WEATHER_TARGET_CLEANUP_JOB_CRON0 30 3 * * ?Queue cleanup schedule.
GEOPULSE_WEATHER_TARGETS_COMPLETED_RETENTION_DAYS7Retention for completed and skipped target records.
GEOPULSE_WEATHER_TARGETS_FAILED_RETENTION_DAYS30Retention for failed target records.
GEOPULSE_WEATHER_TARGETS_IN_PROGRESS_TIMEOUT_MINUTES60Age after which interrupted in-progress targets become retryable.

See the Environment Variables Reference for restrictions and restart behavior.

Operational Tuning​

Use the defaults for small personal instances. Adjust them only for quota pressure, a large backlog, or provider connectivity problems.

GoalSuggested Change
Minimize idle CPU and database loadKeep Historical Backfill Chunks per Run low. Increase the reconciliation interval only if slower backlog processing is acceptable.
Clear a historical backlog fasterIncrease Historical Backfill Chunks per Run gradually while monitoring backend and PostgreSQL CPU.
Reduce provider requestsDisable Historical Weather Backfill, lower Coordinate Precision, or lower Daily Request Limit.
Protect current timeline weatherIncrease Ongoing Reserve.
Slow ongoing collectionIncrease Ongoing Interval.
Recover from transient provider errorsKeep Retry Failed Targets enabled and retain the default cooldown.

Troubleshooting​

SymptomChecks
Weather state is DisabledTurn on Enable Weather and save changes.
Weather state is Not configuredVerify Forecast URL and Archive URL are not empty.
Test Connection failsCheck backend outbound access, URL validity, proxy/firewall rules, and API key requirements.
Requests stop before the daily limitCheck Ongoing Reserve; historical work pauses when only the reserve remains.
Many failed targetsInspect provider health, recent errors, and whether the archive endpoint covers the requested dates.
Historical weather does not appearTurn on Historical Weather Backfill or run a targeted admin backfill.
Backlog drains too slowlyReview Historical Backfill Chunks per Run, the reconciliation interval, quota, and provider health.
CPU spikes during reconciliationLower Historical Backfill Chunks per Run. Each unit permits another 90-day user-range chunk in that run.