Add binary sensor for heat threshold
This commit is contained in:
@ -12,6 +12,23 @@ weather:
|
|||||||
attribution_template: "Weather data from Iron Nerd's custom weather station template"
|
attribution_template: "Weather data from Iron Nerd's custom weather station template"
|
||||||
ozone_template: "{{ states('sensor.pirateweather_ozone') | float }}"
|
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:
|
sensor:
|
||||||
- platform: weatheralerts
|
- platform: weatheralerts
|
||||||
state: OH
|
state: OH
|
||||||
|
Reference in New Issue
Block a user