-
Notifications
You must be signed in to change notification settings - Fork 1
/
esp32-ble-ibeacon-scanner.yaml
259 lines (188 loc) · 5.62 KB
/
esp32-ble-ibeacon-scanner.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
#------------------------------
#-- esp32-ble-ibeacon-scanner.yaml
#-- Scanner de iBeacon's. Les iBeacon's découverts se trouvent dans les logs
#-- Je squate une esp32-cam comme un esp32 simple avec Bluetooth
#-- zf220116.1340
#--
# sources:
# https://github.com/esphome/esphome/pull/1627
esphome:
name: esp32-ble-ibeacon-scanner
project:
name: "zf.esp32-ble-ibeacon-scanner"
version: "1.0.1"
esp32:
board: esp32cam
framework:
type: arduino
# 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: "esp32-ble-ibeacon-scanner AP"
password: !secret ap_wifi_password
captive_portal:
# Enable logging
logger:
level: DEBUG
# level: VERBOSE
# # level: VERY_VERBOSE
# logs:
# logger: INFO
# adc: INFO
# captive_portal: INFO
# deep_sleep: INFO
# htu21d: INFO
# i2c: INFO
# ota: INFO
# restart: INFO
# sensor: INFO
# switch: INFO
# switch.gpio: INFO
# uptime.sensor: INFO
# web_server: INFO
# wifi_signal.sensor: INFO
# mqtt: INFO
# mqtt.component: INFO
# mqtt.client: INFO
# mqtt.switch: INFO
# Enable Home Assistant API
api:
password: !secret api_password
# Enable OTA
ota:
password: !secret ota_password
# WEB Server
web_server:
port: 80
# Définition des Switch's
switch:
- platform: restart
name: "esp32-ble-ibeacon-scanner Restart"
- platform: gpio
name: "esp32-ble-ibeacon-scanner LED"
inverted: True
id: led
pin: GPIO33
- platform: gpio
name: "esp32-ble-ibeacon-scanner LED FLASH"
# inverted: True
id: led_flash
pin: GPIO4
- platform: gpio
name: "esp32-ble-ibeacon-scanner cam power"
inverted: True
id: cam_power
pin: GPIO32
esp32_ble_tracker:
scan_parameters:
duration: 15s
on_ble_advertise:
- lambda: |-
if(x.get_ibeacon().has_value())
{ auto ibeacon = x.get_ibeacon().value();
ESP_LOGD(ibeacon.get_uuid().to_string().c_str(), " iBeancon found***********************************");
//if(strcmp(ibeacon.get_uuid().to_string().c_str(), "485726A9-2B28-CCB7-354D-0A49B3C68C4E") == 0)
//{
id(ble_rssiz).publish_state(x.get_rssi());
// ESP_LOGD("ble_adv", "My Phone found***********************************");
// }
}
# Définition des sensors
sensor:
- platform: wifi_signal
name: "esp32-ble-ibeacon-scanner Signal Wi-Fi"
update_interval: 60s
- platform: uptime
name: "esp32-ble-ibeacon-scanner uptime"
update_interval: 60s
# - platform: ble_rssi
# name: "BLE SumUp 835 RSSI value"
# mac_address: EF:D4:55:26:8C:27
# - platform: ble_rssi
# name: "BLE Tile 1 RSSI value"
# mac_address: E0:AA:01:F9:AF:62
# - platform: ble_rssi
# name: "BLE Tile 2 RSSI value"
# mac_address: E1:B0:A7:F3:63:03
# - platform: ble_rssi
# name: "BLE Beacon 4 RSSI value"
# service_uuid: '4e8cc6b3-490a-4d35-b7cc-282ba9265748'
- platform: template
id: ble_rssiz
name: "BLE iBeacon RSSI"
icon: "mdi:signal-distance-variant"
internal: true
# update_interval: never
unit_of_measurement: "dBm"
# filters:
# - median:
# window_size: 5
# send_every: 1
# function zcalc_distance(zrssi2)
# zrssi_1m=-40 zn=2
# zdist=10^((zrssi_1m - zrssi2) / (10 * zn))
# return zdist
# end
# --[[
# print("distance: "..zcalc_distance(-60).."m")
# La formule pour calculer la distance est assez simple.
# d = 10 ^ ((TxPower - RSSI) / (10 * n))
# - TxPower est le RSSI mesuré à 1 m d'un point d'accès connu. Par exemple: -84 dB.
# - n est la constante de propagation ou l'exposant d'affaiblissement de trajet. Par exemple: 2,7 à 4,3 (l'espace libre a n = 2 pour référence).
# - RSSI est le RSSI mesuré
# - d est la distance en mètre
# ]]
# Définition des text sensors
text_sensor:
- platform: version
name: "esp32-ble-ibeacon-scanner Version"
- platform: wifi_info
ip_address:
name: esp32-ble-ibeacon-scanner IP Address
id: wifi_ip
ssid:
name: esp32-ble-ibeacon-scanner Connected SSID
id: wifi_ssid
# - platform: ble_scanner
# name: "BLE Devices Scanner"
# Définition des binary sensors
binary_sensor:
- platform: status
name: "esp32-ble-ibeacon-scanner Status"
# - platform: ble_presence
# name: "BLE SumUp 835"
# mac_address: EF:D4:55:26:8C:27
# - platform: ble_presence
# name: "BLE Tile 1"
# mac_address: E0:AA:01:F9:AF:62
# - platform: ble_presence
# name: "BLE Tile 2"
# mac_address: E1:B0:A7:F3:63:03
# - platform: ble_presence
# name: "BLE iBeacon 4"
# # service_uuid: '4e8cc6b3-490a-4d35-b7cc-282ba9265748'
# ibeacon_uuid : 4e8cc6b3-490a-4d35-b7cc-282ba9265748
# # ibeacon_major : 100
# # ibeacon_minor : 1
# - platform: ble_presence
# name: "BLE iBeacon inv"
# # service_uuid: 'BB29E651-5759-259A-0049-A300A38C34A8'
# ibeacon_uuid : BB29E651-5759-259A-0049-A300A38C34A8
# # ibeacon_major : 100
# # ibeacon_minor : 1