mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-13 12:26:50 +00:00
Add units to weather template (#23218)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
b1ebfd87f8
commit
ca8d46fff4
@ -15,6 +15,7 @@ There are several powerful ways to use this integration, including localizing yo
|
||||
|
||||
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 entity override, see [documentation](https://developers.home-assistant.io/docs/core/entity/weather/#unit-conversion).
|
||||
|
||||
## Configuration
|
||||
|
||||
@ -31,6 +32,7 @@ weather:
|
||||
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_template: "{{ state_attr('weather.my_region', 'forecast') }}"
|
||||
```
|
||||
@ -54,6 +56,10 @@ temperature_template:
|
||||
description: The current temperature.
|
||||
required: true
|
||||
type: template
|
||||
temperature_unit:
|
||||
description: Unit for temperature_template output. Valid options are °C, °F and K.
|
||||
required: false
|
||||
type: string
|
||||
humidity_template:
|
||||
description: The current humidity.
|
||||
required: true
|
||||
@ -66,10 +72,18 @@ pressure_template:
|
||||
description: The current air pressure.
|
||||
required: false
|
||||
type: template
|
||||
pressure_unit:
|
||||
description: Unit for pressure_template output. Valid options are Pa, hPa, kPa, bar, cbar, mbar, mmHg, inHg, psi.
|
||||
required: false
|
||||
type: string
|
||||
wind_speed_template:
|
||||
description: The current wind speed.
|
||||
required: false
|
||||
type: template
|
||||
wind_speed_unit:
|
||||
description: Unit for wind_speed_template output. Valid options are m/s, km/h, mph, mm/d, in/d, in/h.
|
||||
required: false
|
||||
type: string
|
||||
wind_bearing_template:
|
||||
description: The current wind bearing.
|
||||
required: false
|
||||
@ -82,10 +96,18 @@ visibility_template:
|
||||
description: The current visibility.
|
||||
required: false
|
||||
type: template
|
||||
visibility_unit:
|
||||
description: Unit for visibility_template output. Valid options are km, mi, ft, m, cm, mm, in, yd.
|
||||
required: false
|
||||
type: string
|
||||
forecast_template:
|
||||
description: Daily forecast data.
|
||||
required: false
|
||||
type: template
|
||||
precipitation_unit:
|
||||
description: Unit for precipitation output. Valid options are km, mi, ft, m, cm, mm, in, yd.
|
||||
required: false
|
||||
type: string
|
||||
{% endconfiguration %}
|
||||
|
||||
### Template variables
|
||||
|
Loading…
x
Reference in New Issue
Block a user