diff --git a/custom_templates/weather.jinja b/custom_templates/weather.jinja index 036799b..6d1f8b8 100644 --- a/custom_templates/weather.jinja +++ b/custom_templates/weather.jinja @@ -35,8 +35,14 @@ {% endif %} {% elif method == 'tts' %} {% if type in ['alerts','full'] %} + {% set alerts = states('sensor.weather_alerts_active_corrected') %} + {% if alerts == '1' %} + {% set alertStrings = ['is','alert','It is'] %} + {% else %} + {% set alertStrings = ['are','alerts','They are'] %} + {% endif %} {% if states('sensor.weatheralerts_active_alerts') > '0' %} - "Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weather_alerts_active_corrected') }}. They are as follows. " + "There {{ alertStrings[0] }} {{ alerts }} weather {{ alertStrings[1] }} active. {{ alertStrings[2] }}, " {{ states('sensor.weather_alert_string') }}. {% endif %} {% if is_state('input_boolean.tornado_alarm','on') %} diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index 744363e..c155197 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -97,11 +97,7 @@

{% if states('input_select.scheduled_climate_mode_master_bedroom_aircon') != 'N/A' or states('input_select.scheduled_climate_mode_master_bedroom_fan') != 'N/A' %} {% if not is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','N/A') %} - {% if is_state('climate.master_bedroom_aircon','fan_only') %} - "The master bedroom air conditioner is already running in fan only mode. " - {% elif states('climate.master_bedroom_aircon') not in ['off','unknown','unavailable'] %} - "The master bedroom air conditioner is already running in {{ states('climate.master_bedroom_aircon') }} mode. " - {% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','AC') and is_state('input_boolean.hot_day','on') %} + {% if is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','AC') and is_state('input_boolean.hot_day','on') %} "Today was a hot day, so the master bedroom air conditioner will start cooling a bit earlier tonight at {{ input_datetime_read('input_datetime.master_bedroom_cooling') }}. " {% elif is_state('input_select.scheduled_climate_mode_master_bedroom_aircon','AC') %} "The master bedroom air conditioner will start cooling at {{ input_datetime_read('input_datetime.master_bedroom_cooling') }}. " diff --git a/templates/speech/weather_briefing_full.yaml b/templates/speech/weather_briefing_full.yaml index beea4a0..f42fc8a 100644 --- a/templates/speech/weather_briefing_full.yaml +++ b/templates/speech/weather_briefing_full.yaml @@ -37,9 +37,11 @@

+ {% set alerts = states('weather_alerts_active_corrected') %} {% if states('sensor.weatheralerts_active_alerts') > '0' %} - "Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weather_alerts_active_corrected') }}. They are as follows. " - {{ states('sensor.weather_alert_string') }}. + "There {% if alerts == '1' %}is{% else %}are{% endif %} {{ states('sensor.weather_alerts_active_corrected') }} weather {% if alerts == '1' %}alert{% else %}alerts{% endif %} active. " + "{% if alerts == '1' %}It is{% else %}They are{% endif %}, " + {{ states('sensor.weather_alert_string') }}. {% endif %} {% if (state_attr('weather.iron_nerd_weather_station','visibility') | int ) < 3 %} {{ [ diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml index 39f0b1c..9a3471c 100644 --- a/templates/speech/welcome_home.yaml +++ b/templates/speech/welcome_home.yaml @@ -68,22 +68,25 @@

{% if (states('sensor.climate_devices_installed') | int) > 0 %} - "The current climate control situation is as follows. " + "In climate control news, " {% if is_state('input_boolean.master_bedroom_aircon_installed','on') %} - "the master bedroom temperature is currently {{ state_attr('climate.master_bedroom_aircon','current_temperature') }} degrees. " + "the master bedroom temperature is {{ state_attr('climate.master_bedroom_aircon','current_temperature') }} degrees. " {% if is_state('climate.master_bedroom_aircon','cool') %} - "and the master bedroom air conditioner is currently set for cooling to {{ state_attr('climate.master_bedroom_aircon','temperature') }} degrees. " + "and the master bedroom air conditioner is set for cooling to {{ state_attr('climate.master_bedroom_aircon','temperature') }} degrees. " {% elif is_state('climate.master_bedroom_aircon','fan_only') %} - "and the master bedroom air conditioner is currently in fan only mode. " + "and the master bedroom air conditioner is in fan only mode. " {% elif is_state('climate.master_bedroom_aircon','dry') %} - "and the master bedroom air conditioner is currently moonlighting as a dehumidifier. " + "and the master bedroom air conditioner is moonlighting as a dehumidifier. " {% elif is_state('climate.master_bedroom_aircon','auto') %} "and the master bedroom air conditioner is making its own decisions. Be afraid, be very afraid. " {% else %} "and the master bedroom air conditioner is currently not speaking to me. Was it something I said? " {% endif %} {% else %} - "There is no air conditioner or temperature sensor currently installed in the master bedroom. " + "There is no air conditioner or temperature sensor installed in the master bedroom. " + {% endif %} + {% if is_state('input_boolean.emma_bedroom_aircon_installed','on') %} + "Emma's air conditioner is {{ states('fan.emma_air_conditioner') }}. " {% endif %} {% endif %}

@@ -106,9 +109,9 @@ "Tina has work today. " {% endif %} {% if is_state('input_boolean.kallen_at_school','on') %} - "Kallen is at school right now. His pickup time will be at {{ input_datetime_read('input_datetime.kallen_school_day_end') }}. " + "Collin is at school right now. His pickup time will be at {{ input_datetime_read('input_datetime.kallen_school_day_end') }}. " {% elif is_state('input_boolean.kallen_school_today','on') %} - "Kallen has school today. " + "Collin has school today. " {% endif %}