MH Weather

unlisted

by Matheus Heidemann

Weather widget, note embed, and dedicated forecast view for Obsidian. Requires the MH-API-TEMPORARY plugin.

Updated 1mo ago
View on GitHub

MH Weather

Summary

MH Weather is an Obsidian plugin that displays current weather, forecast graphs, daily forecast cards, and city shortcuts inside notes or in a dedicated weather view.

It uses the Open-Meteo API, does not require a weather API key, and requires the MH-API-TEMPORARY plugin for shared UI components such as modals, item lists, settings groups, and the header builder.

Purpose And Features

  • Dedicated weather tab with current conditions, graph tabs, daily cards, city switching, refresh, and time selection.
  • mh-weather code block embeds for notes.
  • Multiple saved cities with display names, coordinates, favorite/default city, editing, deleting, and reorder support.
  • Current weather stats for weather condition, temperature, feels like, humidity, precipitation, wind, pressure, UV, sunrise, and sunset.
  • Graph tabs for weather timeline, temperature, feels like, precipitation, humidity, wind, pressure, UV, and combined All view.
  • Daily forecast cards with configurable visible stats and ordering.
  • Custom colors for temperature, precipitation, humidity, wind, pressure, and UV.
  • Configurable units, wind unit, refresh interval, language, date/time display, tooltip behavior, graph padding, and header columns.
  • Insert weather as text with a configurable template.
  • Locales for English US and Portuguese Brazil.

How It Works / How To Use

Open the weather view from the cloud-sun ribbon icon or from the command palette command Open weather window. Add or manage cities from the weather view or from the plugin settings.

Embed a weather widget in a note with a fenced code block:

```mh-weather
city: Sao Paulo
showGraph: true
showDaily: true
showCurrent: true
forecastDays: 5
```

The plugin does not read note frontmatter. Per-note customization is done through mh-weather code block options.

Supported code block options:

OptionValuesDescription
citycity nameTemporarily uses a city for this widget, for example Tokyo, Japan.
showGraphtrue, falseShows or hides the graph. Default true.
showDailytrue, falseShows or hides daily forecast cards. Default true.
showDailyNavtrue, falseShows daily navigation on mobile compact cards. Default true.
showCurrenttrue, falseShows or hides current weather stats. Default true.
showHeadertrue, falseShows or hides the header. Default false for embeds.
showTabstrue, falseShows or hides graph tabs. Default true.
showCitiestrue, falseShows or hides city shortcut cards. Default false for embeds.
forecastDays2 to 7Overrides the global forecast day count for this widget.
availableTabscomma listFilters tabs: weather, temperature, feelsLike, precipitation, humidity, wind, pressure, uv, all.
availableStatscomma listFilters current stats: weather, temperature, feelsLike, humidity, precipitation, wind, pressure, uv, sunrise, sunset.
availableDailyStatscomma listFilters daily stats: precipitation, humidity, wind, uv, pressure, sunrise, sunset.
availableAllSeriescomma listFilters combined graph series: temperature, feelsLike, precipitation, humidity, wind, pressure, uv.
defaultTabtab keySelects the initial graph tab. Default temperature.
allWeatherBgOpacity0 to 1Overrides weather background opacity in the All graph.
allWeatherBgEmojitrue, falseShows or hides weather emojis in the All graph background.
allWeatherBgEmojiOpacity0 to 1Overrides weather emoji opacity in the All graph background.

Practical examples:

```mh-weather
city: Tokyo, Japan
forecastDays: 3
availableTabs: temperature,precipitation
defaultTab: temperature
```
```mh-weather
showGraph: false
showDaily: false
availableStats: weather,temperature,humidity,wind
```

The Insert weather as text command uses the configured template. Available template variables are {city}, {temp}, {feelsLike}, {humidity}, {wind}, {pressure}, {uv}, {uvLevel}, {sunrise}, {sunset}, {weather}, {icon}, {maxTemp}, {minTemp}, {date}, and {time}.

Settings are grouped into General, Appearance, Colors, Graph Padding, Header Stats, Graph Tabs, Daily Card Stats, Insert Template, and Cities. Header stats, graph tabs, and daily card stats can be reordered and toggled.

Installation

Install and enable the MH-API-TEMPORARY plugin first.

For a manual Obsidian installation, copy these release files into:

<vault>/.obsidian/plugins/mh-weather/

Required files:

  • main.js
  • manifest.json
  • versions.json
  • locales/en-us.json
  • locales/pt-br.json

This plugin does not require styles.css; runtime styles are injected by TypeScript and the main UI uses Obsidian-compatible inline styles.

Development

Use Node.js 18 or newer.

Install dependencies:

npm install

Run a development build watcher:

npm run dev

Run TypeScript checks:

npm run typecheck

Create a production bundle:

npm run build

Validate the generated bundle:

node --check main.js

Source code lives in src/. The build entrypoint is src/main.ts, and main.js is a generated bundle kept in the repository because Obsidian needs it for installation.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.