-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo-darby1.yaml
170 lines (131 loc) · 3.55 KB
/
demo-darby1.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
#------------------------------
#-- demo-darby1.yaml
#-- Petite démo ESPhome sur un ESP mini-d1 à Darby
#-- Cherche des consignes sur le Home Assistant
#-- et fait une petite détection de dépassement avec alarme sur Telegram
#--
#-- zf220523.0942, zf221106.1300, zf231230.1757
#--
esphome:
name: demo-darby1
esp8266:
board: esp01_1m
# restore_from_flash: false
preferences:
flash_write_interval: 10min
# Configuration WIFI
wifi:
# ssid: !secret wifi_ssid_apzuzu7
# password: !secret wifi_pass_apzuzu7
networks:
- ssid: !secret wifi_ssid_3g_s7
- password: !secret wifi_pass_3g_s7
# - 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: "demo-darby1 fallback"
password: !secret ap_wifi_password
# Enable wifi configuration fallback
captive_portal:
# Enable logging
logger:
level: VERBOSE
# Enable Home Assistant API
api:
encryption:
key: !secret api_encryption_key
# Enable OTA updates
ota:
password: !secret ota_password
# Enable WEB Server
web_server:
port: 80
# Définition des Switch's
switch:
- platform: gpio
name: "demo-darby1 LED"
inverted: True
id: led
pin: GPIO2
- platform: restart
name: "demo-darby1 Restart"
- platform: template
name: "demo-darby1 quittance alarme"
# restore_state: true
optimistic: true
id: demo_darby1_quittance_alarme
# Définition des Sensors
sensor:
- platform: wifi_signal
name: "demo-darby1 Signal Wi-Fi"
update_interval: 60s
- platform: uptime
name: "demo-darby1 uptime"
update_interval: 60s
# Définition des Sensors text
text_sensor:
- platform: version
name: "demo-darby1 Version"
- platform: wifi_info
ip_address:
name: demo-darby1 IP Address
id: wifi_ip
ssid:
name: demo-darby1 Connected SSID
id: wifi_ssid
# Définition des inputs numbers
number:
- platform: template
name: "demo-darby1 consigne"
restore_value: true
optimistic: true
min_value: 0
max_value: 100
step: 1
id: demo_darby1_consigne
- platform: template
name: "demo-darby1 hysterese"
restore_value: true
optimistic: true
min_value: 0
max_value: 100
step: 1
id: demo_darby1_hysterese
- platform: template
name: "demo-darby1 poids"
restore_value: true
optimistic: true
min_value: 0
max_value: 100
step: 1
id: demo_darby1_poids
# Boucle de régulation
interval:
- interval: 1s
then:
- if:
condition:
lambda: 'return id(demo_darby1_poids).state < id(demo_darby1_consigne).state;'
then:
- if:
condition:
lambda: 'return id(demo_darby1_quittance_alarme).state == 0;'
then:
- logger.log: "Une reine a quitté la ruche !"
- switch.turn_on: demo_darby1_quittance_alarme
else:
- if:
condition:
lambda: 'return id(demo_darby1_quittance_alarme).state == 1;'
then:
- logger.log: "On revient comme avant !"
- switch.turn_off: demo_darby1_quittance_alarme