MH Weather
unlistedby Matheus Heidemann
Weather widget, note embed, and dedicated forecast view for Obsidian. Requires the MH-API-TEMPORARY plugin.
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-weathercode 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:
| Option | Values | Description |
|---|---|---|
city | city name | Temporarily uses a city for this widget, for example Tokyo, Japan. |
showGraph | true, false | Shows or hides the graph. Default true. |
showDaily | true, false | Shows or hides daily forecast cards. Default true. |
showDailyNav | true, false | Shows daily navigation on mobile compact cards. Default true. |
showCurrent | true, false | Shows or hides current weather stats. Default true. |
showHeader | true, false | Shows or hides the header. Default false for embeds. |
showTabs | true, false | Shows or hides graph tabs. Default true. |
showCities | true, false | Shows or hides city shortcut cards. Default false for embeds. |
forecastDays | 2 to 7 | Overrides the global forecast day count for this widget. |
availableTabs | comma list | Filters tabs: weather, temperature, feelsLike, precipitation, humidity, wind, pressure, uv, all. |
availableStats | comma list | Filters current stats: weather, temperature, feelsLike, humidity, precipitation, wind, pressure, uv, sunrise, sunset. |
availableDailyStats | comma list | Filters daily stats: precipitation, humidity, wind, uv, pressure, sunrise, sunset. |
availableAllSeries | comma list | Filters combined graph series: temperature, feelsLike, precipitation, humidity, wind, pressure, uv. |
defaultTab | tab key | Selects the initial graph tab. Default temperature. |
allWeatherBgOpacity | 0 to 1 | Overrides weather background opacity in the All graph. |
allWeatherBgEmoji | true, false | Shows or hides weather emojis in the All graph background. |
allWeatherBgEmojiOpacity | 0 to 1 | Overrides 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.jsmanifest.jsonversions.jsonlocales/en-us.jsonlocales/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.