updating weather template example (#19799)

This commit is contained in:
Chris Turra 2021-10-16 12:18:19 -07:00 committed by GitHub
parent 9b0c14d0b2
commit cd78da05ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: 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 %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
weather: weather:
- platform: template - platform: template
name: "my very own weather station" name: "My Weather Station"
condition_template: "sunny" condition_template: "{{ states('weather.my_region') }}"
temperature_template: "{{ states('sensor.temperature') | float}}" temperature_template: "{{ states('sensor.temperature') | float }}"
humidity_template: "{{ states('sensor.humidity')| float }}" humidity_template: "{{ states('sensor.humidity') | float }}"
forecast_template: "{{ states.weather.my_region.attributes.forecast }}" forecast_template: "{{ state_attr('weather.my_region', 'forecast') }}"
``` ```
{% endraw %} {% endraw %}