Overhaul presentation of general weather information

This commit is contained in:
2023-01-16 19:44:53 -05:00
parent c51679f69d
commit 93e4627a83
4 changed files with 80 additions and 108 deletions

View File

@ -20,56 +20,8 @@
</p>
<p>
{% if is_state('sensor.clothing_forecast', 'Freezing') %}
It is going to be freezing today. so I suggest wearing long pants and a heavy coat.
{% elif is_state('sensor.clothing_forecast','Cold') %}
It is going to be cold today. so I suggest wearing long pants and a light jacket.
{% elif is_state('sensor.clothing_forecast', 'Chilly') %}
It is going to be chilly today. so I suggest wearing at least long pants.
{% elif is_state('sensor.clothing_forecast', 'Nice') %}
It is going to be
{{ [ 'pretty nice outside. ',
'a good day to be outside. ',
'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. ',
' almost too hot outside. ',
' a little warm today. ',
] | random }}
So I suggest wearing shorts.
{% elif is_state('sensor.clothing_forecast', 'Hot') %}
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 }}
So I suggest wearing shorts.
{% else %}
It is going to be {{ states.sensor.clothing_forecast.state }} today so I suggest wearing shorts.
{% endif %}
{% set hightemp = state_attr('sensor.current_forecast','high_temp') | float %}
{% if hightemp > 84 %}
Warning, today will be a very sweaty day, so you need to remember to stay hydrated.
{% endif %}
Today the high temperature will be {{ state_attr('sensor.current_forecast','high_temp') }} degrees.
{{ states('sensor.clothing_forecast_detail') }}
</p>
<p>