SA.Automate.WeatherApi
1.0.7
dotnet add package SA.Automate.WeatherApi --version 1.0.7
NuGet\Install-Package SA.Automate.WeatherApi -Version 1.0.7
<PackageReference Include="SA.Automate.WeatherApi" Version="1.0.7" />
<PackageVersion Include="SA.Automate.WeatherApi" Version="1.0.7" />
<PackageReference Include="SA.Automate.WeatherApi" />
paket add SA.Automate.WeatherApi --version 1.0.7
#r "nuget: SA.Automate.WeatherApi, 1.0.7"
#:package SA.Automate.WeatherApi@1.0.7
#addin nuget:?package=SA.Automate.WeatherApi&version=1.0.7
#tool nuget:?package=SA.Automate.WeatherApi&version=1.0.7
SA.Automate.WeatherApi
WeatherAPI.com connection types and actions for Umbraco Automate. Get the current weather or today's forecast for a location as part of an automation workflow.
What is WeatherAPI.com?
WeatherAPI.com is a JSON/XML weather API that provides current weather, forecasts, and historical weather for locations worldwide, looked up by city name, postcode/zip, IP address, or latitude/longitude.
What can this be used for?
This package is useful when you want current weather data inside an Umbraco Automate workflow, for example:
- Conditional content: branch a workflow based on the current conditions at a location.
- Enriching notifications: include the current temperature or conditions in a message sent by another action.
- Logging/reporting: record weather conditions alongside other workflow data.
Installation
dotnet add package SA.Automate.WeatherApi
No further setup required. The composer registers itself automatically via Umbraco's IComposer discovery.
Connection types
This package registers a single WeatherAPI.com connection type:
- API Key: required. The WeatherAPI.com API key used by this connection.
Setup
1. Get an API key
Get a free API key from weatherapi.com.
2. Store the key in appsettings.json (optional)
The connection's API Key field is marked sensitive, so instead of entering the key directly in the backoffice you can store it in appsettings.json and reference it using Umbraco Automate's configuration reference syntax:
{
"Umbraco": {
"Automate": {
"Secrets": {
"WeatherApiKey": "your-api-key"
}
}
}
}
3. Create the connection in the backoffice
Go to Automate → Connections and create a new WeatherAPI.com connection.
Give the connection a name and enter your API Key — either the key itself, or, if you stored it in
appsettings.jsonabove, this reference:$Umbraco:Automate:Secrets:WeatherApiKeyClick Test connection to verify. This requests the current weather for a known location to confirm the API key is valid.
Usage
Get Current Weather
Add the Get Current Weather action to any automation and select the connection to use. Available fields:
| Field | Description |
|---|---|
| Location | The location to get current weather for. Accepts a city name, US zip, UK postcode, IP address, or lat,lon. Supports ${ binding } expressions. |
| Culture | Optional. The culture to localize the weather condition text into, e.g. en-GB, fr-FR, es-ES. Falls back to English if not set. Supports ${ binding } expressions. |
The action outputs the following, which can be referenced via bindings in later workflow steps:
| Output | Description |
|---|---|
| LocationName | The resolved location name, e.g. "London". |
| Region | The resolved region. |
| Country | The resolved country. |
| LocalTime | The local time at the resolved location. |
| TemperatureC | The current temperature in degrees Celsius. |
| TemperatureF | The current temperature in degrees Fahrenheit. |
| Condition | The weather condition text, e.g. "Sunny". |
| ConditionIconUrl | The URL of the icon representing the weather condition. |
| ConditionCode | The WeatherAPI.com condition code, e.g. 1000 for "Sunny". |
| Humidity | The current humidity, as a percentage. |
| Cloud | The current cloud cover, as a percentage. |
| WindKph | The current wind speed in kilometres per hour. |
| WindMph | The current wind speed in miles per hour. |
| WindDirection | The current wind direction, e.g. "WSW". |
| LastUpdated | The time the weather data was last updated. |
| WillItRain | Whether it is expected to rain during the current hour. |
| ChanceOfRain | The chance of rain during the current hour, as a percentage. |
| WillItSnow | Whether it is expected to snow during the current hour. |
| ChanceOfSnow | The chance of snow during the current hour, as a percentage. |
| Uv | The UV index. |
| RawResponse | The full, unprocessed JSON response returned by WeatherAPI.com. |
Get Today's Weather
Add the Get Today's Weather action to any automation and select the connection to use. Available fields:
| Field | Description |
|---|---|
| Location | The location to get today's weather forecast for. Accepts a city name, US zip, UK postcode, IP address, or lat,lon. Supports ${ binding } expressions. |
| Culture | Optional. The culture to localize the weather condition text into, e.g. en-GB, fr-FR, es-ES. Falls back to English if not set. Supports ${ binding } expressions. |
The action outputs the following, which can be referenced via bindings in later workflow steps:
| Output | Description |
|---|---|
| LocationName | The resolved location name, e.g. "London". |
| Region | The resolved region. |
| Country | The resolved country. |
| LocalTime | The local time at the resolved location. |
| Date | The forecast date, e.g. "2024-01-01". |
| MaxTemperatureC | Today's maximum temperature in degrees Celsius. |
| MaxTemperatureF | Today's maximum temperature in degrees Fahrenheit. |
| MinTemperatureC | Today's minimum temperature in degrees Celsius. |
| MinTemperatureF | Today's minimum temperature in degrees Fahrenheit. |
| AvgTemperatureC | Today's average temperature in degrees Celsius. |
| AvgTemperatureF | Today's average temperature in degrees Fahrenheit. |
| MaxWindMph | Today's maximum wind speed in miles per hour. |
| MaxWindKph | Today's maximum wind speed in kilometres per hour. |
| TotalPrecipMm | Today's total precipitation in millimetres. |
| TotalPrecipIn | Today's total precipitation in inches. |
| TotalSnowCm | Today's total snowfall in centimetres. |
| AvgVisKm | Today's average visibility in kilometres. |
| AvgVisMiles | Today's average visibility in miles. |
| AvgHumidity | Today's average humidity, as a percentage. |
| WillItRain | Whether it is expected to rain at some point today. |
| ChanceOfRain | The chance of rain at some point today, as a percentage. |
| WillItSnow | Whether it is expected to snow at some point today. |
| ChanceOfSnow | The chance of snow at some point today, as a percentage. |
| Condition | The weather condition text, e.g. "Partly Cloudy". |
| ConditionIconUrl | The URL of the icon representing the weather condition. |
| ConditionCode | The WeatherAPI.com condition code, e.g. 1003 for "Partly Cloudy". |
| Uv | The UV index. |
| RawResponse | The full, unprocessed JSON response returned by WeatherAPI.com. |
Compatibility
| Package version | Umbraco Automate | Umbraco CMS |
|---|---|---|
| 1.x | 17.x – 18.x | 17.x – 18.x |
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Umbraco.Automate.Core (>= 17.0.0-beta && < 19.0.0)
- Umbraco.Cms.Core (>= 17.4.0 && < 19.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.