# Daily weather forecast to Slack, Telegram or email

Send a forecast for any location to your team every morning with the free [Open-Meteo](https://open-meteo.com) API. No API key, no account.

## Example: a morning forecast in Slack

```json
{
  "name": "Site weather",
  "cron": { "expression": "0 6 * * 1-5", "time_zone": "Europe/Madrid" },
  "nodes": [
    { "id": "forecast", "open_meteo_forecast": { "latitude": "40.42", "longitude": "-3.70" } },
    { "id": "post", "slack_send_message": {
        "webhook_url": "https://hooks.slack.com/services/T000/B000/XXXX",
        "text": "Madrid today: {{ $.daily.temperature_2m_min[0] }}–{{ $.daily.temperature_2m_max[0] }}°C, {{ $.daily.precipitation_sum[0] }} mm of rain. Now {{ $.current.temperature_2m }}°C, wind {{ $.current.wind_speed_10m }} km/h." } }
  ]
}
```

## Example: tomorrow's forecast by text

```json
{
  "name": "Tomorrow's weather by SMS",
  "cron": { "expression": "0 20 * * *", "time_zone": "America/Phoenix" },
  "nodes": [
    { "id": "forecast", "open_meteo_forecast": { "latitude": "33.45", "longitude": "-112.07", "units": "imperial" } },
    { "id": "sms", "twilio_send_sms": {
        "credential_id": "YOUR_TWILIO_ACCOUNT_ID",
        "to": "+15551234567",
        "from": "+15557654321",
        "body": "Tomorrow in Phoenix: high {{ $.daily.temperature_2m_max[1] }}°F, low {{ $.daily.temperature_2m_min[1] }}°F." } }
  ]
}
```

`daily` lists start with today, so `[1]` is tomorrow and `[2]` the day after.

## Reference

### Get a weather forecast from Open-Meteo: `open_meteo_forecast`

**Sends** GET `https://api.open-meteo.com/v1/forecast` for current conditions and a 3-day daily forecast. No API key. **Output** for the next step: `current` (`temperature_2m`, `relative_humidity_2m`, `weather_code`, `wind_speed_10m`) and `daily` lists for today and the next two days (`time`, `weather_code`, `temperature_2m_max`, `temperature_2m_min`, `precipitation_sum`), in the location’s local time.

| Field | Type | Notes |
| --- | --- | --- |
| `latitude` | string, required | Decimal degrees, -90 to 90, such as `"45.52"`. |
| `longitude` | string, required | Decimal degrees, -180 to 180, such as `"-122.68"`. |
| `units` | string | Omit or `metric` for °C, km/h and mm. `imperial` for °F, mph and inches. |

`weather_code` is a [WMO code](https://open-meteo.com/en/docs#weather_variable_documentation): 0 is clear sky, 61–65 rain, 71–75 snow, 95 thunderstorm.
