-
Notifications
You must be signed in to change notification settings - Fork 1
/
a_master_c3_mini.yaml
278 lines (212 loc) · 6.25 KB
/
a_master_c3_mini.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
270
271
272
273
274
275
276
277
#------------------------------
#-- a_master_c3_mini.yaml
#-- Petit code générique minimaliste pour des projets à base d'esp32-c3 mini lolin
#-- ATTENTION: je ne sais pas pourquoi mais il faut le flasher via web.esphome.io (maintenir la touche BOOT pendant le RESET), via le port USB en ESPHOME cela ne fonctionne pas !
#-- REMARQUE: xxx
#-- location: xxx
#-- zf230302.1844, zf230502.1132
#--
# sources:
#
esphome:
name: a_master_c3_mini
# platformio_options:
# board_build.flash_mode: dio
on_boot:
- light.turn_on:
id: a_master_c3_mini_rgb
brightness: 100%
red: 100%
green: 0%
blue: 0%
- delay: 1s
- light.turn_off:
id: a_master_c3_mini_rgb
- delay: 1s
- light.turn_on:
id: a_master_c3_mini_rgb
brightness: 30%
red: 0%
green: 100%
blue: 0%
- delay: 1s
- light.turn_off:
id: a_master_c3_mini_rgb
esp32:
board: esp32-c3-devkitm-1
# framework:
# type: esp-idf
# version: recommended
# Configuration WIFI
wifi:
ssid: !secret wifi_ssid_apzuzu7
password: !secret wifi_pass_apzuzu7
# networks:
# - ssid: !secret wifi_ssid_apzuzu7
# - password: !secret wifi_pass_apzuzu7
# - ssid: !secret wifi_ssid_apzuzu6
# - password: !secret wifi_pass_apzuzu6
# - ssid: !secret wifi_ssid_3G_zf
# - password: !secret wifi_pass_3G_zf2
# - ssid: !secret wifi_ssid_3G_zf2
# - password: !secret wifi_pass_3G_zf2
# - ssid: !secret wifi_ssid_3g_s7
# - password: !secret wifi_pass_3g_s7
# - ssid: !secret wifi_ssid_apzuzu6_EXT
# - password: !secret wifi_pass_apzuzu6_EXT
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "a_master_c3_mini Fallback"
password: !secret ap_wifi_password
captive_portal:
# Enable logging
logger:
level: VERBOSE
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret ota_password
# WEB Server
web_server:
port: 80
# Définition des lights
light:
# LED RGB sur le mini c3 GPIO7
- platform: neopixelbus
type: GRB
variant: WS2812
pin: GPIO7
num_leds: 1
name: "a_master_c3_mini RGB"
id: a_master_c3_mini_rgb
default_transition_length: 0s
# Définition des Switch's
switch:
- platform: template
name: "a_master_c3_mini LED"
# inverted: True
id: led
optimistic: true
on_turn_on:
- light.turn_on:
id: a_master_c3_mini_rgb
brightness: 30%
red: 0%
green: 0%
blue: 100%
on_turn_off:
- light.turn_off:
id: a_master_c3_mini_rgb
- platform: restart
name: "a_master_c3_mini Restart"
# Définition du bouton physique sur le mini c3 GPIO9
binary_sensor:
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
inverted: True
name: "a_master_c3_mini button"
on_press:
- switch.toggle: led
# Définition des Sensors
sensor:
- platform: wifi_signal
name: "a_master_c3_mini Signal Wi-Fi"
update_interval: 5s
- platform: uptime
name: "a_master_c3_mini uptime"
update_interval: 5s
# Définition des Sensors text
text_sensor:
- platform: version
name: "a_master_c3_mini Version 1150"
- platform: wifi_info
ip_address:
name: a_master_c3_mini IP Address
id: wifi_ip
ssid:
name: a_master_c3_mini Connected SSID
id: wifi_ssid
# Définition des inputs numbers
number:
- platform: template
name: "a_master_c3_mini consigne alarme low"
id: a_master_c3_mini_consigne_alarme_low
restore_value: true
optimistic: true
mode: box
min_value: 0.0
max_value: 0.8
step: 0.01
initial_value: 0.4
unit_of_measurement: "V"
# font:
# #https://github.com/JotJunior/PHP-Boleto-ZF2/blob/master/public/assets/fonts/arial.ttf
# - file: 'arialn.ttf'
# id: font1
# size: 10
# - file: 'arialn.ttf'
# id: font2
# size: 13
# i2c:
# sda: GPIO05
# scl: GPIO06
# scan: true
# frequency: 200kHz
# display:
# # http://www.esp8266learning.com/wemos-oled-shield-example.php
# # https://esphome.io/api/namespaceesphome_1_1display.html
# - platform: ssd1306_i2c
# model: "SSD1306 64x48"
# address: 0x3C
# invert: true
# update_interval: 3s
# lambda: |-
# // Turn the whole display on.
# //it.fill(COLOR_ON);
# // Turn the whole display off.
# //it.fill(COLOR_OFF);
# // For example, draw a line from [x=0,y=0] to [x=50,y=50]
# it.line(0, 0, 50, 50);
# // Print "Hello Zuzu" for fonts tests in top center.
# it.print(32, 20, id(font2), TextAlign::TOP_CENTER, "Hello 3400");
#
# // Print inside temperature (from homeassistant sensor)
# it.printf(0, 7, id(font1), TextAlign::BASELINE_LEFT, "In side");
# if (id(inside_temperature).has_state()) {
# it.printf(64, 7, id(font1), TextAlign::BASELINE_RIGHT , "%.1f°C", id(inside_temperature).state);
# }
# // Print outside temperature (from homeassistant sensor)
# it.printf(0, 16, id(font1), TextAlign::BASELINE_LEFT, "Out side");
# if (id(outside_temperature).has_state()) {
# it.printf(64, 16, id(font1), TextAlign::BASELINE_RIGHT , "%.1f°C", id(outside_temperature).state);
# }
# // Print TVOC (from homeassistant sensor)
# it.printf(0, 25, id(font1), TextAlign::BASELINE_LEFT, "TVOC");
# if (id(outside_temperature).has_state()) {
# it.printf(64, 25, id(font1), TextAlign::BASELINE_RIGHT , "%.0f", id(tvoc).state);
# }
# // Print "L'état du input text de HA: <state>" in midle center
# it.printf(32, 36, id(font2), TextAlign::BASELINE_CENTER, "%s", id(alarm_state).state.c_str());
# // Print time in HH:MM format
# it.strftime(32, 48, id(font1), TextAlign::BOTTOM_CENTER, "%d-%m %H:%M:%S", id(esptime).now());
# # Gestion des timers
# interval:
# # Timer pour calculer le temps passé à avancer !
# - interval: 2s
# then:
# - light.turn_on:
# id: a_master_c3_mini_rgb
# brightness: 30%
# red: 100%
# green: 0%
# blue: 0%
# - delay: 1s
# - light.turn_on:
# id: a_master_c3_mini_rgb
# brightness: 0%
# red: 100%
# green: 0%
# blue: 0%