From 8dac5bcb872ac27c5bc1b7a9ffb99937c3a422fa Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Mon, 22 Feb 2021 14:46:47 +0000 Subject: [PATCH] Add template Weather provider (#16681) * initial commit * Update source/_integrations/weather.template.markdown Co-authored-by: Franck Nijhof --- .../_integrations/weather.template.markdown | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 source/_integrations/weather.template.markdown diff --git a/source/_integrations/weather.template.markdown b/source/_integrations/weather.template.markdown new file mode 100644 index 00000000000..c2e857c9cae --- /dev/null +++ b/source/_integrations/weather.template.markdown @@ -0,0 +1,71 @@ +--- +title: "Template Weather Provider" +description: "Instructions on how to integrate Template Weather provider into Home Assistant." +ha_category: + - Weather +ha_release: 2021.3 +ha_iot_class: "Local Push" +ha_qa_scale: internal +ha_domain: template +--- + +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 integration, 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 plaform, with forecasts from a different one. + + +## Configuration + +To enable a Template Weather provider in your installation, add the following to your `configuration.yaml` file: + +{% 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 }}" +``` + +{% endraw %} + +{% configuration %} +name: + description: Name to use in the frontend. + required: true + type: string +condition_template: + description: The current weather condition. + required: true + type: template +temperature_template: + description: The current temperature. + required: true + type: template +humidity_template: + description: The current humidity. + required: true + type: template +pressure_template: + description: The current air pressure. + required: false + type: template +wind_speed_template: + description: The current wind speed. + required: false + type: template +forecast_template: + description: Daily forecast data. + required: false + type: template +{% endconfiguration %} + +## Considerations + +If you are using the state of a integration that takes extra time to load, the Template Weather may get an `unknown` state during startup. This results in error messages in your log file until that integration has completed loading. If you use `is_state()` function in your template, you can avoid this situation.