-
Notifications
You must be signed in to change notification settings - Fork 1
/
dsleep_mini_d1_1.yaml
104 lines (83 loc) · 1.88 KB
/
dsleep_mini_d1_1.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
#zf210302.2202
esphome:
name: dsleep_mini_d1_1
platform: ESP8266
board: d1_mini
# Configuration WIFI
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "dsleep_mini_d1_1 Fallback AP"
password: !secret ap_wifi_password
captive_portal:
# Enable logging
logger:
# level: VERBOSE
# logs:
# mqtt.component: DEBUG
# mqtt.client: ERROR
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret ota_password
# Définition des Switch's
switch:
- platform: gpio
name: "dsleep_mini_d1_1 LED"
inverted: True
id: led
pin: GPIO2
- platform: restart
name: "dsleep_mini_d1_1 Restart"
# WEB Server
web_server:
port: 80
# MQTT server
mqtt:
broker: !secret mqtt_server_dev
port: !secret mqtt_port_dev
username: !secret mqtt_user_dev
password: !secret mqtt_password_dev
# I2C conf
i2c:
sda: D5
scl: D6
# Sensors
sensor:
- platform: wifi_signal
name: "dsleep_mini_d1_1 Signal Wi-Fi"
update_interval: 5s
on_value:
if:
condition:
wifi.connected:
then:
- delay: 2s
- logger.log: Je suis connected et envoie la sauce !
- delay: 2s
- logger.log: Je vais dormir !
- deep_sleep.enter: deep_sleep_1
else:
- logger.log: WiFi not Antoine connected!
- platform: uptime
name: "dsleep_mini_d1_1 uptime"
update_interval: 5s
- platform: htu21d
temperature:
name: "dsleep_mini_d1_1 Température"
humidity:
name: "dsleep_mini_d1_1 Humidité"
update_interval: 5s
- platform: adc
pin: VCC
name: "dsleep_mini_d1_1 VCC Voltage"
update_interval: 5s
# Deep Sleep
deep_sleep:
run_duration: 30s
sleep_duration: 5s
id: deep_sleep_1