mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
updating weather template example (#19799)
This commit is contained in:
parent
9b0c14d0b2
commit
cd78da05ad
@ -20,17 +20,19 @@ Another use case could be using temperature and humidity from one weather platfo
|
||||
|
||||
To enable a Template Weather provider in your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
(Note, be sure to update my_region in the condition and forecast templates to an appropriate value for your setup).
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
weather:
|
||||
- platform: template
|
||||
name: "my very own weather station"
|
||||
condition_template: "sunny"
|
||||
temperature_template: "{{ states('sensor.temperature') | float}}"
|
||||
humidity_template: "{{ states('sensor.humidity')| float }}"
|
||||
forecast_template: "{{ states.weather.my_region.attributes.forecast }}"
|
||||
name: "My Weather Station"
|
||||
condition_template: "{{ states('weather.my_region') }}"
|
||||
temperature_template: "{{ states('sensor.temperature') | float }}"
|
||||
humidity_template: "{{ states('sensor.humidity') | float }}"
|
||||
forecast_template: "{{ state_attr('weather.my_region', 'forecast') }}"
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user