# Open-Meteo forecast

> Current weather and forecasts for a place, no key.

Source: https://docs.tune.toys/nodes/addon.open-meteo.forecast/

Open-Meteo forecast asks [Open-Meteo](https://open-meteo.com/) for the current weather and an hourly forecast at a latitude and longitude. It needs no key.

## What it does

The node is generated from the `open-meteo` addon manifest. It builds a `GET https://api.open-meteo.com/v1/forecast` request from its parameters and runs it exactly like a [Web request](https://docs.tune.toys/nodes/web.request/): `response` is the parsed JSON, with `current` and `hourly` blocks holding the variables you asked for, plus `status`, `error` and `done`.

With `trigger` cabled, each trigger asks once. Without it, a change on any cabled parameter port asks; with no cable at all, the node asks once when the Toy starts. Every parameter uses its cable when one is connected, otherwise the node's own setting.

A Toy using this node requires the network and the `open-meteo` addon. Enable the addon in Settings → Addons: requests then go straight from your browser, which Open-Meteo allows, and fall back to the proxy when you are signed in. Open-Meteo is free for non-commercial use under 10 000 requests per day; credit "Weather data by Open-Meteo.com" (CC BY 4.0) where you show the data. During [replay](https://docs.tune.toys/concepts/takes/) the recorded responses are played back instead.

## When to use it

Use it to make sound follow the weather: temperature into a delay time, wind speed into a filter, rain into density. Pick values with [Convert](https://docs.tune.toys/nodes/data.convert/) and bridge them with [Data to control](https://docs.tune.toys/nodes/data.to-control/).

## Ports

<!-- ports:start -->

| Port            | Direction | Signal         | Lanes |
| --------------- | --------- | -------------- | ----- |
| `trigger`       | Input     | Data (trigger) | 1     |
| `latitude`      | Input     | Data (number)  | 1     |
| `longitude`     | Input     | Data (number)  | 1     |
| `current`       | Input     | Data (string)  | 1     |
| `hourly`        | Input     | Data (string)  | 1     |
| `forecast_days` | Input     | Data (integer) | 1     |
| `response`      | Output    | Data (json)    | 1     |
| `status`        | Output    | Data (integer) | 1     |
| `error`         | Output    | Data (string)  | 1     |
| `done`          | Output    | Data (trigger) | 1     |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter       | Label         | Range       | Default | Unit | Scale  | Notes                                                               |
| --------------- | ------------- | ----------- | ------- | ---- | ------ | ------------------------------------------------------------------- |
| `latitude`      | Latitude      | -90 to 90   | 52.52   | °    | linear | Degrees north; negative is south. Used while the port has no cable. |
| `longitude`     | Longitude     | -180 to 180 | 13.41   | °    | linear | Degrees east; negative is west. Used while the port has no cable.   |
| `forecast_days` | Forecast days | 1 to 16     | 1       |      | linear | Days of hourly forecast, 1 to 16. Used while the port has no cable. |

<!-- parameters:end -->

<!-- data:start -->

- `current`: text.
- `hourly`: text.

<!-- data:end -->

### Latitude (`latitude`) and Longitude (`longitude`)

The place, in degrees: north and east are positive. The defaults are Berlin (52.52, 13.41).

### Forecast days (`forecast_days`)

How many days of hourly forecast to return, 1 to 16.

### Current and hourly

The `current` and `hourly` text fields list variables, comma separated, such as `temperature_2m,wind_speed_10m,precipitation`. `current` defaults to temperature and wind speed; an empty `hourly` asks for no hourly forecast. The [Open-Meteo documentation](https://open-meteo.com/en/docs) lists every variable.

## Tips

- Weather changes slowly. Refresh with a [Cron](https://docs.tune.toys/nodes/time.cron/) every 10 minutes or more, not every second.
- Temperatures come in °C by default; the response's `current_units` says so.

## See also

[Web request](https://docs.tune.toys/nodes/web.request/), [Convert](https://docs.tune.toys/nodes/data.convert/), [Data to control](https://docs.tune.toys/nodes/data.to-control/), [Data cables](https://docs.tune.toys/concepts/data-cables/).
