Compare commits

...

3 Commits

View File

@@ -865,30 +865,30 @@ template:
icon: mdi:weather-sunny
state: >-
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% macro getReport() %}
{{ [
'Today in Defiance ',
'Later Today ',
'For the rest of the day '
] | random }}
expect a high of {{ states('sensor.todays_high_temp') }}
{%- if states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','off')%}
{% if states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','off')%}
{{ [
'and sunny. ',
'with sun. ',
'with sunny conditions prevailing. '
] | random }}
{%- elif states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','on') %}
{% elif states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','on') %}
{{ [
'and clear. ',
'with clear skies. '
] | random }}
{%- elif states('sensor.current_forecast') == 'clear-night' %}
{% elif states('sensor.current_forecast') == 'clear-night' %}
{{ [
'and clear. ',
'with clear skies. '
] | random }}
{%- elif states('sensor.current_forecast') == 'rainy' %}
{% elif states('sensor.current_forecast') == 'rainy' %}
{{ [
'with rain. ',
'with showers. ',
@@ -900,7 +900,7 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'snowy' %}
{% elif states('sensor.current_forecast') == 'snowy' %}
{{ [
'with snow. ',
'with snow showers. '
@@ -911,19 +911,19 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'snowy-rainy' %}
{% elif states('sensor.current_forecast') == 'snowy-rainy' %}
{{ [
'with mix preciptation possible. ',
'with snow and rain showers. '
] | random }}
Total accumulation near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'windy' %}
{% elif states('sensor.current_forecast') == 'windy' %}
{{ [
'and windy. ',
'with lots of wind. '
] | random }}
{%- elif states('sensor.current_forecast') == 'fog' %}
{% elif states('sensor.current_forecast') == 'fog' %}
{{ [
'and foggy. ',
'with some fog. '
@@ -939,7 +939,7 @@ template:
'with partly cloudy skies. ',
'with scattered clouds '
] | random }}
{%- elif states('sensor.current_forecast') == 'hail' %}
{% elif states('sensor.current_forecast') == 'hail' %}
{{ [
'with severe thunderstorms possible. ',
'with hail possible. '
@@ -950,7 +950,7 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'lightning' %}
{% elif states('sensor.current_forecast') == 'lightning' %}
{{ [
'with thunderstorms possible. ',
'with the potential of thunderstorms. '
@@ -961,14 +961,14 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{% endif -%}
{% endif %}
{{ [
'Later tonight expect a low of ',
'Overnight expect a low of '
] | random }}
{{ states('sensor.overnight_lowest_temperature') }} degrees.
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% endmacro %}
{{ cleanup(getReport()) }}
- name: Tomorrows Forecast
unique_id: a8ae26b0-ed26-4568-bb2b-f7c72707b009
icon: mdi:weather-sunny
@@ -996,20 +996,20 @@ template:
icon: mdi:weather-sunny
state: >-
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% macro getReport() %}
{{ [
'Tomorrow in Defiance ',
'For the next day ',
'Tomorrow '
] | random }}
expect a high of {{ state_attr('sensor.tomorrow_forecast','high_temp') }} degrees.
{%- if states('sensor.tomorrow_forecast') == 'sunny' %}
{% if states('sensor.tomorrow_forecast') == 'sunny' %}
{{ [
'and sunny. ',
'with sun. ',
'with sunny conditions prevailing. '
] | random }}
{%- elif states('sensor.tomorrow_forecast') == 'rainy' %}
{% elif states('sensor.tomorrow_forecast') == 'rainy' %}
{{ [
'with rain. ',
'with showers. ',
@@ -1021,7 +1021,7 @@ template:
] | random }}
near {{ state_attr('sensor.tomorrow_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.tomorrow_forecast') == 'snowy' %}
{% elif states('sensor.tomorrow_forecast') == 'snowy' %}
{{ [
'with snow. ',
'with snow showers. '
@@ -1032,19 +1032,19 @@ template:
] | random }}
near {{ state_attr('sensor.tomorrow_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.tomorrow_forecast') == 'snowy-rainy' %}
{% elif states('sensor.tomorrow_forecast') == 'snowy-rainy' %}
{{ [
'with mix preciptation possible. ',
'with snow and rain showers. '
] | random }}
Total accumulation near {{ state_attr('sensor.tomorrow_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.tomorrow_forecast') == 'windy' %}
{% elif states('sensor.tomorrow_forecast') == 'windy' %}
{{ [
'and windy. ',
'with lots of wind. '
] | random }}
{%- elif states('sensor.current_forecast') == 'fog' %}
{% elif states('sensor.current_forecast') == 'fog' %}
{{ [
'and foggy. ',
'with some fog. '
@@ -1060,7 +1060,7 @@ template:
'with partly cloudy skies. ',
'with scattered clouds '
] | random }}
{%- elif states('sensor.tomorrow_forecast') == 'hail' %}
{% elif states('sensor.tomorrow_forecast') == 'hail' %}
{{ [
'with severe thunderstorms possible. ',
'with hail possible. '
@@ -1071,7 +1071,7 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'lightning' %}
{% elif states('sensor.current_forecast') == 'lightning' %}
{{ [
'with thunderstorms possible. ',
'with the potential of thunderstorms. '
@@ -1082,19 +1082,19 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{% endif -%}
{% endif %}
{{ [
' Tomorrow night expect a low of '
] | random }}
{{ state_attr('sensor.tomorrow_forecast','overnight_low') }} degrees.
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% endmacro %}
{{ cleanup(getReport()) }}
- name: Current Conditions
unique_id: 70db7e57-08db-48b2-919b-03b5face37b9
icon: mdi:weather-sunny
state: >-
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% macro getReport() %}
The Weather in Defiance
{{ [
' is ',
@@ -1132,14 +1132,14 @@ template:
{% else %}
and {{ states.weather.iron_nerd_weather_station.state }}
{% endif %}
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% endmacro %}
{{ cleanup(getReport()) }}
- name: Current Conditions Detail
unique_id: 2b3687d1-bdd5-4551-8c0a-05b1ff617543
icon: mdi:weather-sunny
state: >-
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% macro getReport() %}
The Weather in Defiance
{{ [
' is ',
@@ -1177,29 +1177,29 @@ template:
{% else %}
and {{ states.weather.iron_nerd_weather_station.state }}.
{% endif %}
{%- if is_state('binary_sensor.early_night_mode','off')%}
{% if is_state('binary_sensor.early_night_mode','off')%}
{{ [
'Later Today ',
'For the rest of the day '
] | random }}
expect a high of {{ states('sensor.todays_high_temp') }}
{%- if states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','off')%}
{% if states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','off')%}
{{ [
'and sunny. ',
'with sun. ',
'with sunny conditions prevailing. '
] | random }}
{%- elif states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','on') %}
{% elif states('sensor.current_forecast') == 'sunny' and is_state('binary_sensor.night','on') %}
{{ [
'and clear. ',
'with clear skies. '
] | random }}
{%- elif states('sensor.current_forecast') == 'clear-night' %}
{% elif states('sensor.current_forecast') == 'clear-night' %}
{{ [
'and clear. ',
'with clear skies. '
] | random }}
{%- elif states('sensor.current_forecast') == 'rainy' %}
{% elif states('sensor.current_forecast') == 'rainy' %}
{{ [
'with rain. ',
'with showers. ',
@@ -1210,7 +1210,7 @@ template:
'Total Rainfall amounts '
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches {{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'snowy' %}
{% elif states('sensor.current_forecast') == 'snowy' %}
{{ [
'with snow. ',
'with snow showers. '
@@ -1221,18 +1221,18 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'snowy-rainy' %}
{% elif states('sensor.current_forecast') == 'snowy-rainy' %}
{{ [
'with mix preciptation possible. ',
'with snow and rain showers. '
] | random }}
Total accumulation near {{ state_attr('sensor.current_forecast','precipitation') }} inches {{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'windy' %}
{% elif states('sensor.current_forecast') == 'windy' %}
{{ [
'and windy. ',
'with lots of wind. '
] | random }}
{%- elif states('sensor.current_forecast') == 'fog' %}
{% elif states('sensor.current_forecast') == 'fog' %}
{{ [
'and foggy. ',
'with some fog. '
@@ -1248,7 +1248,7 @@ template:
'with partly cloudy skies. ',
'with scattered clouds. '
] | random }}
{%- elif states('sensor.current_forecast') == 'hail' %}
{% elif states('sensor.current_forecast') == 'hail' %}
{{ [
'with severe thunderstorms possible. ',
'with hail possible. '
@@ -1259,7 +1259,7 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{%- elif states('sensor.current_forecast') == 'lightning' %}
{% elif states('sensor.current_forecast') == 'lightning' %}
{{ [
'with thunderstorms possible. ',
'with the potential of thunderstorms. '
@@ -1270,21 +1270,21 @@ template:
] | random }}
near {{ state_attr('sensor.current_forecast','precipitation') }} inches
{{ 'possible. ' }}
{% endif -%}
{% endif %}
{{ [
'Later tonight expect a low of ',
'Overnight expect a low of '
] | random }}
{{ states('sensor.overnight_lowest_temperature') }} degrees.
{%- else -%}
{% else %}
{{ [
'Tonight expect a low of ',
'Overnight expect a low of '
] | random }}
{{ states('sensor.overnight_lowest_temperature') }} degrees.
{% endif %}
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% endmacro %}
{{ cleanup(getReport()) }}
- name: 'Outside Pressure'
unique_id: ac2944bb-e9d7-40a3-9707-ef477fd5f309
state: '{{ state_attr(''weather.iron_nerd_weather_station'',''pressure'') }}'
@@ -1317,44 +1317,48 @@ template:
- name: "Clothing Forecast"
unique_id: 8ed2684b-d0ad-402c-bc3c-340cb9b2437a
state: >-
{% if is_state('binary_sensor.overnight', 'off') %}
{% set temp = states('sensor.todays_high_temp')|int %}
{% if is_state('binary_sensor.overnight', 'off') %}
{% set temp = states('sensor.todays_high_temp')|int %}
{% else %}
{% set temp = state_attr('weather.iron_nerd_weather_station','temperature')|round %}
{% endif %}
{% if states('sensor.todays_high_temp')|int > 63 %}
{% if states('sensor.todays_high_temp')|int < 80 %}
Nice
{% elif states('sensor.todays_high_temp')|int > 90 %}
Hot
{% else %}
{% set temp = state_attr('weather.iron_nerd_weather_station','temperature')|round %}
Toasty
{% endif %}
{%- if states('sensor.todays_high_temp')|int > 63 %}
{%- if states('sensor.todays_high_temp')|int < 80 %}
Nice
{% elif states('sensor.todays_high_temp')|int > 90 %}
Hot
{% else %}
Toasty
{%- endif %}
{% elif states('sensor.todays_high_temp')|int < 64 %}
{%- if states('sensor.todays_high_temp')|int < 32 %}
Freezing
{% elif states('sensor.todays_high_temp')|int > 48 %}
Chilly
{% else %}
Cold
{%- endif %}
{% elif states('sensor.todays_high_temp')|int < 64 %}
{% if states('sensor.todays_high_temp')|int < 32 %}
Freezing
{% elif states('sensor.todays_high_temp')|int > 48 %}
Chilly
{% else %}
Unknown
{%- endif %}
Cold
{% endif %}
{% else %}
Unknown
{% endif %}
- name: "Clothing Forecast Detail"
unique_id: 13065f50-5eef-4afd-830e-2a2c87f47496
state: >-
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% macro getReport() %}
{% set clothing = states('sensor.clothing_forecast') %}
{% set forecast = states('sensor.current_forecast') %}
{% set weather = states('weather.iron_nerd_weather_station') %}
{% set apparent = state_attr('weather.iron_nerd_weather_station','apparent_temperature') %}
{% if is_state('binary_sensor.morning','on') %}
Based on the forecasted high temperature,
{% if is_state('sensor.clothing_forecast', 'Freezing') %}
{% if clothing == "Freezing" %}
You're gonna freeze your balls off out there. so I suggest wearing long pants and a heavy coat.
{% elif is_state('sensor.clothing_forecast','Cold') %}
{% elif clothing == "Cold" %}
It's gonna be cold as balls today. so I suggest wearing long pants and a light jacket.
{% elif is_state('sensor.clothing_forecast', 'Chilly') %}
{% elif clothing == "Chilly" %}
It's gonna be on the chilly side today. so I suggest wearing at least long pants.
{% elif is_state('sensor.clothing_forecast', 'Nice') %}
{% elif clothing == "Nice" %}
It is going to be
{{ [ 'pretty nice outside. ',
'a good day to be outside. ',
@@ -1362,7 +1366,7 @@ template:
'downright tolerable outside. ',
] | random }}
So I suggest wearing shorts.
{% elif is_state('sensor.clothing_forecast', 'Toasty') and is_state('sensor.current_forecast', 'sunny') %}
{% elif clothing == "Toasty" and forecast == "sunny" %}
It is going to be
{{ [ 'on the warm side ',
' rather warm outside ',
@@ -1374,7 +1378,7 @@ template:
'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') %}
{% elif clothing == "Hot" and forecast == "sunny" %}
It is going to be
{{ [ 'so hot you will sweat your balls off',
'hotter than the sun ',
@@ -1385,7 +1389,7 @@ template:
'preparing to bake under the sun.',
'getting ready to be cooked alive.',
] | random }}
{% elif is_state('sensor.clothing_forecast', 'Toasty') %}
{% elif clothing == "Toasty" %}
It is going to be
{{ [ 'on the warm side ',
' rather warm outside ',
@@ -1393,7 +1397,7 @@ template:
' a little warm ',
] | random }}
today. So I suggest wearing shorts.
{% elif is_state('sensor.clothing_forecast', 'Hot') %}
{% elif clothing == "Hot" %}
It is going to be
{{ [ 'so hot you will sweat your balls off',
'hotter than the sun ',
@@ -1402,7 +1406,7 @@ template:
] | random }}
today. So I suggest wearing shorts.
{% else %}
It is going to be {{ states('sensor.clothing_forecast') }} today so I suggest wearing shorts.
It is going to be {{ clothing }} today so I suggest wearing shorts.
{% endif %}
{% if is_state('input_boolean.hot_day','on') %}
Warning, today will be a very sweaty day, so please remember to stay hydrated!
@@ -1412,14 +1416,14 @@ template:
{% endif %}
{% else %}
Based on the current temperature,
{% if is_state('sensor.clothing_forecast', 'Freezing') %}
{% if clothing == "Freezing" %}
You're gonna freeze your balls off out there. so I suggest wearing long pants and a heavy coat if you are going out.
{% elif is_state('sensor.clothing_forecast','Cold') %}
{% elif clothing == "Cold" %}
It is cold as balls outside. so I suggest wearing long pants and a light jacket.
{% elif is_state('sensor.clothing_forecast', 'Chilly') %}
{% elif clothing == "Chilly" %}
It is chilly right now. so I suggest wearing at least long pants
if you are going to venture outside.
{% elif is_state('sensor.clothing_forecast', 'Nice') %}
{% elif clothing == "Nice" %}
It is
{{ [ 'pretty nice outside. ',
'a good day to be outside. ',
@@ -1427,7 +1431,7 @@ template:
'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') %}
{% elif clothing == "Toasty" and weather == "sunny" %}
It is
{{ [ 'on the warm side ',
' rather warm ',
@@ -1439,7 +1443,7 @@ template:
'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') %}
{% elif clothing == "Hot" and weather == "sunny" %}
It is
{{ [ 'so hot you will sweat your balls off',
'hotter than the sun ',
@@ -1450,7 +1454,7 @@ template:
'preparing to bake under the sun.',
'getting ready to be cooked alive.',
] | random }}
{% elif is_state('sensor.clothing_forecast', 'Toasty') %}
{% elif clothing == "Toasty" %}
It is
{{ [ 'on the warm side ',
' rather warm ',
@@ -1458,7 +1462,7 @@ template:
' a little warm ',
] | random }}
outside. So I suggest wearing shorts.
{% elif is_state('sensor.clothing_forecast', 'Hot') %}
{% elif clothing == "Hot" %}
It is
{{ [ 'so hot you will sweat your balls off',
'hotter than the sun ',
@@ -1467,13 +1471,13 @@ template:
] | random }}
outside. So I suggest wearing shorts.
{% else %}
It is {{ states('sensor.clothing_forecast') }} right now so I suggest wearing shorts.
It is {{ clothing }} right now so I suggest wearing shorts.
{% endif %}
{% if is_state('binary_sensor.heat_index_threshold','on') %}
Warning, the heat index is {{ states('sensor.stratton_ave_apparent_temperature') | float | round }} degrees right now, which is very high. So please make sure to stay hydrated!
Warning, the heat index is {{ apparent | int }} degrees right now, which is very high. So please make sure to stay hydrated!
{% endif %}
{% if is_state('binary_sensor.wind_chill_threshold','on') %}
Warning, it currently feels like {{ states('sensor.stratton_ave_apparent_temperature') | float | round }} degrees outside, so please make sure all exposed skin is covered to avoid frostbite!
Warning, it currently feels like {{ apparent | int }} degrees outside, so please make sure all exposed skin is covered to avoid frostbite!
{% endif %}
{% endif %}
{% if states('sensor.thermal_comfort_simmerindex') in ['extremely_warm','danger_of_heatstroke','extreme_danger_of_heatstroke','circulatory_collapse_imminent'] %}
@@ -1493,8 +1497,8 @@ template:
{% elif is_state('sensor.thermal_comfort_frostrisk','probable') %}
"The possibility of frost exists currently. Be prepared. "
{% endif %}
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% endmacro %}
{{ cleanup(getReport()) }}
# current_inside_humidity:
# - name: "Current Inside Humidity"
@@ -1513,7 +1517,7 @@ template:
unique_id: 66b5f020-0b5e-48ed-92a2-740d2d708b30
state: >
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% macro getReport() %}
{% set alerts = [
states('sensor.weatheralerts_alert_1_most_recent_active_alert'),
states('sensor.weatheralerts_alert_2_most_recent_active_alert'),
@@ -1532,8 +1536,8 @@ template:
{% else %}
'None'
{% endif %}
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% endmacro %}
{{ cleanup(getReport()) }}
attributes:
active_alerts: "{{ states('sensor.weatheralerts_active_alerts') }}"
icon: >
@@ -1546,7 +1550,7 @@ template:
unique_id: e2f51da4-2271-4719-8edf-a28f76ac1e3f
state: >
{% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%}
{% macro getReport() %}
{% set alerts = [
states('sensor.weatheralerts_alert_1_most_recent_active_alert'),
states('sensor.weatheralerts_alert_2_most_recent_active_alert'),
@@ -1558,8 +1562,8 @@ template:
{% set flood = alerts | reject ('eq','unavailable') | select('eq','Flood Warning') | list | count | int %}
{% set flood1 = 1 if (flood > 0) else 0 %}
{{ (main + flood1) | int }}
{%- endmacro -%}
{{- cleanup(getReport()) -}}
{% endmacro %}
{{ cleanup(getReport()) }}
icon: >
{% if (states('sensor.weatheralerts_active_alerts') | int ) > 0 %}
mdi:alert