Some weather-related changes to briefing scripts

This commit is contained in:
2022-05-11 17:30:17 -04:00
parent db9e1a671c
commit 0a76720d0c
2 changed files with 88 additions and 13 deletions

View File

@ -266,7 +266,7 @@ sensor:
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %}
{{ forecast.wind_speed }}
precipitation: >-
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %}
{% set forecast = state_attr('weather.iron_nerd_weather_station','forecast')[1] %}
{{ forecast.precipitation }}
tomorrow_forecast_detail:
friendly_name: Tomorrow Forecast Detail
@ -384,11 +384,11 @@ sensor:
value_template: >-
{%- macro getReport() -%}
The Weather in Defiance
{{ [
{{ [
' is ',
' is currently '
] | random }}
{{states('sensor.pirateweather_temperature')|round}} degrees
{{states('sensor.pirateweather_temperature')|round}} degrees
{% if is_state('weather.iron_nerd_weather_station', 'rainy') %}
{{ [
'with rain. ',
@ -440,11 +440,11 @@ sensor:
value_template: >-
{%- macro getReport() -%}
The Weather in Defiance
{{ [
{{ [
' is ',
' is currently '
] | random }}
{{states('sensor.pirateweather_temperature')|round}} degrees
{{states('sensor.pirateweather_temperature')|round}} degrees
{% if is_state('weather.iron_nerd_weather_station', 'rainy') %}
{{ [
'with rain. ',
@ -627,7 +627,7 @@ sensor:
{%- if states('sensor.todays_high_temp')|int > 63 %}
{%- if states('sensor.todays_high_temp')|int < 80 %}
Nice
{% elif states('sensor.todays_high_temp')|int > 95 %}
{% elif states('sensor.todays_high_temp')|int > 90 %}
Hot
{% else %}
Toasty
@ -664,6 +664,29 @@ sensor:
'downright tolerable outside. ',
] | random }}
So I suggest wearing shorts.
{% elif is_state('sensor.clothing_forecast', 'Toasty') and is_state('sensor.current_forecast', 'sunny') %}
It is going to be
{{ [ 'on the warm side ',
' rather warm outside ',
' almost too hot outside ',
' a little warm ',
] | random }}
today, and very sunny. So I suggest wearing shorts and
{{ [ 'bringing your shades, hat, and maybe some sunscreen.',
'preparing to bake under the sun.',
'getting ready to be cooked alive.',
] | random }}
{% elif is_state('sensor.clothing_forecast', 'Hot') and is_state('sensor.current_forecast', 'sunny') %}
It is going to be
{{ [ 'so hot you\'ll sweat your balls off',
'hotter than the sun ',
'hotter than the inside of a volcano ',
] | random }}
today, and very sunny. So I suggest wearing shorts and
{{ [ 'bringing your shades, hat, and maybe some sunscreen.',
'preparing to bake under the sun.',
'getting ready to be cooked alive.',
] | random }}
{% elif is_state('sensor.clothing_forecast', 'Toasty') %}
It is going to be
{{ [ 'on the warm side ',
@ -677,11 +700,16 @@ sensor:
{{ [ 'so hot you\'ll sweat your balls off',
'hotter than the sun ',
'hotter than the inside of a volcano ',
'hotter than hell itself ',
] | random }}
today. So I suggest wearing shorts.
{% else %}
It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts.
{% endif %}
{% set high = state_attr('sensor.current_forecast','high_temp') %}
{% if high > 85 %}
Warning, today will be a very sweaty day, so please remember to stay hydrated!
{% endif %}
{% else %}
Based on the current temperature,
{% if is_state('sensor.clothing_forecast', 'Freezing') %}
@ -699,11 +727,34 @@ sensor:
'downright tolerable outside. ',
] | random }}
So I suggest wearing shorts.
{% elif is_state('sensor.clothing_forecast', 'Toasty') and is_state('weather.iron_nerd_weather_station','sunny') %}
It is
{{ [ 'on the warm side ',
' rather warm ',
' almost too hot ',
' a little warm ',
] | random }}
and very sunny outside. So I suggest wearing shorts and
{{ [ 'bringing your shades, hat, and maybe some sunscreen.',
'preparing to bake under the sun.',
'getting ready to be cooked alive.',
] | random }}
{% elif is_state('sensor.clothing_forecast', 'Hot') and is_state('weather.iron_nerd_weather_station','sunny') %}
It is
{{ [ 'so hot you\'ll sweat your balls off',
'hotter than the sun ',
'hotter than the inside of a volcano ',
] | random }}
and very sunny outside. So I suggest wearing shorts and
{{ [ 'bringing your shades, hat, and maybe some sunscreen.',
'preparing to bake under the sun.',
'getting ready to be cooked alive.',
] | random }}
{% elif is_state('sensor.clothing_forecast', 'Toasty') %}
It is
{{ [ 'on the warm side ',
' rather warm outside ',
' almost too hot outside ',
' rather warm ',
' almost too hot ',
' a little warm ',
] | random }}
outside. So I suggest wearing shorts.
@ -712,11 +763,16 @@ sensor:
{{ [ 'so hot you\'ll sweat your balls off',
'hotter than the sun ',
'hotter than the inside of a volcano ',
'hotter than hell itself ',
] | random }}
outside. So I suggest wearing shorts.
{% else %}
It is {{ states.sensor.clothing_forecast.state }} right now so I suggest wearing shorts.
{% endif %}
{% set heatindex = states('sensor.pirateweather_apparent_temperature') | float | round %}
{% if heatindex > 90 %}
Warning, the heat index is {{ heatindex }} degrees right now, which is very high. So please make sure to stay hydrated!
{% endif %}
{% endif %}
{%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}

View File

@ -13,7 +13,7 @@
'If you have not gotten dressed it is that time.',
'It is time to get your butt in gear. And your face too, ideally.',
'It is time to do the getting of readiness. And be nice to your mother!',
'In the words of the legendary Tom Brady, LETS GO!!!'
'In the words of the legendary Tom Brady, LETS GO!!!',
] | random }}
{% endif %}
</p>
@ -32,6 +32,21 @@
'rather enjoyable outside. ',
] | random }}
So I suggest wearing shorts.
{% elif is_state('sensor.clothing_forecast', 'Toasty') and is_state('sensor.current_forecast','sunny') %}
It is going to be
{{ [ ' rather warm outside. ',
' almost too hot outside. ',
' a little warm today. ',
] | random }}
and very sunny, so I suggest wearing shorts and maybe some sunscreen.
{% elif is_state('sensor.clothing_forecast', 'Hot') and is_state('sensor.current_forecast','sunny') %}
It is going to be
{{ [ 'hotter than the sun today. ',
'hotter than the sun outside. ',
'super hot today. ',
'hotter than the inside of a volcano today. Well not exactly, but you get the point. '
] | random }}
and very sunny, so I suggest wearing shorts and maybe some sunscreen.
{% elif is_state('sensor.clothing_forecast', 'Toasty') %}
It is going to be
{{ [ ' rather warm outside. ',
@ -49,7 +64,11 @@
So I suggest wearing shorts.
{% else %}
It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts.
{% endif %}
{% endif %}
{% set hightemp = state_attr('sensor.current_forecast','high_temp') | float %}
{% if hightemp > 85 %}
Warning, today will be a very sweaty day, so you need to remember to stay hydrated.
{% endif %}
</p>
<p>
@ -58,7 +77,7 @@
Today is the first day of school!
{% else %}
{{ [ 'Today is a school day.',
'It is a school day. '
'It is a school day. ',
] | random }}
{% endif %}
<s>Pickup today will be at {{(state_attr('input_datetime.school_day_end', 'timestamp') | int | timestamp_custom('%I:%M %p', False)) }}</s>
@ -73,9 +92,9 @@
And look at that. You do not have school today.
{{ [ 'Guess today would be a good day to clean your room.',
'You could always do some chores. HA, good one.',
'Want to play a nice game of chess? Sorry. I meant, want to play Dark Souls?',
'Want to play a nice game of chess? Sorry. I meant, want to play Beam NG?',
'I hope you enjoy your day off. You deserve it.',
'Today would be a good day to spend some time with mom and dad.'
'Today would be a good day to spend some time with mom and dad.',
] | random }}
{% endif %}