From fede276214b0ac4289f47761b3eb63ec7cc18a7a Mon Sep 17 00:00:00 2001
From: Tony Stork
{% if states('sensor.weatheralerts_active_alerts') > '0' %} "Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weatheralerts_active_alerts') }}. They are as follows. " - {% if is_state('sensor.weatheralerts_alert_1','on') %} - "{{ state_attr('sensor.weatheralerts_alert_1','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_2','on') %} - "{{ state_attr('sensor.weatheralerts_alert_2','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_3','on') %} - "{{ state_attr('sensor.weatheralerts_alert_3','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_4','on') %} - "{{ state_attr('sensor.weatheralerts_alert_4','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_5','on') %} - "{{ state_attr('sensor.weatheralerts_alert_5','alert_event') }}" - {% endif %} + {{ states('sensor.weather_alert_string') }}. {% endif %}
diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index 93c91f9..911d10f 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -74,21 +74,7 @@
{% if states('sensor.weatheralerts_active_alerts') > '0' %} "Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weatheralerts_active_alerts') }}. They are as follows. " - {% if is_state('sensor.weatheralerts_alert_1','on') %} - "{{ state_attr('sensor.weatheralerts_alert_1','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_2','on') %} - "{{ state_attr('sensor.weatheralerts_alert_2','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_3','on') %} - "{{ state_attr('sensor.weatheralerts_alert_3','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_4','on') %} - "{{ state_attr('sensor.weatheralerts_alert_4','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_5','on') %} - "{{ state_attr('sensor.weatheralerts_alert_5','alert_event') }}" - {% endif %} + {{ states('sensor.weather_alert_string') }}. {% endif %}
diff --git a/templates/speech/weather_briefing_full.yaml b/templates/speech/weather_briefing_full.yaml index 81b57ad..e1c649e 100644 --- a/templates/speech/weather_briefing_full.yaml +++ b/templates/speech/weather_briefing_full.yaml @@ -29,21 +29,7 @@{% if states('sensor.weatheralerts_active_alerts') > '0' %} "Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weatheralerts_active_alerts') }}. They are as follows. " - {% if is_state('sensor.weatheralerts_alert_1','on') %} - "{{ state_attr('sensor.weatheralerts_alert_1','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_2','on') %} - "{{ state_attr('sensor.weatheralerts_alert_2','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_3','on') %} - "{{ state_attr('sensor.weatheralerts_alert_3','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_4','on') %} - "{{ state_attr('sensor.weatheralerts_alert_4','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_5','on') %} - "{{ state_attr('sensor.weatheralerts_alert_5','alert_event') }}" - {% endif %} + {{ states('sensor.weather_alert_string') }}. {% endif %}
diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml index e34522f..ed5b580 100644 --- a/templates/speech/welcome_home.yaml +++ b/templates/speech/welcome_home.yaml @@ -76,21 +76,7 @@{% if states('sensor.weatheralerts_active_alerts') > '0' %} "Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weatheralerts_active_alerts') }}. They are as follows. " - {% if is_state('sensor.weatheralerts_alert_1','on') %} - "{{ state_attr('sensor.weatheralerts_alert_1','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_2','on') %} - "{{ state_attr('sensor.weatheralerts_alert_2','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_3','on') %} - "{{ state_attr('sensor.weatheralerts_alert_3','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_4','on') %} - "{{ state_attr('sensor.weatheralerts_alert_4','alert_event') }}" - {% endif %} - {% if is_state('sensor.weatheralerts_alert_5','on') %} - "{{ state_attr('sensor.weatheralerts_alert_5','alert_event') }}" - {% endif %} + {{ states('sensor.weather_alert_string') }}. {% endif %}