SA.Automate.WeatherApi
1.0.4
dotnet add package SA.Automate.WeatherApi --version 1.0.4
NuGet\Install-Package SA.Automate.WeatherApi -Version 1.0.4
<PackageReference Include="SA.Automate.WeatherApi" Version="1.0.4" />
<PackageVersion Include="SA.Automate.WeatherApi" Version="1.0.4" />
<PackageReference Include="SA.Automate.WeatherApi" />
paket add SA.Automate.WeatherApi --version 1.0.4
#r "nuget: SA.Automate.WeatherApi, 1.0.4"
#:package SA.Automate.WeatherApi@1.0.4
#addin nuget:?package=SA.Automate.WeatherApi&version=1.0.4
#tool nuget:?package=SA.Automate.WeatherApi&version=1.0.4
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. The free plan is suitable for commercial use.
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: optional. Overrides the globally configured API key for this connection. Leave blank to use the default key configured in
appsettings.json.
Setup
1. Configure your API key
Get a free API key from weatherapi.com and set it as the default in your appsettings.json (or appsettings.Production.json); individual connections can still override it with their own key:
{
"Umbraco": {
"Automate": {
"Providers": {
"SA.Automate.WeatherApi": {
"ApiKey": "your-api-key",
"Culture": "en-GB"
}
}
}
}
}
Culture is optional and sets the default culture (e.g. en-GB, fr-FR) used to localize weather condition text across all actions. Leave it unset to default to English. An action's own Culture field always overrides this.
2. Create the connection in the backoffice
- Go to Automate → Connections and create a new WeatherAPI.com connection.
- Give the connection a name. Leave API Key blank to use the default configured in
appsettings.json, or enter a different key for this connection. - Click Test connection to verify. This requests the current weather for a known location to confirm the API key is valid.
Tip: You only need multiple connections if different workflows should use different API keys.
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. Overrides the globally configured Culture. Falls back to that default, or English if neither is 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. |
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. Overrides the globally configured Culture. Falls back to that default, or English if neither is 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. |
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.