Template Weather Provider
The template
integrations creates weather provider that combines integrations and an existing weather provider into a fused weather provider.
There are several powerful ways to use this integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more], including localizing your weather provider information with local information from temperature, humidity, pressure sensors that you own.
Another use case could be using temperature and humidity from one weather platform, with forecasts from a different one.
Output will be converted according to the user’s unit system or 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] override, see documentation.
Configuration
To enable a Template Weather provider in your installation, add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file:
(Note, be sure to update my_region in the condition and forecast templates to an appropriate value for your setup).
# Example configuration.yaml entry
weather:
- platform: template
name: "My Weather Station"
condition_template: "{{ states('weather.my_region') }}"
temperature_template: "{{ states('sensor.temperature') | float }}"
temperature_unit: "°C"
humidity_template: "{{ states('sensor.humidity') | float }}"
forecast_daily_template: "{{ state_attr('weather.my_region', 'forecast_data') }}"
Configuration Variables
Name to use in the frontend.
An ID that uniquely identifies this weather entity. Set this to a unique value to allow customization through the UI.
The current weather condition.
The current temperature.
The current dew point.
The current apparent (feels-like) temperature.
Unit for temperature_template output. Valid options are °C, °F, and K.
The current humidity.
The current air pressure.
Unit for pressure_template output. Valid options are Pa, hPa, kPa, bar, cbar, mbar, mmHg, inHg, psi.
The current wind speed.
The current wind gust speed.
Unit for wind_speed_template output. Valid options are m/s, km/h, mph, mm/d, in/d, and in/h.
The current wind bearing.
The current ozone level.
The current cloud coverage.
The current visibility.
Unit for visibility_template output. Valid options are km, mi, ft, m, cm, mm, in, yd.
Daily forecast data.
Hourly forecast data.
Twice daily forecast data.
Template variables
State-based template entities have the special template variable this
available in their templates. The this
variable aids self-referencing of an 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]’s state and attribute in templates.