Add sensor for low overnight temperature
This commit is contained in:
@ -194,6 +194,13 @@ input_number:
|
|||||||
step: 1
|
step: 1
|
||||||
unit_of_measurement: °F
|
unit_of_measurement: °F
|
||||||
icon: mdi:thermometer
|
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:
|
wind_chill_threshold:
|
||||||
name: Wind Chill Threshold
|
name: Wind Chill Threshold
|
||||||
min: 0
|
min: 0
|
||||||
|
@ -55,6 +55,20 @@ template:
|
|||||||
attributes:
|
attributes:
|
||||||
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
|
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
|
||||||
threshold: "{{ states('input_number.cold_day_threshold') | 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:
|
- binary_sensor:
|
||||||
- name: Wind Chill Threshold
|
- name: Wind Chill Threshold
|
||||||
state: >
|
state: >
|
||||||
|
Reference in New Issue
Block a user