Improvements to hot weather detection
This commit is contained in:
@ -241,4 +241,18 @@ input_number:
|
|||||||
max: 40
|
max: 40
|
||||||
step: 1
|
step: 1
|
||||||
unit_of_measurement: °F
|
unit_of_measurement: °F
|
||||||
|
icon: mdi:thermometer
|
||||||
|
hot_overnight_threshold:
|
||||||
|
name: Hot Overnight Threshold
|
||||||
|
min: 40
|
||||||
|
max: 80
|
||||||
|
step: 1
|
||||||
|
unit_of_measurement: °F
|
||||||
|
icon: mdi:thermometer
|
||||||
|
extended_heat_threshold:
|
||||||
|
name: Extended Heat Threshold
|
||||||
|
min: 70
|
||||||
|
max: 100
|
||||||
|
step: 1
|
||||||
|
unit_of_measurement: °F
|
||||||
icon: mdi:thermometer
|
icon: mdi:thermometer
|
@ -87,6 +87,30 @@ template:
|
|||||||
attributes:
|
attributes:
|
||||||
current_temp: "{{ state_attr('weather.iron_nerd_weather_station','temperature') | int }}"
|
current_temp: "{{ state_attr('weather.iron_nerd_weather_station','temperature') | int }}"
|
||||||
threshold: "{{ states('input_number.wind_chill_threshold') | int }}"
|
threshold: "{{ states('input_number.wind_chill_threshold') | int }}"
|
||||||
|
- name: Heat Warning
|
||||||
|
unique_id: 02b8020a-4fa1-4489-abea-bfadf82ec7e5
|
||||||
|
state: >
|
||||||
|
{% set day = states('sensor.todays_high_temp') | int %}
|
||||||
|
{% set night = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
|
{% set dayThreshold = states('input_number.extended_heat_threshold') | int %}
|
||||||
|
{% set nightThreshold = states('input_number.hot_overnight_threshold') | int %}
|
||||||
|
{% set hotDayThreshold = states('input_number.hot_day_threshold') | int %}
|
||||||
|
{{ (day >= dayThreshold and night >= nightThreshold) or day >= hotDayThreshold }}
|
||||||
|
device_class: heat
|
||||||
|
attributes:
|
||||||
|
trigger: >
|
||||||
|
{% set day = states('sensor.todays_high_temp') | int %}
|
||||||
|
{% set night = states('sensor.overnight_lowest_temperature') | int %}
|
||||||
|
{% set dayThreshold = states('input_number.extended_heat_threshold') | int %}
|
||||||
|
{% set nightThreshold = states('input_number.hot_overnight_threshold') | int %}
|
||||||
|
{% set hotDayThreshold = states('input_number.hot_day_threshold') | int %}
|
||||||
|
{% if day >= dayThreshold and night >= nightThreshold %}
|
||||||
|
Extended Threat
|
||||||
|
{% elif day >= hotDayThreshold %}
|
||||||
|
Hot Day
|
||||||
|
{% else %}
|
||||||
|
No Trigger
|
||||||
|
{% endif %}
|
||||||
- name: "Lightning Warning"
|
- name: "Lightning Warning"
|
||||||
unique_id: edaddfc4-f7f0-4d75-aada-a2c588afe029
|
unique_id: edaddfc4-f7f0-4d75-aada-a2c588afe029
|
||||||
state: "{{ states('sensor.blitzortung_lightning_counter') | int > 0 }}"
|
state: "{{ states('sensor.blitzortung_lightning_counter') | int > 0 }}"
|
||||||
|
@ -484,8 +484,9 @@ script:
|
|||||||
{{ as_timestamp(this_weekday(3)) | timestamp_custom('%Y-%m-%d') }}
|
{{ as_timestamp(this_weekday(3)) | timestamp_custom('%Y-%m-%d') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: state
|
||||||
value_template: "{{ states('sensor.todays_high_temp') | int >= states('input_number.hot_day_threshold') | int }}"
|
entity_id: binary_sensor.heat_warning
|
||||||
|
state: 'on'
|
||||||
then:
|
then:
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
target:
|
target:
|
||||||
|
Reference in New Issue
Block a user