-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschedy.yaml
113 lines (108 loc) · 4.69 KB
/
schedy.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
schedy_heating:
module: hass_apps_loader
class: SchedyApp
reset_at_startup: true
#log_level: DEBUG
actor_type: dualthermostat
expression_environment: |
def people_status():
peoplestatus = "not_home"
people = [
state("person.ethan"),
state("person.hannah"),
state("device_tracker.ethan_s23_unifi"),
state("device_tracker.hannah_s10"),
state("device_tracker.josh_phone")
]
for person in people:
if person == "home":
peoplestatus = "home"
break
return peoplestatus
def guest_mode():
return state("input_boolean.guestmode")
def outside_temp():
try:
temp = float(state("sensor.outside_temp_sensor_outside_outside_temp_sensor_outside_temperature_air"))
except:
try:
temp = float(state("sensor.weather_temperature"))
except:
temp = 0
return temp
def forecast_max():
try:
temp = float(state("sensor.home_realfeel_temperature_max_0d"))
except:
temp = 0
return temp
def door_is_open_for_long():
return state("input_boolean.door_open_long") == "on"
def door_is_closed_for_long():
return state("input_boolean.door_closed_long") == "on"
def door_is_open():
return state("binary_sensor.dining_room_sliding_door_sensor_dining_room_sliding_door_sensor_door_state_simple") == "on"
watched_entities:
- sensor.weather_temperature
- input_boolean.guestmode
- sensor.outside_temp_sensor_outside_outside_temp_sensor_outside_temperature_air
- person.ethan
- person.hannah
- device_tracker.ethan_s23_unifi
- device_tracker.hannah_s10
- device_tracker.josh_phone
- sensor.home_realfeel_temperature_max_0d
- binary_sensor.dining_room_sliding_door_sensor_dining_room_sliding_door_sensor_door_state_simple
- input_boolean.door_open_long
- input_boolean.door_closed_long
rooms:
living:
rescheduling_delay: 90
grace_period: 120
actors:
climate.thermostat:
hvac_mode_on: auto
send_retries: 7
send_retry_interval: 1
#delta: [1,1]
schedule:
- v: "on"
rules:
- rules:
- x: "Mark('off', Mark.OVERLAY) if door_is_open_for_long() or (not door_is_closed_for_long() and not door_is_open()) else Break()"
- rules:
- x: "Next() if (people_status() == 'home' or guest_mode() == 'on') and outside_temp() >= 75 else Break()"
- { v: [65,70], start: "07:00", end: "19:30", weekdays: 1-4 }
- { v: [65,69], start: "19:30", end: "07:00", weekdays: 1-4 }
- { v: [65,70], start: "07:00", end: "20:00", weekdays: 5-6 }
- { v: [65,69], start: "20:00", end: "07:00", weekdays: 5-6 }
- { v: [65,70], start: "07:00", end: "19:30", weekdays: 7 }
- { v: [65,69], start: "19:30", end: "07:00", weekdays: 7 }
- rules:
- x: "Next() if (people_status() == 'home' or guest_mode() == 'on') and outside_temp() >= 60 else Break()"
- { v: [68,72], start: "07:00", end: "19:30", weekdays: 1-4 }
- { v: [67,69], start: "19:30", end: "07:00", weekdays: 1-4 }
- { v: [68,72], start: "07:00", end: "20:00", weekdays: 5-6 }
- { v: [67,69], start: "20:00", end: "07:00", weekdays: 5-6 }
- { v: [68,72], start: "07:00", end: "19:30", weekdays: 7 }
- { v: [67,69], start: "19:30", end: "07:00", weekdays: 7 }
- rules:
- x: "Next() if (people_status() == 'home' or guest_mode() == 'on') and forecast_max() >= 65 else Break()"
- { v: [67,80], start: "07:00", end: "19:30", weekdays: 1-4 }
- { v: [67,80], start: "19:30", end: "07:00", weekdays: 1-4 }
- { v: [67,80], start: "07:00", end: "20:00", weekdays: 5-6 }
- { v: [67,80], start: "20:00", end: "07:00", weekdays: 5-6 }
- { v: [67,80], start: "07:00", end: "19:30", weekdays: 7 }
- { v: [67,80], start: "19:30", end: "07:00", weekdays: 7 }
- rules:
- x: "Next() if people_status() == 'home' or guest_mode() == 'on' else Break()"
- { v: [70,80], start: "07:00", end: "19:30", weekdays: 1-4 }
- { v: [67,80], start: "19:30", end: "07:00", weekdays: 1-4 }
- { v: [70,80], start: "07:00", end: "20:00", weekdays: 5-6 }
- { v: [67,80], start: "20:00", end: "07:00", weekdays: 5-6 }
- { v: [70,80], start: "07:00", end: "19:30", weekdays: 7 }
- { v: [67,80], start: "19:30", end: "07:00", weekdays: 7 }
- rules:
- x: "Next() if outside_temp() >= 60 else Break()"
- v: [60,75]
- v: [62,80]