Add cold day handling
This commit is contained in:
@ -16,18 +16,31 @@ template:
|
||||
- binary_sensor:
|
||||
- name: Heat Threshold
|
||||
state: >
|
||||
{% set high = states('sensor.pirateweather_temperature') | int %}
|
||||
{% set temp = states('sensor.pirateweather_temperature') | int %}
|
||||
{% set threshold = states('input_number.hot_day_threshold') | int %}
|
||||
{% if high >= threshold %}
|
||||
{% if temp >= threshold %}
|
||||
true
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
delay_off: '00:30:00'
|
||||
device_class: heat
|
||||
attributes:
|
||||
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
|
||||
threshold: "{{ states('input_number.hot_day_threshold') | int }}"
|
||||
- binary_sensor:
|
||||
- name: Cold Threshold
|
||||
state: >
|
||||
{% set temp = states('sensor.pirateweather_temperature') | int %}
|
||||
{% set threshold = states('input_number.cold_day_threshold') | int %}
|
||||
{% if temp <= threshold %}
|
||||
true
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
device_class: cold
|
||||
attributes:
|
||||
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
|
||||
threshold: "{{ states('input_number.cold_day_threshold') | int }}"
|
||||
|
||||
sensor:
|
||||
- platform: weatheralerts
|
||||
|
Reference in New Issue
Block a user