Add binary sensor for heat threshold

This commit is contained in:
2023-01-16 16:45:50 -05:00
parent bf96081d45
commit 7e95b1695b

View File

@ -12,6 +12,23 @@ weather:
attribution_template: "Weather data from Iron Nerd's custom weather station template"
ozone_template: "{{ states('sensor.pirateweather_ozone') | float }}"
template:
- binary_sensor:
- name: Heat Threshold
state: >
{% set high = states('sensor.pirateweather_temperature') | int %}
{% set threshold = states('input_number.hot_day_threshold') | int %}
{% if high >= 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 }}"
sensor:
- platform: weatheralerts
state: OH