Add sensor for low overnight temperature

This commit is contained in:
2023-01-23 13:43:49 -05:00
parent feda564fba
commit 03c073ddb2
2 changed files with 21 additions and 0 deletions

View File

@ -194,6 +194,13 @@ input_number:
step: 1
unit_of_measurement: °F
icon: mdi:thermometer
overnight_low_threshold:
name: Overnight Low Threshold
min: -20
max: 20
step: 1
unit_of_measurement: °F
icon: mdi:thermometer
wind_chill_threshold:
name: Wind Chill Threshold
min: 0

View File

@ -55,6 +55,20 @@ template:
attributes:
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
threshold: "{{ states('input_number.cold_day_threshold') | int }}"
- binary_sensor:
- name: Overnight Low Threshold
state: >
{% set temp = states('sensor.pirateweather_temperature') | int %}
{% set threshold = states('input_number.overnight_low_threshold') | int%}
{% if temp <= threshold %}
true
{% else %}
false
{% endif %}
device_class: cold
attributes:
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
threshold: "{{ states('input_number.overnight_low_threshold') | int }}"
- binary_sensor:
- name: Wind Chill Threshold
state: >