-
Notifications
You must be signed in to change notification settings - Fork 42
/
esp32-test.yaml
272 lines (228 loc) · 5.98 KB
/
esp32-test.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
258
259
260
261
262
263
264
265
266
267
268
269
substitutions:
name: "esp32-hp-test"
friendly_name: Clim Sejour
esphome:
name: ${name}
friendly_name: ${friendly_name}
esp32:
board: esp32doit-devkit-v1
framework:
type: esp-idf
#version: 5.3.0
#platform_version: 6.8.0
#type: arduino
mqtt:
#broker: homeassistant.local
broker: home-io.local # if HA instance name is custom
username: heatpumpSejour
password: !secret mqtt_password
discovery: true
debug:
update_interval: 5s
# Enable logging
logger:
level: DEBUG
logs:
EVT_SETS : DEBUG
WIFI : INFO
MQTT : INFO
WRITE_SETTINGS : DEBUG
SETTINGS : DEBUG
STATUS : INFO
CN105Climate: WARN
CN105: INFO
climate: WARN
sensor: WARN
chkSum : INFO
WRITE : WARN
READ : WARN
Update-ACK : ERROR
Header: INFO
Decoder : INFO
CONTROL_WANTED_SETTINGS: INFO
testMutex: DEBUG
UPDT_ITVL: DEBUG
CYCLE: DEBUG
# Enable Home Assistant API
api:
services:
- service: reboot
then:
- logger.log: "Redémarrage en cours..."
- lambda: |-
esp_restart();
- service: set_remote_temperature
variables:
temperature: float
then:
- lambda: 'id(esp32_clim).set_remote_temperature(temperature);'
- service: use_internal_temperature
then:
- lambda: 'id(esp32_clim).set_remote_temperature(0);'
# - service: test-mutex
# then:
# - logger.log: "Test de la fonction mutex..."
# - lambda: |-
# id(esp32_clim).testMutex();
encryption:
key: !secret encryption_key_sejour
ota:
- platform: esphome
password: !secret ota_pwd
wifi:
#ssid: !secret wifi_ssid
#password: !secret wifi_password
networks:
- ssid : !secret wifi_ssid3
password: !secret wifi_password3
- ssid: !secret wifi_ssid
password: !secret wifi_password
#- ssid: !secret wifi_ssid2
# password: !secret wifi_password2
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Heatpump-Sejour Fallback Hotspot"
password: !secret ota_pwd
captive_portal:
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
# this setting is for local component (code is not on github)
external_components:
# - source: github://echavet/MitsubishiCN105ESPHome
- source:
type: local
path: components
# Text sensors with general information.
text_sensor:
# Expose ESPHome version as sensor.
- platform: version
name: ${name} ESPHome Version
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: ${name} IP
ssid:
name: ${name} SSID
bssid:
name: ${name} BSSID
- platform: debug
device:
name: "Device Info"
reset_reason:
name: "Reset Reason"
# Sensors with general information.
sensor:
- platform: template
name: "dg_uart_connected"
entity_category: DIAGNOSTIC
lambda: |-
return (bool) id(esp32_clim).isUARTConnected_;
update_interval: 30s
- platform: template
name: "dg_hp_connected"
entity_category: DIAGNOSTIC
lambda: |-
return (bool) id(esp32_clim).isUARTConnected_;
update_interval: 30s
- platform: template
name: "dg_complete_cycles"
entity_category: DIAGNOSTIC
accuracy_decimals: 0
lambda: |-
return (unsigned long) id(esp32_clim).nbCompleteCycles_;
update_interval: 60s
- platform: template
name: "dg_total_cycles"
accuracy_decimals: 0
entity_category: DIAGNOSTIC
lambda: |-
return (unsigned long) id(esp32_clim).nbCycles_;
update_interval: 60s
- platform: template
name: "dg_nb_hp_connections"
accuracy_decimals: 0
entity_category: DIAGNOSTIC
lambda: |-
return (unsigned int) id(esp32_clim).nbHeatpumpConnections_;
update_interval: 60s
- platform: template
name: "dg_complete_cycles_percent"
unit_of_measurement: "%"
accuracy_decimals: 1
entity_category: DIAGNOSTIC
lambda: |-
unsigned long nbCompleteCycles = id(esp32_clim).nbCompleteCycles_;
unsigned long nbCycles = id(esp32_clim).nbCycles_;
if (nbCycles == 0) {
return 0.0;
}
return (float) nbCompleteCycles / nbCycles * 100.0;
update_interval: 60s
- platform: debug
free:
name: "Heap Free"
# fragmentation:
# name: "Heap Fragmentation"
# block:
# name: "Heap Max Block"
# loop_time:
# name: "Loop Time"
# psram:
# name: "Free PSRAM"
# Uptime sensor.
- platform: uptime
name: ${name} Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: ${name} WiFi Signal
update_interval: 60s
- platform: homeassistant
id: ha_cdeg_sejour_et_cuisine
entity_id: sensor.cdeg_sejour_et_cuisine
internal: true
on_value:
then:
- lambda: |-
id(esp32_clim).set_remote_temperature(x);
uart:
id: HP_UART
baud_rate: 2400
tx_pin: GPIO17
rx_pin: GPIO16
climate:
- platform: cn105
name: ${friendly_name}
id: "esp32_clim"
compressor_frequency_sensor:
name: Compressor frequency (clim Sejour)
vertical_vane_select:
name: Orientation de la Vane Verticale
# horizontal_vane_select:
# name: Orientation de la Vane Horizontale
isee_sensor:
name: ISEE Sensor
auto_sub_mode_sensor:
name: auto-submode sensor
sub_mode_sensor:
name: submode sensor
stage_sensor:
name: stage sensor
remote_temperature_timeout: 15min
update_interval: 2500ms # shouldn't be less than 1 second
debounce_delay : 120ms # delay to prevent bouncing
hp_uptime_connection_sensor:
name: ${name} HP Uptime Connection
update_interval: 30s
supports:
mode: [COOL, HEAT, FAN_ONLY, DRY]
fan_mode: [AUTO, QUIET, LOW, MEDIUM, HIGH]
swing_mode: ["OFF", VERTICAL]
visual:
min_temperature: 17
max_temperature: 23
temperature_step:
target_temperature: 0.5
current_temperature: 0.1