-
Notifications
You must be signed in to change notification settings - Fork 0
/
epp-crn01.yaml
238 lines (207 loc) · 7.67 KB
/
epp-crn01.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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
---
# Crono Thermostat
# readme docs/Crono.md
substitutions:
environment: p # Production
system_name: crn01
friendly_name: Crono
device_description: "Crono thermostat device. Readme https://raw.githubusercontent.com/ghimele/esphome-config/main/docs/Crono.md"
ip_address: !secret EPP-CRN01_IP_ADDRESS
project_name: "MAM.ESPHome Crono Thermostat"
version: 1.0.0
status_led_pin: GPIO02
display_busy_pin: GPIO25
display_reset_pin: GPIO26
display_dc_pin: GPIO27
display_cs_pin: GPIO15
display_spi_clk_pin: GPIO13
display_spi_mosi_pin: GPIO14
target_temp_home: "21.5"
target_temp_away: "17"
target_temp_comfort: "22"
target_temp_eco: "19.5"
web_server_version: "3"
packages:
device: !include devices/ESP32_e-Paper_DB.yaml
debug: !include ./components/debug/debug_info.yaml
display: !include ./components/displays/waveshare_epaper_4.20in.yaml
time:
- platform: homeassistant
id: homeassistant_time
button:
- platform: template
name: "Display - Refresh Screen"
entity_category: config
on_press:
- script.execute: update_screen
sensor:
- platform: homeassistant
name: "HA Date"
entity_id: sensor.pretty_date
id: pretty_date
internal: true
- platform: homeassistant
name: "External Temperature"
entity_id: sensor.temperatura_esterna
id: outside_temperature
internal: true
- platform: homeassistant
name: "Home Temperature"
entity_id: sensor.temperatura_casa
id: home_temperature
internal: true
- platform: homeassistant
name: "Home Humidity"
entity_id: sensor.humidita_casa
id: home_humidity
internal: true
- platform: homeassistant
name: "Bedroom Temperature"
entity_id: sensor.th_camera_d054_temperature
id: bedroom_temperature
internal: true
- platform: homeassistant
name: "Bedroom Humidity"
entity_id: sensor.th_camera_d054_humidity
id: bedroom_humidity
internal: true
switch:
- platform: gpio
id: heater_relay
pin: 33
name: "Relay Heater"
restore_mode: ALWAYS_OFF
climate:
- platform: thermostat
name: "Thermostat"
id: crono_thermostat
sensor: home_temperature
min_heating_off_time: 120s
min_heating_run_time: 120s
min_idle_time: 30s
visual:
min_temperature: 10
max_temperature: 30
temperature_step: 0.5
heat_action:
- switch.turn_on: heater_relay
idle_action:
- switch.turn_off: heater_relay
default_preset: Home
preset:
- name: Home
default_target_temperature_low: $target_temp_home
mode: HEAT
- name: Away
default_target_temperature_low: $target_temp_away
mode: HEAT
- name: Comfort
default_target_temperature_low: $target_temp_comfort
mode: HEAT
- name: Eco
default_target_temperature_low: $target_temp_eco
mode: HEAT
font: !include ./components/fonts/climate_fonts.yaml
display:
- id: !extend eink_display
lambda: |-
/* it.print(10, 10, id(main_sensor_unit), TextAlign::CENTER, "Ciao Ciao"); */
/* HEADER */
setlocale(LC_TIME, "it_IT");
it.strftime(10, 12, id(header_font),TextAlign::CENTER_LEFT, "%A %d %B %Y", id(homeassistant_time).now());
/* it.printf(10,12,id(header_font),TextAlign::CENTER_LEFT,"%s",id(pretty_date).state.c_str()); */
/* WIFI SIGNAL */
if(id(sensor_wifi_signal_percentage).has_state()) {
int wifi_x = 385;
int wifi_y = 12;
if (id(sensor_wifi_signal_percentage).state >= 80) {
// Excellent
it.print(wifi_x, wifi_y, id(wifi_font_20), TextAlign::CENTER, "\U000F0928");
ESP_LOGI("WiFi", "Exellent");
} else if (id(sensor_wifi_signal_percentage).state >= 60) {
// Good
it.print(wifi_x, wifi_y, id(wifi_font_20), TextAlign::CENTER, "\U000F0925");
ESP_LOGI("WiFi", "Good");
} else if (id(sensor_wifi_signal_percentage).state >= 40) {
// Fair
it.print(wifi_x, wifi_y, id(wifi_font_20), TextAlign::CENTER, "\U000F0922");
ESP_LOGI("WiFi", "Fair");
} else if (id(sensor_wifi_signal_percentage).state >= 20) {
// Weak
it.print(wifi_x, wifi_y, id(wifi_font_20), TextAlign::CENTER, "\U000F091F");
ESP_LOGI("WiFi", "Weak");
} else {
// Unlikely working signal
it.print(wifi_x, wifi_y, id(wifi_font_20), TextAlign::CENTER, "\U000F092F");
ESP_LOGI("WiFi", "Unlikely");
}
}
it.line(0, 24, 400, 24);
/* TEXT */
/* Column 1 */
/* Row 1 */
/* it.rectangle(32, 24, 84, 84); */
/* Thermostat status */
if (id(heater_relay).state){
it.print(32,66,id(icon_font_40), TextAlign::CENTER,"\U000F0238");
it.print(32,108,id(main_sensor_description), TextAlign::BOTTOM_LEFT,"Termo Accesi");
}
else{
it.print(32,66,id(icon_font_40), TextAlign::CENTER,"\U000F0425");
it.print(32,108,id(main_sensor_description), TextAlign::BOTTOM_LEFT,"Termo Spenti");
}
/* Row 2 */
/* it.rectangle(32, 108, 84, 84); */
/* Home Temperature */
it.print(32,150,id(icon_font_40), TextAlign::CENTER,"\U000F0F54");
it.print(32,192,id(main_sensor_description), TextAlign::BOTTOM_LEFT,"Temp. Casa");
/* Row 3 */
/* it.rectangle(32, 192, 84, 84); */
/* Beedroom Temperature */
it.print(32,234,id(icon_font_40), TextAlign::CENTER,"\U000F050F");
it.print(32,276,id(main_sensor_description), TextAlign::BOTTOM_LEFT,"Temp. Camera");
/* Column 2 */
/* Row 1 */
/* Thermostat Target Temperature */
/* it.rectangle(116, 24, 84, 84); */
it.printf(54, 66, id(main_sensor_unit), TextAlign::CENTER_LEFT ,"%.1f°",id(crono_thermostat).target_temperature);
/* Row 2 */
/* it.rectangle(116, 108, 84, 84); */
/* Home Temperature */
it.printf(54, 150, id(main_sensor_unit), TextAlign::CENTER_LEFT ,"%.1f°",id(home_temperature).state);
/* Row 3 */
/* it.rectangle(116, 192, 84, 84); */
/* Bedroom Temperature */
it.printf(54, 234, id(main_sensor_unit), TextAlign::CENTER_LEFT ,"%.1f°",id(bedroom_temperature).state);
/* Column 3 */
/* Row 1 */
/*it.rectangle(200, 24, 84, 84);*/
/* Outside Temperature */
it.print(200,66,id(icon_font_40), TextAlign::CENTER,"\U000F18D6");
/* Row 2 */
/* it.rectangle(200, 108, 84, 84); */
/* Home Humidity */
it.print(200,150,id(icon_font_40), TextAlign::CENTER,"\U000F058E");
it.print(200,192,id(main_sensor_description), TextAlign::BOTTOM_LEFT,"Umidita Casa");
/* Row 3 */
/* it.rectangle(200, 192, 84, 84); */
/* Bedroom Humidity */
it.print(200,234,id(icon_font_40), TextAlign::CENTER,"\U000F058E");
it.print(200,276,id(main_sensor_description), TextAlign::BOTTOM_LEFT,"Umidita Camera");
/* Column 4 */
/* Row 1 */
/*it.rectangle(284, 24, 84, 84);*/
/* Outside Temperature */
it.printf(222, 66, id(main_sensor_unit), TextAlign::CENTER_LEFT ,"%.1f°",id(outside_temperature).state);
it.print(200,108,id(main_sensor_description), TextAlign::BOTTOM_LEFT,"Temp. Esterna");
/* Roow 2 */
/* it.rectangle(284, 108, 84, 84); */
/* Home Humidity */
it.printf(222, 150, id(main_sensor_unit), TextAlign::CENTER_LEFT ,"%.0f%%",id(home_humidity).state);
/* Row 3 */
/* it.rectangle(284, 192, 84, 84); */
/* Bedroom Humidity */
it.printf(222, 234, id(main_sensor_unit), TextAlign::CENTER_LEFT ,"%.0f%%",id(bedroom_humidity).state);
/* FOOTER */
it.line(0, 276, 400, 276);
it.strftime(355, 288 , id(footer_font), TextAlign::CENTER_RIGHT , "Aggiornato il %d/%b/%Y %H:%M", id(homeassistant_time).now());