Fixing more things I shouldn't have to fix because Pirateweather
This commit is contained in:
@ -10,7 +10,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if type in ['forecast','full'] %}
|
{% if type in ['forecast','full'] %}
|
||||||
{% if 14400 <= ct <= 61200 %}
|
{% if 14400 <= ct <= 61200 %}
|
||||||
The forecast high is {{ states('sensor.todays_high_temp') }}.
|
The forecast high is {{ states('sensor.today_corrected_high_temp') }}.
|
||||||
{% else %}
|
{% else %}
|
||||||
Overnight you can expect a low of {{ states('sensor.overnight_lowest_temperature') }}.
|
Overnight you can expect a low of {{ states('sensor.overnight_lowest_temperature') }}.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -104,7 +104,7 @@ template:
|
|||||||
- name: Heat Warning
|
- name: Heat Warning
|
||||||
unique_id: 02b8020a-4fa1-4489-abea-bfadf82ec7e5
|
unique_id: 02b8020a-4fa1-4489-abea-bfadf82ec7e5
|
||||||
state: >
|
state: >
|
||||||
{% set day = states('sensor.todays_high_temp') | int %}
|
{% set day = states('sensor.today_corrected_high_temp') | int %}
|
||||||
{% set night = states('sensor.overnight_lowest_temperature') | int %}
|
{% set night = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
{% set dayThreshold = states('input_number.extended_heat_threshold') | int %}
|
{% set dayThreshold = states('input_number.extended_heat_threshold') | int %}
|
||||||
{% set nightThreshold = states('input_number.hot_overnight_threshold') | int %}
|
{% set nightThreshold = states('input_number.hot_overnight_threshold') | int %}
|
||||||
@ -113,7 +113,7 @@ template:
|
|||||||
device_class: heat
|
device_class: heat
|
||||||
attributes:
|
attributes:
|
||||||
trigger: >
|
trigger: >
|
||||||
{% set day = states('sensor.todays_high_temp') | int %}
|
{% set day = states('sensor.today_corrected_high_temp') | int %}
|
||||||
{% set night = states('sensor.overnight_lowest_temperature') | int %}
|
{% set night = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
{% set dayThreshold = states('input_number.extended_heat_threshold') | int %}
|
{% set dayThreshold = states('input_number.extended_heat_threshold') | int %}
|
||||||
{% set nightThreshold = states('input_number.hot_overnight_threshold') | int %}
|
{% set nightThreshold = states('input_number.hot_overnight_threshold') | int %}
|
||||||
@ -214,7 +214,7 @@ sensor:
|
|||||||
'Later Today ',
|
'Later Today ',
|
||||||
'For the rest of the day '
|
'For the rest of the day '
|
||||||
] | random }}
|
] | random }}
|
||||||
expect a high of {{ states('sensor.todays_high_temp') }}
|
expect a high of {{ states('sensor.today_corrected_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. ',
|
'and sunny. ',
|
||||||
@ -529,7 +529,7 @@ sensor:
|
|||||||
'Later Today ',
|
'Later Today ',
|
||||||
'For the rest of the day '
|
'For the rest of the day '
|
||||||
] | random }}
|
] | random }}
|
||||||
expect a high of {{ states('sensor.todays_high_temp') }}
|
expect a high of {{ states('sensor.today_corrected_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. ',
|
'and sunny. ',
|
||||||
@ -658,22 +658,22 @@ sensor:
|
|||||||
unique_id: 8ed2684b-d0ad-402c-bc3c-340cb9b2437a
|
unique_id: 8ed2684b-d0ad-402c-bc3c-340cb9b2437a
|
||||||
value_template: >-
|
value_template: >-
|
||||||
{% if is_state('binary_sensor.overnight', 'off') %}
|
{% if is_state('binary_sensor.overnight', 'off') %}
|
||||||
{% set temp = states('sensor.todays_high_temp')|int %}
|
{% set temp = states('sensor.today_corrected_high_temp')|int %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set temp = states('sensor.pirateweather_temperature')|round %}
|
{% set temp = states('sensor.pirateweather_temperature')|round %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- if states('sensor.todays_high_temp')|int > 63 %}
|
{%- if states('sensor.today_corrected_high_temp')|int > 63 %}
|
||||||
{%- if states('sensor.todays_high_temp')|int < 80 %}
|
{%- if states('sensor.today_corrected_high_temp')|int < 80 %}
|
||||||
Nice
|
Nice
|
||||||
{% elif states('sensor.todays_high_temp')|int > 90 %}
|
{% elif states('sensor.today_corrected_high_temp')|int > 90 %}
|
||||||
Hot
|
Hot
|
||||||
{% else %}
|
{% else %}
|
||||||
Toasty
|
Toasty
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% elif states('sensor.todays_high_temp')|int < 64 %}
|
{% elif states('sensor.today_corrected_high_temp')|int < 64 %}
|
||||||
{%- if states('sensor.todays_high_temp')|int < 32 %}
|
{%- if states('sensor.today_corrected_high_temp')|int < 32 %}
|
||||||
Freezing
|
Freezing
|
||||||
{% elif states('sensor.todays_high_temp')|int > 48 %}
|
{% elif states('sensor.today_corrected_high_temp')|int > 48 %}
|
||||||
Chilly
|
Chilly
|
||||||
{% else %}
|
{% else %}
|
||||||
Cold
|
Cold
|
||||||
@ -936,18 +936,24 @@ sensor:
|
|||||||
unit_of_measurement: 'in'
|
unit_of_measurement: 'in'
|
||||||
value_template: "{{ state_attr('sensor.rain_factor','day_0_rain') | float }}"
|
value_template: "{{ state_attr('sensor.rain_factor','day_0_rain') | float }}"
|
||||||
icon_template: mdi:weather-rainy
|
icon_template: mdi:weather-rainy
|
||||||
|
today_corrected_high_temp:
|
||||||
|
friendly_name: 'Today Corrected High Temp'
|
||||||
|
unique_id: c0c40ec1-605e-4739-a935-ac0a2937fab2
|
||||||
|
unit_of_measurement: °F
|
||||||
|
value_template: "{{ states('input_number.today_corrected_high_temp') | int }}"
|
||||||
|
icon_template: mdi:thermometer-high
|
||||||
|
|
||||||
input_number:
|
input_number:
|
||||||
today_calculated_high_temp:
|
today_corrected_high_temp:
|
||||||
name: Today Calculated High Temp
|
name: Today Corrected High Temp
|
||||||
min: -100
|
min: -100
|
||||||
max: 150
|
max: 150
|
||||||
step: 1
|
step: 1
|
||||||
unit_of_measurement: °F
|
unit_of_measurement: °F
|
||||||
icon: mdi:thermometer
|
icon: mdi:thermometer
|
||||||
mode: box
|
mode: box
|
||||||
today_calculated_low_temp:
|
today_corrected_low_temp:
|
||||||
name: Today Calculated Low Temp
|
name: Today Corrected Low Temp
|
||||||
min: -100
|
min: -100
|
||||||
max: 150
|
max: 150
|
||||||
step: 1
|
step: 1
|
||||||
@ -1020,6 +1026,26 @@ input_boolean:
|
|||||||
# - service: input_boolean.turn_off
|
# - service: input_boolean.turn_off
|
||||||
# entity_id: input_boolean.freeze_warning
|
# entity_id: input_boolean.freeze_warning
|
||||||
|
|
||||||
|
automation:
|
||||||
|
- id: bae55746-c571-4a5d-88e0-8c83aea8110b
|
||||||
|
alias: Fix High Temperature
|
||||||
|
description: Gotta make up for one of a few shortcomings in Pirateweather
|
||||||
|
mode: single
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: "00:30"
|
||||||
|
- platform: time
|
||||||
|
at: "06:00"
|
||||||
|
- platform: time
|
||||||
|
at: "12:00"
|
||||||
|
- platform: time
|
||||||
|
at: "17:45"
|
||||||
|
action:
|
||||||
|
- service: input_number.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_number.today_corrected_high_temp
|
||||||
|
data:
|
||||||
|
value: "{{ states('sensor.todays_high_temp') | int }}"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ script:
|
|||||||
entity_id: input_boolean.hot_day
|
entity_id: input_boolean.hot_day
|
||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ states('sensor.todays_high_temp') | int <= states('input_number.cold_day_threshold') | int }}"
|
value_template: "{{ states('sensor.today_corrected_high_temp') | int <= states('input_number.cold_day_threshold') | int }}"
|
||||||
then:
|
then:
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
target:
|
target:
|
||||||
@ -628,7 +628,7 @@ script:
|
|||||||
data:
|
data:
|
||||||
time: >
|
time: >
|
||||||
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
{% set high = states('sensor.todays_high_temp') | int %}
|
{% set high = states('sensor.today_corrected_high_temp') | int %}
|
||||||
{% if low > 60 or is_state('input_boolean.hot_day','on') %}
|
{% if low > 60 or is_state('input_boolean.hot_day','on') %}
|
||||||
22:30
|
22:30
|
||||||
{% elif 50 <= low <= 60 %}
|
{% elif 50 <= low <= 60 %}
|
||||||
@ -709,7 +709,7 @@ script:
|
|||||||
entity_id: input_datetime.emma_bedtime
|
entity_id: input_datetime.emma_bedtime
|
||||||
data:
|
data:
|
||||||
time: >
|
time: >
|
||||||
{% set high = states('sensor.todays_high_temp') | int %}
|
{% set high = states('sensor.today_corrected_high_temp') | int %}
|
||||||
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
{% set low = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
{% if is_state('input_boolean.hot_day','on') %}
|
{% if is_state('input_boolean.hot_day','on') %}
|
||||||
22:00
|
22:00
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Today the high temperature will be {{ states('sensor.todays_high_temp') }} degrees.
|
Today the high temperature will be {{ states('sensor.today_corrected_high_temp') }} degrees.
|
||||||
{{ states('sensor.clothing_forecast_detail') }}
|
{{ states('sensor.clothing_forecast_detail') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user