Foreca

The Foreca integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] uses the Foreca Weather API to provide weather forecasts for any location worldwide. Foreca is an independent weather company that has produced forecasts for consumer and business services since 1996.

You can use this integration free of charge with a Foreca Weather API Freemium subscription, which is strictly for non-commercial use. It also works with Foreca’s premium packages, which allow commercial use and provide higher request limits and further weather products.

Use cases

  • Delay irrigation when the daily forecast predicts rain.
  • Switch on a fan when the hourly forecast shows the temperature climbing.
  • Warn ahead of a frosty night using the daily minimum temperature.

Prerequisites

You need a Foreca Weather API key, from either subscription.

  1. Go to developer.foreca.com and create an account.
  2. Choose the subscription that suits you. Freemium covers everything this integration does.
  3. Verify your email address.
  4. Go to My API and copy your API key.

Configuration

To add the Foreca service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

API key

The API key from the My API page of your Foreca developer account.

Setup asks only for the API key and automatically adds your Home Assistant home location. You can add more locations afterward, each with its own device and weather entity.

Configuration options

Location

The location to retrieve weather data for. Defaults to the home location set in your Home Assistant configuration.

To add another location later, select Add location on the Foreca entry under Settings > Devices & services. One API key covers as many locations as its request limit allows.

Supported functionality

Weather

The integration creates one weather entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] per location, providing the current conditions, a daily forecast for the next 14 days, and an hourly forecast for the next 7 days.

The current conditions include temperature, apparent temperature, dew point, humidity, air pressure, wind speed, wind gust speed, wind bearing, visibility, cloud coverage, and UV index.

The daily forecast includes:

  • Condition
  • Maximum and minimum temperature
  • Maximum apparent temperature
  • Maximum dew point
  • Total precipitation and its probability
  • Maximum wind speed and wind gust speed
  • Wind bearing
  • Air pressure
  • Cloud coverage
  • UV index

The hourly forecast includes:

  • Condition
  • Temperature and apparent temperature
  • Dew point
  • Humidity
  • Precipitation and its probability
  • Wind speed, wind gust speed, and wind bearing
  • Air pressure
  • Cloud coverage
  • UV index

Sensors

Each location also gets three sensors for the current conditions:

  • Precipitation intensity: the current rate of precipitation, in mm/h.
  • Precipitation probability: the current probability of precipitation, in percent.
  • Thunderstorm probability: the current probability of thunder, in percent.

These sensors come from the same requests as the weather entity, so they add nothing to your request count.

Each location also gets the latest measurements from the nearest weather station:

  • Observation station: the name of the station the measurements come from. This is a diagnostic entity.
  • Observation time: when the station took the measurements. This is a diagnostic entity and is disabled by default.
  • Observed temperature and Observed humidity.
  • Observed condition: the weather the station reports, such as sunny, rainy, or snowy. Disabled by default.
  • Observed hourly precipitation: the precipitation the station measured in its latest full hour, in mm. Its Last reset attribute shows when that hour started. It shows as unknown when that hour ended more than two hours before the station’s latest measurements, for example, when the station skips reports.
  • Observed precipitation type: the type of precipitation in the station’s latest full hour: rain, sleet, snow, hail, or icing. It shows as unknown when there was no precipitation in that hour, when the station cannot determine the type, or when the hourly precipitation sensor is unknown. Disabled by default.
  • Observed 24-hour precipitation: the station’s own precipitation total, in mm, for its latest 24-hour period. This period usually ends at 06:00 UTC. This sensor is enabled by default.
  • Observed 3-hour precipitation, Observed 6-hour precipitation, and Observed 12-hour precipitation: the station’s own precipitation totals, in mm, for its latest 3-, 6-, and 12-hour periods. Disabled by default.
  • Observed apparent temperature, Observed pressure, Observed wind speed, Observed wind gust speed, Observed wind direction, Observed visibility, and Observed snow depth. These are disabled by default.

The precipitation total sensors have a Last reset attribute that shows when each period started. The periods a station reports vary. A total shows as unknown when the station does not report that period, or when the period ended more than its length plus one hour before the station’s latest measurements.

