From a04ca2643d711bcca27883dbaa30d5d4bc003479 Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Fri, 24 May 2019 08:28:15 -0400 Subject: [PATCH] added pollen stuff using iqvia. --- packages/weather.yaml | 12 +++++++ templates/home_status.yaml | 12 +++---- zwcfg_0xd89c4f0c.xml | 72 +++++++++++++++++++------------------- 3 files changed, 54 insertions(+), 42 deletions(-) diff --git a/packages/weather.yaml b/packages/weather.yaml index c1cad31..5873ae8 100644 --- a/packages/weather.yaml +++ b/packages/weather.yaml @@ -122,6 +122,18 @@ weather: - platform: darksky api_key: !secret darksky_api_key +iqvia: + zip_code: !secret zip_code + monitored_conditions: + - allergy_average_forecasted + - allergy_index_today + - allergy_index_tomorrow + - asthma_average_forecasted + - asthma_index_today + - asthma_index_tomorrow + - disease_average_forecasted + - disease_index_today + sensor: - platform: darksky api_key: !secret darksky_api_key diff --git a/templates/home_status.yaml b/templates/home_status.yaml index d189975..fd90d48 100644 --- a/templates/home_status.yaml +++ b/templates/home_status.yaml @@ -136,7 +136,7 @@ {%- macro weather_update() -%} {% if states('sensor.dark_sky_minutely_summary') |lower != "unknown" %} {% if '.' in states('sensor.dark_sky_minutely_summary') %} - It is going to be {{ states('sensor.dark_sky_minutely_summary') }} + It is going to be {{ states('sensor.dark_sky_minutely_summary') |replace("min.", "minutes")}}. {% else %} It is going to be {{ states('sensor.dark_sky_minutely_summary') }}. {% endif %} @@ -148,12 +148,12 @@ {# Only notify pollen levels in spring #} {%- macro pollen_levels() -%} - {% if states('sensor.season') | lower == "spring" %} - {% if states('sensor.pollen_level') | lower != "low" and - states('sensor.pollen_level') | lower != "unknown" %} - Pollen level is {{ states('sensor.pollen_level') }}. + {% if states('sensor.season') | lower == "spring" %} + Pollen level for today is {{ state_attr('sensor.allergy_index_today', 'rating') -}}. + {%- if states('sensor.allergy_index_tomorrow') | float > 7.0 -%} + Tomorrow's pollen levels are going to be Medium to High. + {%- endif -%} {% endif %} - {% endif %} {%- endmacro -%} {# Drone Flying Weather #} diff --git a/zwcfg_0xd89c4f0c.xml b/zwcfg_0xd89c4f0c.xml index c48da99..2516595 100644 --- a/zwcfg_0xd89c4f0c.xml +++ b/zwcfg_0xd89c4f0c.xml @@ -22,7 +22,7 @@ - + @@ -34,10 +34,10 @@ - - + + - + @@ -168,7 +168,7 @@ - + @@ -216,9 +216,9 @@ - - - + + + @@ -490,7 +490,7 @@ - + @@ -601,7 +601,7 @@ - + @@ -612,7 +612,7 @@ - + @@ -635,7 +635,7 @@ - + @@ -728,9 +728,9 @@ - - - + + + @@ -974,7 +974,7 @@ - + @@ -1006,12 +1006,12 @@ - - - - - - + + + + + + @@ -1181,7 +1181,7 @@ - + @@ -1190,8 +1190,8 @@ - - + + @@ -1703,7 +1703,7 @@ - + @@ -2038,7 +2038,7 @@ - + @@ -2132,7 +2132,7 @@ - + @@ -2341,7 +2341,7 @@ - + @@ -2381,7 +2381,7 @@ - + @@ -2405,9 +2405,9 @@ - + - + @@ -2653,7 +2653,7 @@ - + @@ -2666,7 +2666,7 @@ - + @@ -2681,7 +2681,7 @@ - + @@ -2704,7 +2704,7 @@ - +