Capture yesterday’s weather to yesterday’s daily note.
I like to use my daily notes not only to capture my thoughts and actions for a day, but to also capture some context of that day. Weather plays a part in this, so I wrote a plugin to ‘archive’ the weather conditions as properties on my daily notes. The weather data comes from Visual Crossing, and is available via their API for free if you sign up for an account. With the weather data in my journal properties, I can just reference a single days weather by viewing that note, or I could use a different plugin to create a report or chart to view the weather over time.
Usage
You configure the plugin with your API key, your location, how to find your daily notes, and a time of day to run, and the plugin grabs yesterday’s weather and either creates a new daily note, or adds it to an existing daily note. If you missed a day, there is a feature to add the date, and immediately fetch the weather for that day and create/modify the appropriate daily note.
The plugin has not yet been submitted for review for the marketplace. Until then, you can install it manually or via BRAT:
Installation
Manual Installation
- Download the
main.js
,manifest.json
, andstyles.css
files from the latest Release on GitHub. - In your Obsidian vault, navigate to
plugins
directory. - Create a new folder named
jots-yesterdays-weather
. - Copy the downloaded
main.js
,manifest.json
, andstyles.css
into this new folder. - Restart Obsidian.
- Go to Settings → Community Plugins, find “Yesterday’s Weather”, and enable it.
Using BRAT (Recommended for pre-release versions)
- Install BRAT (Beta Reviewer’s Auto-update Tester) plugin via the Community Plugins browser.
- Enable BRAT in Obsidian’s settings.
- Go to BRAT’s settings, click “Add Beta plugin”, and enter the URL of the GitHub repository:
https://github.com/jpfieber/jots-yesterdays-weather
- Enable the “Yesterday’s Weather” plugin in Settings → Community Plugins.
Configuration
The main settings are in the Plugin Settings section:
- API Key : Enter your Visual Crossing API Key, which you can get by signing up at their website https://www.visualcrossing.com/weather-api
- Location : Enter your location. Use an address, partial address or latitude,longitude location for which to retrieve weather data. You can also use US ZIP Codes. You can test them at https://visualcrossing.com/weather-data to find the right one.
- Daily note location : Enter the path to the root of your daily notes. If you keep them all in a folder called “Journals” that resides in the root of your vault, you’d just enter
Journals
. If it’s not at the root level, a path likeContent/Journals
works. - Daily note subdirectory : If you divide your daily notes up by date, enter the pattern for your subdirectory structure. The default is YYYY/YYYY-MM, but you can use any combination of Y/M/D notation (YY/YYYY/M/MM/MMM/MMMM/D/DD/DDD/DDDD are all recognized).
- Daily note name format : Use the same Y/M/D notation to describe how you name your daily notes. The default is YYYY-MM-DD_DDD (e.g. 2024-12-27_Fri).
- Template file location : Enter the path to the template you use to generate your daily notes. If no daily note exists when weather is being fetched for a date, a new daily note will be created based on this template. Variables that work include:
{{title}}
{{date}}
{{time}}
- Basic Templater date commands like
<% moment(tp.file.title,'YYYY-MM-DD_ddd').format("dddd, MMMM D, YYYY") %>
- Note that the above date/time variables will be based on the date the weather is being fetched for. If you want today’s date/time use {{tdate}} or {{ttime}}, which may be more useful for properties like ‘created’ or ‘updated’.
- If you need other variables, let me know and I’ll see what I can do (no promises).
- Run Time : Leave blank if you only intend to run this plugin on demand using the
Fetch Yesterday's Weather
command, or if you use a plugin like Cron to run it. Enter a time in HH:MM format if you want it to run automatically every day (requires Obsidian be open at the time with Internet access). - Manually add for date : If you miss a date, maybe you didn’t have Obsidian open so it couldn’t run, pick a date and click ‘Fetch Weather’ and it will run for that specific date.
- General properties/Location : Do you want to include a property in your frontmatter that shows the location the weather data was gathered for (the location you set at the top of the settings tab)? Enable and then set the name you’d like to use for the property. The default is ‘location’.
- Weather properties : This is a list of every type of data that will be fetched from Visual Crossing. You can see more information about each here. Enable and set the property name to include that data in your daily note. The default names mostly start with ‘wtr’ to avoid colliding with other properties you may use (except for sunrise and sunset which seem pretty safe), but you can set them to anything you need.
Support
- If you want to report a bug, it would be best to start an Issue on the GitHub page.
- If you’d like to discuss how the plugin works, the best place would be the JOTS SubReddit
- I’ll also be monitoring this post, would love any feedback you’d like to share!