Where no station reports nearby, the observation sensors show as Unknown.

Each location also gets the US EPA air quality index for the current hour:

  • Air quality index and Dominant pollutant.
  • An index for each pollutant: Carbon monoxide index, Nitrogen dioxide index, Ozone index, Sulphur dioxide index, PM10 index, and PM2.5 index. These are disabled by default.

List of actions

The Foreca integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.

  • Get 15-minute forecast (foreca.get_15_minute_forecast, returns data) Retrieves the Foreca forecast in 15-minute steps for the next three hours.

  • Get 3-hour forecast (foreca.get_3_hour_forecast) Retrieves the Foreca forecast in 3-hour steps for the next 14 days.

  • Get air quality forecast (foreca.get_air_quality_forecast) Retrieves the Foreca air quality index forecast, hourly for up to 85 hours or daily for four days.

  • Get extra forecast values (foreca.get_forecasts_extra, returns data) Retrieves Foreca forecast values that the standard forecast has no place for, such as precipitation type, snow, solar radiation, sunshine, sunrise, and the range of the daily forecast.

  • Get minute forecast (foreca.get_minute_forecast) Retrieves the precipitation rate for each minute of the next hour from Foreca.

For an overview of every action across all integrations, see the actions reference.

Data updates

The integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] the Foreca Weather API every 30 minutes. Each update uses six requests per location: three for the forecast and current conditions, two for the weather station sensors, and one for the air quality sensors. That’s around 290 requests per day for one location, which stays well inside the Freemium plan’s daily limit of 2,000 requests. Each location you add polls separately, so that limit allows around 6 locations. Because the integration polls continuously, a Freemium key used this way does not go idle.

You can save requests by disabling sensors:

  • Disable all of a location’s observed precipitation total sensors to save one request per update. This includes the 24-hour sensor, which is enabled by default.
  • Disable all of its other observation sensors to save one request per update.
  • Disable all of its air quality sensors to save one request per update.

The weather.get_forecasts and foreca.get_forecasts_extra actions read the forecast the integration has already retrieved, so using them in templates and automations costs no extra requests.

The foreca.get_3_hour_forecast, foreca.get_minute_forecast, foreca.get_15_minute_forecast, and foreca.get_air_quality_forecast actions request fresh data, so each call uses one request for every Foreca weather entity it targets.

Known limitations

  • The API dates a daily forecast rather than timing it, so each daily entry is reported at the start of that day in your Home Assistant time zone.
  • The Freemium plan is for non-commercial use only and is provided on a best-effort basis, without a service level agreement or support. Commercial use needs a paid plan.
  • A Freemium key deactivates after 30 days without any requests.
  • The set of available weather products depends on your Foreca plan. See the pricing page for what each plan includes.

Troubleshooting

Cannot authenticate account

Symptom: The integration reports invalid authentication

Resolution

  • Check that the API key was copied in full from the My API page.
  • Confirm that your subscription is still active in your Foreca developer account.
  • If using a free plan, make sure that you create an account with a verified email address before configuring the integration.
  • A Freemium key that has gone 30 days without any requests is deactivated. Create a new key on the My API page.
Entities show as unavailable

Symptom: Entities show as unavailable

Description

The integration marks entities as unavailable when the API cannot be reached or the daily request limit is exceeded. If only a weather station request or the air quality request fails, only the sensors that use it are unavailable, and the rest keep updating.

Resolution

Check your remaining requests on the My API page.

Removing the integration

This integration follows standard integration removal. No extra steps are required.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. Next to the entry you want to remove, select the three dots menu. Then, select Delete.
    • Depending on the integration, the entries are listed under one of the following headings:
      • Devices
      • Hubs
      • Services
      • Integration entries
  3. To confirm, select Delete.
    • Home Assistant also deletes the devices and entities of the entry.
  4. If Home Assistant asks you to restart, restart Home Assistant.
  5. If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.

Revoking the API key itself is done on the My API page of your Foreca developer account.