-
Notifications
You must be signed in to change notification settings - Fork 0
/
infinitesp.yaml
259 lines (222 loc) · 6.36 KB
/
infinitesp.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
substitutions:
name: infinitesp
btn_slop: '0.1'
esphome:
name: $name
board: esp32s3box
platform: esp32
libraries:
- SPI
- FS
- SPIFFS
- bodmer/TFT_eSPI@^2.5.21
includes:
- tftespi.h
platformio_options:
build_flags:
- -Os
- -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
- -DUSER_SETUP_LOADED=1
- -DST7789_DRIVER=1
- -DTFT_WIDTH=240
- -DTFT_HEIGHT=320
- -DTFT_RGB_ORDER=TFT_BGR
- -DTFT_MOSI=6
- -DTFT_SCLK=7
- -DTFT_CS=5
- -DTFT_DC=4
- -DTFT_RST=48
- -DTFT_BL=45
- -DTFT_BACKLIGHT_ON=LOW
- -DLOAD_GLCD=1
- -DLOAD_FONT2=1
- -DLOAD_FONT4=1
- -DLOAD_FONT6=1
- -DLOAD_FONT7=1
- -DLOAD_FONT8=1
- -DLOAD_GFXFF=1
- -DSMOOTH_FONT=1
- -DSPI_FREQUENCY=40000000
wifi:
networks:
- ssid: !secret ssid
password: !secret pass
ap:
ssid: $name-ap
api:
ota:
logger:
level: DEBUG
web_server:
port: 80
switch:
- platform: restart
name: "$name reboot"
custom_component:
- lambda: |-
auto my_tftespi = new MyTFTeSPI();
return {my_tftespi};
components:
- id: my_tftespi_id
time:
- platform: homeassistant
id: ha_time
#spi:
# clk_pin: GPIO7
# mosi_pin: GPIO6
#i2c:
# scl: GPIO18
# sda: GPIO8
# scan: true
#dallas:
# pin: GPIO14
# update_interval: 6s
mqtt:
broker: !secret mqtt
id: mqtt_client
#meassistant/climate/primary/fan_mode "auto"
#homeassistant/climate/primary/hvac_action "idle"
#homeassistant/climate/primary/preset_mode "Override"
#homeassistant/climate/primary/current_activity "manual"
#homeassistant/climate/primary/scheduled_activity "home"
text_sensor:
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/fan_mode
id: mq_fan_mode_text
name: "mqtt primary current fan mode"
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/hvac_action
id: mq_hvac_action_text
name: "mqtt primary hvac action"
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/preset_mode
id: mq_preset_mode_text
name: "mqtt primary preset mode"
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/current_activity
id: mq_current_activity_text
name: "mqtt primary current activity"
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/scheduled_activity
id: mq_scheduled_activity_text
name: "mqtt primary scheduled activity"
sensor:
- platform: homeassistant
name: "cloned HA thermostat setpoint"
id: climate_clone_setpoint
entity_id: climate.primary
attribute: temperature
- platform: homeassistant
name: "cloned HA thermostat temperature"
id: climate_clone_current_temperature
entity_id: climate.primary
attribute: current_temperature
- platform: wifi_signal
name: "$name WiFi Signal"
update_interval: 300s
accuracy_decimals: 0
# - platform: dallas
# index: 0
# name: "$name temperature"
# id: ds18b20
# #address: 0x873ce1e381b49828
- platform: adc
id: btns_val
pin: GPIO1
name: "$name front buttons"
update_interval: 50ms
attenuation: auto
filters:
- delta: 0.1
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/temperature
id: mq_temperature_num
name: "mqtt primary temperature num"
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/current_temperature
id: mq_current_temperature_num
name: "mqtt primary current humidity num"
- platform: mqtt_subscribe
topic: homeassistant/climate/primary/current_humidity
id: mq_current_humidity
name: "mqtt primary current humidity num"
binary_sensor:
- platform: template
name: "$name left"
id: btn_left
lambda: 'return (2.41+$btn_slop > id(btns_val).state && 2.41-$btn_slop < id(btns_val).state);'
# on_release:
# - then:
# - display.page.show_previous: my_display
# - component.update: my_display
- platform: template
name: "$name center"
id: btn_center
lambda: 'return (1.99+$btn_slop > id(btns_val).state && 1.99-$btn_slop < id(btns_val).state);'
on_state:
- then:
- lambda: |-
auto mydp = (MyTFTeSPI *)(id(my_tftespi_id));
mydp->setRefresh();
- platform: template
name: "$name right"
id: btn_right
lambda: 'return (0.82+$btn_slop > id(btns_val).state && 0.82-$btn_slop < id(btns_val).state);'
on_press:
- then:
# - platform: gpio
# name: "$name side"
# id: btn_side
# pin
# number: GPIO0
# inverted: true
# mode:
# input: true
# pullup: true
climate:
- platform: thermostat
name: "$name thermostat"
sensor: climate_clone_current_temperature
min_idle_time: 1s
min_cooling_off_time: 1s
min_cooling_run_time: 4s
min_heating_off_time: 1s
min_heating_run_time: 4s
min_fanning_off_time: 1s
min_fanning_run_time: 4s
min_fan_mode_switching_time: 1s
# these are actions which PERFORM the needed device control
idle_action:
- then:
- logger.log: "IDLE"
heat_action:
- then:
- logger.log: "HEAT"
cool_action:
- then:
- logger.log: "COOL"
fan_only_action:
- then:
- logger.log: "FAN ONLY"
target_temperature_change_action:
- then:
- logger.log: "CHANGE TARGET TEMPERATURE"
fan_mode_on_action:
- then:
- logger.log: "The action to call when the fan should run continuously."
#these are callbacks which respond to climate state changes
auto_mode:
- then:
- logger.log: "The action to call when the climate device is placed into “auto” mode (it may both cool and heat as required)"
off_mode:
- then:
- logger.log: "The action to call when the climate device is placed into “off” mode (it is completely disabled)."
heat_mode:
- then:
- logger.log: "The action to call when the climate device is placed into heat mode (it may heat as required, but not cool)."
cool_mode:
- then:
- logger.log: "The action to call when the climate device is placed into cool mode (it may cool as required, but not heat)."
fan_only_mode:
- then:
- logger.log: "The action to call when the climate device is placed into fan only mode (it may not heat or cool, but will activate its fan as needed based on the upper target temperature value)"