-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset-temperature.yaml
More file actions
93 lines (93 loc) · 3.21 KB
/
set-temperature.yaml
File metadata and controls
93 lines (93 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
set_the_thermostat_based_on_real_feel:
alias: Set the thermostat based on feel
description: Set the thermostat based on perceived temperature, derived using humidity and the simplified Heat Index equation (https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml)
fields:
trg_thermostat:
name: Thermostat
description: Thermostat or climate device to control
required: true
selector:
entity:
domain: climate
t_perceived:
name: Perceived Temperature (F)
description: Perceived temperature
default: 78
required: false
selector:
number:
min: 40
max: 100
step: 1
unit_of_measurement: °F
t_perceived_high:
name: Perceived Temperature (F) high
description: Perceived temperature
default: 78
required: false
selector:
number:
min: 40
max: 100
step: 1
unit_of_measurement: °F
t_perceived_low:
name: Perceived Temperature (F) low
description: Perceived temperature
default: 78
required: false
selector:
number:
min: 40
max: 100
step: 1
unit_of_measurement: °F
humidity_target:
name: Humidity source
description: Humidity sensor
required: true
selector:
entity:
device_class: humidity
temp_sensor:
name: Temp sensor
description: Temperature sensor
required: false
selector:
entity:
device_class: temperature
variables:
incoming_tmp: '{{ ((state_attr(trg_thermostat, "current_temperature") | float)) }}'
temp_val: '{{states(temp_sensor) | float}}'
temp_max: '{{state_attr(temp_sensor,"max_value") | float}}'
temp_min: '{{state_attr(temp_sensor,"min_value") | float}}'
sensorct: '{{state_attr(temp_sensor,"count_sensors") | float}}'
mean_tmp: '{{((temp_val * sensorct) + incoming_tmp) / (sensorct + 1.0)}}'
humidity_val: '{{(states(humidity_target) | float)}}'
humidity_max: '{{(state_attr(temp_sensor,"max_value") | float)}}'
humidity_min: '{{(state_attr(temp_sensor,"min_value") | float)}}'
bias: '{{(incoming_tmp - mean_tmp) * 1.1}}'
bias_high: '{{(incoming_tmp - temp_max) * 1.1}}'
bias_low: '{{(incoming_tmp - temp_min) * 1.1}}'
# HI = 0.5 * {T + 61.0 + [(T-68.0)*1.2] + (RH*0.094)}
# HI = 0.5 * {T + 61.0 + (1.2T - 81.6) + (RH*0.094)}
# HI = 0.5 * {2.2T - 20.6 + (RH*0.094)}
# HI = 1.1T - 10.3 + (RH*0.047)
# HI + 10.3 - (RH*0.047)= 1.1T
# (HI + 10.3 - (RH*0.047))/1.1 = T
high_tmp: '{{(((t_perceived_high | float) + 10.3 - (0.047*humidity_val))/1.1) + bias_high}}'
low_tmp: '{{(((t_perceived_low | float) + 10.3 - (0.047*humidity_val))/1.1) + bias_low}}'
sequence:
- wait_template: >-
{{ state_attr(trg_thermostat,"hvac_action") == None or
state_attr(trg_thermostat,"hvac_action") == "off" }}
timeout: '00:10:00'
continue_on_timeout: true
- service: climate.set_temperature
data:
target_temp_high: '{{high_tmp | round(0,"floor")}}'
target_temp_low: '{{low_tmp | round(0,"ceil")}}'
target:
entity_id: '{{ trg_thermostat }}'
mode: single
icon: mdi:thermometer