Added ability for briefings to read out active weather alerts

This commit is contained in:
2022-11-05 13:47:00 -04:00
parent a7e6761765
commit 15b22e4857
6 changed files with 95 additions and 44 deletions

Submodule node-red/projects/NerdFlows updated: 26062d4257...6e4ad7b9e6

View File

@ -55,8 +55,23 @@
and {{ states.weather.iron_nerd_weather_station.state }} and {{ states.weather.iron_nerd_weather_station.state }}
{% endif %} {% endif %}
{% if states.sensor.weatheralerts_active_alerts.state | int > 0 %} {% if states('sensor.weatheralerts_active_alerts') > '0' %}
There are currently {{ states.sensor.weatheralerts_active_alerts.state }} active weather alerts for our area. "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 %}
{% endif %} {% endif %}
</p> </p>

View File

@ -42,8 +42,23 @@
It is currently {{states.weather.iron_nerd_weather_station.state}} and {{states.sensor.pirateweather_temperature.state|round}} degrees in Defiance. It is currently {{states.weather.iron_nerd_weather_station.state}} and {{states.sensor.pirateweather_temperature.state|round}} degrees in Defiance.
</p> </p>
<p> <p>
{% if states.sensor.weatheralerts_active_alerts.state | int > 0 %} {% if states('sensor.weatheralerts_active_alerts') > '0' %}
There are currently {{states.sensor.weatheralerts_active_alerts.state }} active weather alerts for our area. "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 %}
{% endif %} {% endif %}
</p> </p>
<p> <p>

View File

@ -31,6 +31,27 @@
{% endif %} {% endif %}
</p> </p>
<p>
{% 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 %}
{% endif %}
</p>
<p> <p>
{% if is_state('sensor.garbage_collection_large_pickup','1') %} {% if is_state('sensor.garbage_collection_large_pickup','1') %}
'Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all large garbage items tonight, and do not forget the trash can!' 'Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all large garbage items tonight, and do not forget the trash can!'

View File

@ -12,6 +12,27 @@
{{ states('sensor.clothing_forecast_detail') }} {{ states('sensor.clothing_forecast_detail') }}
</p> </p>
<p>
{% 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 %}
{% endif %}
</p>
{%- endmacro -%} {%- endmacro -%}

View File

@ -62,49 +62,28 @@
</p> </p>
<p> <p>
{{ [ {% if states('sensor.weatheralerts_active_alerts') > '0' %}
"As you are no doubt aware, ", "Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weatheralerts_active_alerts') }}. They are as follows. "
"Even though you just came in from out there, I feel compelled to inform you that ", {% if is_state('sensor.weatheralerts_alert_1','on') %}
"In case you weren't paying attention, ", "{{ state_attr('sensor.weatheralerts_alert_1','alert_event') }}"
"If you were wondering, ",
"In case you are suddenly immune to weather effects, "
] | random }}
"the weather outside is {{ state_attr('weather.iron_nerd_weather_station','temperature') | round }} degrees"
{% if is_state('weather.iron_nerd_weather_station','rainy') %}
{{ [
'with rain.',
'with showers.'
] | random }}
{% elif is_state('weather.iron_nerd_weather_station','cloudy') %}
{{ [
'with clouds.',
'with cloudy skies.'
] | random }}
{% elif is_state('weather.iron_nerd_weather_station','partlycloudy') %}
{{ [
'with some clouds.',
'with partly cloudy skies.',
'with scattered clouds.'
] | random }}
{% elif is_state('weather.iron_nerd_weather_station','sunny') %}
{% if is_state('sun.sun','above_horizon') %}
{{ [
'and sunny.',
'with sun.'
] | random }}
{% else %}
{{ [
'and clear.',
'with clear skies.'
] | random }}
{% endif %} {% endif %}
{% else %} {% if is_state('sensor.weatheralerts_alert_2','on') %}
and {{ states.weather.iron_nerd_weather_station.state }} "{{ state_attr('sensor.weatheralerts_alert_2','alert_event') }}"
{% endif %} {% 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 %}
{% endif %}
</p> </p>
<p> <p>
"However, inside the house " "The current climate control situation is as follows. "
{% if is_state('input_boolean.master_bedroom_aircon_installed','on') %} {% 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 currently {{ state_attr('climate.master_bedroom_aircon','current_temperature') }} degrees. "
{% if is_state('climate.master_bedroom_aircon','cool') %} {% if is_state('climate.master_bedroom_aircon','cool') %}