Backup plans for when a weather forecast provider becomes unavailable

This commit is contained in:
2023-06-01 14:24:23 -04:00
parent ab9ed5ffd9
commit 27a3a9a105

View File

@ -5,7 +5,16 @@ weather:
temperature_template: "{{ states('sensor.pirateweather_temperature') | float }}"
temperature_unit: °F
humidity_template: "{{ states('sensor.pirateweather_humidity') | float }}"
forecast_template: "{{ state_attr('weather.openweathermap', 'forecast') }}"
forecast_template: >
{% if state_attr('weather.iron_nerd_studios','forecast') %}
{{ state_attr('weather.iron_nerd_studios','forecast') }}
{% elif state_attr('weather.kdfi_daynight','forecast') %}
{{ state_attr('weather.kdfi_daynight','forecast') }}
{% elif state_attr('weather.openweathermap','forecast') %}
{{ state_attr('weather.openweathermap','forecast') }}
{% else %}
{{ state_attr('weather.weatherapi_stratton_ave','forecast') }}
{% endif %}
pressure_template: "{{ states('sensor.kdfi_barometric_pressure') | float }}"
pressure_unit: inHg
wind_speed_template: "{{ states('sensor.pirateweather_wind_speed') | float }}"
@ -23,7 +32,12 @@ weather:
temperature_template: "{{ states('sensor.pirateweather_temperature') | float }}"
temperature_unit: °F
humidity_template: "{{ states('sensor.pirateweather_humidity') | float }}"
forecast_template: "{{ state_attr('weather.kdfi_hourly', 'forecast') }}"
forecast_template: >
{% if state_attr('weather.kdfi_hourly','forecast') %}
{{ state_attr('weather.kdfi_hourly', 'forecast') }}
{% else %}
{{ state_attr('weather.iron_nerd_studios_hourly','forecast') }}
{% endif %}
pressure_template: "{{ states('sensor.kdfi_barometric_pressure') | float }}"
pressure_unit: inHg
wind_speed_template: "{{ states('sensor.pirateweather_wind_speed') | float }}"