-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkegerator.yaml
More file actions
165 lines (145 loc) · 3.55 KB
/
Copy pathkegerator.yaml
File metadata and controls
165 lines (145 loc) · 3.55 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
esphome:
name: kegerator
esp32:
board: esp32-s2-saola-1
i2c:
sda: GPIO17
scl: GPIO16
font:
- file: "gfonts://Roboto"
id: font_large
size: 18
- file: "gfonts://Roboto"
id: font_small
size: 8
display:
- platform: ssd1306_i2c
model: "SSD1306 128x32"
lambda: |-
float current_temperature = id(kegerator_pid).current_temperature;
float target_temperature = id(kegerator_pid).target_temperature;
if(id(kegerator_pid).mode == CLIMATE_MODE_COOL) {
if(!std::isnan(current_temperature)) {
it.printf(64, 0, id(font_large), TextAlign::TOP_CENTER, "%.1f°C", current_temperature);
} else {
it.printf(64, 0, id(font_large), TextAlign::TOP_CENTER, "--°C");
}
} else {
it.printf(64, 0, id(font_large), TextAlign::TOP_CENTER, "Off");
}
if(!std::isnan(target_temperature)) {
it.printf(64, 32, id(font_small), TextAlign::BOTTOM_CENTER, "%.1f°C", target_temperature);
} else {
it.printf(64, 32, id(font_small), TextAlign::BOTTOM_CENTER, "--°C");
}
one_wire:
- platform: gpio
pin: GPIO15
sensor:
- platform: dallas_temp
id: temperature
name: "Temperature"
update_interval: 1s
unit_of_measurement: "°C"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
filters:
- exponential_moving_average:
alpha: 0.8
send_every: 30
binary_sensor:
- platform: gpio
id: btn_temp_up
pin:
number: GPIO14
inverted: true
mode:
input: true
pullup: true
filters:
autorepeat:
- delay: 1s
time_off: 100ms
time_on: 100ms
on_click:
lambda: |-
float target_temperature = id(kegerator_pid).target_temperature;
auto call = id(kegerator_pid).make_call();
call.set_target_temperature(target_temperature + 0.1);
call.perform();
- platform: gpio
id: btn_temp_down
pin:
number: GPIO21
inverted: true
mode:
input: true
pullup: true
filters:
autorepeat:
- delay: 1s
time_off: 100ms
time_on: 100ms
on_click:
lambda: |-
float target_temperature = id(kegerator_pid).target_temperature;
auto call = id(kegerator_pid).make_call();
call.set_target_temperature(target_temperature - 0.1);
call.perform();
- platform: gpio
id: btn_units
pin:
number: GPIO20
inverted: true
mode:
input: true
pullup: true
on_click:
then:
lambda: |-
auto call = id(kegerator_pid).make_call();
if(id(kegerator_pid).mode == CLIMATE_MODE_COOL) {
call.set_mode("OFF");
} else {
call.set_mode("COOL");
}
call.perform();
button:
- platform: template
name: "Kegerator PID Climate Autotune"
on_press:
- climate.pid.autotune: kegerator_pid
output:
id: compressor
platform: slow_pwm
pin: GPIO18
period: 1200s
climate:
- platform: pid
id: kegerator_pid
name: "Kegerator"
sensor: temperature
default_target_temperature: 7°C
cool_output: compressor
visual:
min_temperature: -7
max_temperature: 32
temperature_step: 0.1
control_parameters:
kp: 0.19714
ki: 0.00028
kd: 34.89431
logger:
api:
password: ""
ota:
- platform: esphome
password: ""
wifi:
ssid: !secret iot_wifi_ssid
password: !secret iot_wifi_password
ap:
ssid: "Kegerator"
password: ""
#captive_portal: