Add cold day handling
This commit is contained in:
@ -76,6 +76,9 @@ input_boolean:
|
||||
hot_day:
|
||||
name: Hot Day
|
||||
icon: mdi:heat-wave
|
||||
cold_day:
|
||||
name: Cold Day
|
||||
icon: mdi:snowflake
|
||||
|
||||
input_select:
|
||||
scheduled_climate_mode_master_bedroom_aircon:
|
||||
@ -176,6 +179,12 @@ input_number:
|
||||
max: 90
|
||||
step: 1
|
||||
unit_of_measurement: °F
|
||||
cold_day_threshold:
|
||||
name: Cold Day Threshold
|
||||
min: 0
|
||||
max: 40
|
||||
step: 1
|
||||
unit_of_measurement: °F
|
||||
|
||||
automation:
|
||||
- id: '1655415573165'
|
||||
|
@ -16,18 +16,31 @@ template:
|
||||
- binary_sensor:
|
||||
- name: Heat Threshold
|
||||
state: >
|
||||
{% set high = states('sensor.pirateweather_temperature') | int %}
|
||||
{% set temp = states('sensor.pirateweather_temperature') | int %}
|
||||
{% set threshold = states('input_number.hot_day_threshold') | int %}
|
||||
{% if high >= threshold %}
|
||||
{% if temp >= 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 }}"
|
||||
- binary_sensor:
|
||||
- name: Cold Threshold
|
||||
state: >
|
||||
{% set temp = states('sensor.pirateweather_temperature') | int %}
|
||||
{% set threshold = states('input_number.cold_day_threshold') | int %}
|
||||
{% if temp <= threshold %}
|
||||
true
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
device_class: cold
|
||||
attributes:
|
||||
current_temp: "{{ states('sensor.pirateweather_temperature') | int }}"
|
||||
threshold: "{{ states('input_number.cold_day_threshold') | int }}"
|
||||
|
||||
sensor:
|
||||
- platform: weatheralerts
|
||||
|
@ -327,6 +327,22 @@ script:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.hot_day
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{% if state_attr('sensor.current_forecast','high_temp') >= states('input_number.cold_day_threshold') %}
|
||||
true
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
then:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.cold_day
|
||||
else:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.cold_day
|
||||
|
||||
house_scheduling_evening:
|
||||
sequence:
|
||||
|
Reference in New Issue
Block a user