diff --git a/packages/climate.yaml b/packages/climate.yaml index 42ad293..61a52ba 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -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 diff --git a/packages/custom_weather.yaml b/packages/custom_weather.yaml index 607873b..4ec10c8 100644 --- a/packages/custom_weather.yaml +++ b/packages/custom_weather.yaml @@ -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: >