IMPORTANT NOTICE - THIS PLUGIN IS NOW DISCONTINUED!
(Continue reading though - I have good news to announce as well)
Open Weather has discontinued API 2.5 on which this plugin is based. They do offer API 3.0 which is free, but it requires a credit card to subscribe to the API. I'm not interested in giving some company a way to automatically charge me for something in the future when/if they decide to. I'm pretty sure that would never actually happen, but I can say that I am positively sure it can not happen if they do not have my credit card info. Also if they did start charging the users of this plugin (around 10,000 users) for some unforseen reason, that would have a lot of people very unhappy with me and that would be unpleasant to say the least...
One other point is that there are enough differences between the two API's that it would basically require a complete re-write of the plugin which leads into my good news... I have very nearly completed a new weather plugin based on the Visual Crossing Weather API. It is free to subscribe to and does not require anything other than your email address. You can sign up here. It offers many great features that were not included with Open Weather. For example, 15 complete forecast days while Open Weather only had 5 and for 21 hours out of every 24, day 1 and 5 did not return the full data for those days. VCW API also returns hourly data for every one of those 15 days while OW only returns the data in 3 hour blocks. Other nice features that VCW API offers and OW API is missing is weather alerts, data is returned in local time rather than GMT (No conversions needed). The API documentation is also much better and it has an active support forum. Overall it is just a nicer API to work with.
If you want to try the new plugin now you can find the Visual Crossing Weather plugin here. It has some big improvements over the old plugin. It now has 5 locations you can get the weather data for as opposed to just one. I have doubled the number of weather templates from 4 to 8. There are now 2 statusbar strings which can be cycled every 30 seconds. The defaults are the first one has info on todays weather, the second displays info for tommorows weather. Note while this is still a work in progress it has almost every feature working now (Two feature that I still want to add are not yet completed). The documentation is also basically non-existent at the moment although I do have the complete list of current macros created (nearly 4000 already) and it is displayed in an easy to read table format. I have uploaded the main.js file as well if you would like to do a manual install or you could use the BRAT plugin to do the work for you. Anyone willing to Beta test it would be a huge help if they could provide any feedback.
Please note that the API was supposed to be discontinued 3 weeks ago, but as right now it is still returnig data. This could stop at any time!!! It is fortunate that it has continued this long as it has given me the time to write the new plugin. I will request the removal of this plugin from community plugins list when the API stops working or I have added the new plugin to community plugins list.
Thank you to all the plugins users since its creation, William McKeever
' | %desc% | Current Temp: %temp%°C | Feels Like: %feels%°C | '
'%desc% • Current Temp: %temp%°C • Feels Like: %feels%°C\n'
'%name%: %dateMonth4% %dateDay2% - %timeH2%:%timeM% %ampm1%\nCurrent Temp: %temp%°C • Feels Like: %feels%°C\nWind: %wind-speed% km/h from the %wind-dir%^ with gusts up to %wind-gust% km/h^\nSunrise: %sunrise% • Sunset: %sunset%\n'
'%icon% %dateMonth4% %dateDay2% %dateYear1% • %timeH2%:%timeM% %ampm1% • %desc%<br> Recorded Temp: %temp% • Felt like: %feels%<br> Wind: %wind-speed% km/h from the %wind-dir%^ with gusts up to %wind-gust% km/h^<br> Sunrise: %sunrise% • Sunset: %sunset%'
'%icon% %dateMonth4% %dateDay2% %dateYear1% • %timeH2%:%timeM% %ampm1% • %desc%<br> Current Temp: %temp% • Feels like: %feels%<br> Wind: %wind-speed% km/h from the %wind-dir%^ with gusts up to %wind-gust% km/h^<br> Sunrise: %sunrise% • Sunset: %sunset%'
Format String Three...
Format String Four...
Note: The \n
's are not required when editing these in the settings. Simply enter a return
to add a new line and the \n
will be added to the saved settings file. The <br>
's in string formats 3 & 4 are required for use in HTML.
See EXAMPLE.md for a demonstration of how I use this in my Daily Template.
Enter your OpenWeather API Key here (Required)
A free OpenWeather API key is required for the plugin to work. Go to https://openweathermap.org to register and get a key. Direct link to signup page https://home.openweathermap.org/users/sign_up.
Note: You will need to verify your email address, then your API key will be emailed to you. The key itself may take a couple of hours before it is activated. All this information will be included in the email they send to you.
This Geocoding API returns the requested locations name, state, country, latitude and longitude allowing you to choose the correct location. This is beneficial in cases where your city has a common name shared by other cities. To use this, enter your cities name in the text field and press the Get location
button. You will be prompted with a list of up to 5 locations to choose from.
Note: It is recommended to use the new Use Geocoding API to get location (recommended)
command to fill this in for you.
Enter your city's name (This setting is required unless latitude and longitude are defined) Note: If you are getting the wrong data try including your state and country codes. They can be entered as {city name},{state code},{country code}. Eg. South Bend, WA, US (The commas are required). If you are still having issues getting the correct data, then use the Latitude and Longitude settings instead.
Note: It is recommended to use the new Use Geocoding API to get location (recommended)
command to fill this in for you.
Enter your city's latitude (Setting Latitude and Longitude will override the Location setting)
Please note that API requests by city name have been deprecated although they are still available for use. The preferred method is to use latitude and longitude.
Note: It is recommended to use the new Use Geocoding API to get location (recommended)
command to fill this in for you.
Enter your city's longitude (Setting Latitude and Longitude will override the Location setting)
Please note that API requests by city name have been deprecated although they are still available for use. The preferred method is to use latitude and longitude.
Metric, Imperial and Standard units can be selected here. (Note: Standard is in Kelvin, not really useful in most cases)
Supported languages available (46 languages total) Note: This only applies to text that is returned by the Open Weather API. This does not change the text in the defined weather strings. If you want the text in the default weather strings in another language you will need to edit them directly in the settings.
Folder to exclude from automatic Template strings replacement. This should be set to your vaults template folder. The exclusion includes any subfolders within the selected folder.
Define your weather strings here (4 strings are available + 1 for the statusbar)
Tip: These strings can contain anything you want, not just weather information.
Toggle display of the current weather in the statusbar on or off
Define your statusbar weather string here
Time interval to update the weather displayed in the statusbar and DIV's (1, 5, 10, 15, 20, 30 or 60 minutes)
These macros contained within the weather string will be replaced with the appropiate data.
%desc%
%desc-em%
%icon%
- See note below%icon2x%
- See note below%temp%
%feels%
%tempmin%
%tempmax%
%pressure%
%humidity%
%pressure-sl%
%pressure-gl%
%visibility%
%wind-speed%
- km/h for Metric, mph for Imperial%wind-speed-ms%
- m/s (Meters per second)%wind-dir%
- Eg. Northwest%wind-gust%
- See note below%clouds%
(Percentage)%rain1h%
(in millimeters)%rain3h%
(in millimeters)%snow1h%
(in millimeters)%snow3h%
(in millimeters)%precipitation1h%
(in millimeters - Rain or Snow)%precipitation3h%
(in millimeters - Rain or Snow)%sunrise%
- 08:30:30 (24 hour format)%sunset%
- 19:30:30 (24 hour format)%name%
- Eg. Edmonton%latitude%
- Eg. 46.66%longitude%
- Eg. -123.80%aqinumber%
- 1 to 5 (Order matches the strings list)%aqistring%
- 'Good', 'Fair', 'Moderate', 'Poor', 'Very Poor' (Order matches the numbers list)%dateYear1%
- 2022%dateYear2%
- 22%dateMonth1%
- 1%dateMonth2%
- 01%dateMonth3%
- Jan%dateMonth4%
- January%dateDay1%
- 2%dateDay2%
- 02%ampm1%
- "AM"%ampm2%
- "am"%timeH1%
- 23 (24 hour)%timeH2%
- 1 (12 hour)%timeM%
- 05%timeS%
- 05Note: The 5 day forecast is returned in 3 hour increments (total of 40 data objects). This means that the data returned by the API does not start at 12:00 am tommorow, but for the next 3 hour slice of available data. This means that only once a day can you get the full forecast for 5 days (just before midnight). At all other times you will recieve partial data for today and partial data for the last day. You will need to account for this when defining your weather strings. To make it easier for you I have included the placeholders %next12%
, %next24%
, and %next48%
(see placeholder example) and will add more in the future.
Note: The placeholders represent the 3 hour forecast objects and are numbered 00, 01, 02, ... 39 in the placeholders.
%fyear_00%
to %fyear_39%
- Forecast Year Eg. 2024
%fmonth_00%
to %fmonth_39%
- Forecast Month Eg. 05
%fdate_00%
to %fdate_39%
- Forecast Date Eg. 26
%fhours_00%
to %fhours_39%
- Forecast Hours Eg. 18
%fmins_00%
to %fmins_39%
- Forecast Minutes Eg. 00 (will always be 00)
%fsecs_00%
to %fsecs_39%
- Forecast Seconds Eg. 00 (will always be 00)
%dt_localtime_00%
to %dt_localtime_39%
- Forecast local date and time string Eg. 2024-05-26 18:00:00
%d_localtime_00%
to %d_localtime_39%
- Forecast local date string Eg. 2024-05-26
%ds_localtime_00%
to %ds_localtime_39%
- Forecast local date short string Eg. 05-26
%t_localtime_00%
to %t_localtime_39%
- Forecast local time string Eg. 18:00:00
%ts_localtime_00%
to %ts_localtime_39%
- Forecast local time short string Eg. 18:00
%ftemp_00%
to %ftemp_39%
- Forecast temperature Eg. 15
%ffeels_00%
to %ffeels_39%
- Forecast feels like temperature Eg. 14
%fclouds_00%
to %fclouds_39%
- Forecast cloud coverage Eg. 99
%fpop_00%
to %fpop_39%
- Probability of precipitation Eg. 100
%fpod_00%
to %fpod_39%
- Part of the day (n - night, d - day) Eg. d
%fvis_00%
to %fvis_39%
- Visibility in feet Eg. 10000
%fhum_00%
to %fhum_39%
- Humidity percentage Eg. 70
%ftempmax_00%
to %ftempmax_39%
- Maximum temperature Eg. 16
%ftempmin_00%
to %ftempmin_39%
- Minimum temperature Eg. 15
%fground_00%
to %fground_39%
- Ground level pressure in millibarsEg. 928
%fsea_00%
to %fsea_39%
- Sea level pressure in millibarsEg. 1007
%fdesc_00%
to %fdesc_39%
- Weather description Eg. Light Rain
%fmaindesc_00%
to %fmaindesc_39%
- Weather main description Eg. Rain
%fdescem_00%
to %fdescem_39%
- Weather description emoji Eg. 🌧️
%ficonurl_00%
to %ficonurl_39%
- Weather icon URL Eg. https://openweathermap.org/img/wn/10d.png
%ficonurl2x_00%
to %ficonurl2x_39%
- Weather icon URL double size Eg. https://openweathermap.org/img/wn/10d@2x.png
%fwindspeed_00%
to %fwindspeed_39%
- Wind speed in miles per hour Eg. 7
%fwindspeedms_00%
to %fwindspeedms_39%
- Wind speed in meters per second Eg. 2
%fwinddeg_00%
to %fwinddeg_39%
- Wind direction in degrees Eg. 198
%fwinddir_00%
to %fwinddir_39%
- Wind direction Eg. South
%fwindgust_00%
to %fwindgust_39%
- Wind gusts miles per hour Eg. 7
%fwindgustms_00%
to %fwindgustms_39%
- Wind gusts meters per second Eg. 2
%next12%
- Forecast list for the next 12 hours Eg...
%next24%
- Forecast list for the next 24 hours Eg...
%next48%
- Forecast list for the next 48 hours Eg...
%icon%
and %icon2x%
- This is replaced with the image tag <img src={Icon Url} />
This is more useful if it is embedded inside a div code block.
%wind-gust%
This data is only returned by the API if the condition exists. To make this display the string data only when it exists you can surround it with the caret symbols.
For example: Winds %wind-speed% km/h^ with gusts up to %wind-gust% km/h^
With wind gust data this will convert to: Winds 10 km/h with gusts up to 20 km/h
Without wind gust data this will convert to: Winds 10 km/h
(The text surrounded by carets will be removed)
OpenWeather: Insert weather string one
- Inserts Weather String One into the current document.OpenWeather: Insert weather string two
- Inserts Weather String Two into the current document.OpenWeather: Insert weather string three
- Inserts Weather String Three into the current document.OpenWeather: Insert weather string four
- Inserts Weather String Four into the current document.
OpenWeather: Replace template string
- This will replace all occurences of the strings, %weather1%
, %weather2%
, %weather3%
and %weather4%
with the corresponding defined weather strings. See also Template supportYou can place the following strings in your templates and when creating a new document using the template, they will automatically be replaced with the corresponding weather strings.
%weather1%
- Inserts weather string One%weather2%
- Inserts weather string Two%weather3%
- Inserts weather string Three%weather4%
- Inserts weather string FourYou can insert the following DIV inside your documents to provide dynamic weather which is updated at the frequency set in the settings Update Frequency setting. The weather_historical_3
is the static temperature at the time the document is created and the weather_current_1
is dynamic. See EXAMPLE.md for a demonstration of how I use these in my Daily Template.
<div class="weather_historical_3">%weather3%</div>
<div class="weather_current_1"></div>
You can use the following class's to insert the corresponding weather strings
and...