-
Notifications
You must be signed in to change notification settings - Fork 2
/
roomsensor_esp32.yaml
67 lines (62 loc) · 1.68 KB
/
roomsensor_esp32.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
esphome:
name: $devicename
platform: ESP32
board: nodemcu-32s
#deep_sleep:
# run_duration: 5s
# sleep_duration: 60min
<<: !include common_static.yaml
sensor:
- platform: wifi_signal
name: ${upper_devicename} WiFi Signal
id: ${devicename}_wifi_signal
update_interval: 900s
- platform: uptime
name: ${upper_devicename} Uptime
- platform: dht
pin: GPIO15
model: DHT11
update_interval: 5s
temperature:
name: "${upper_devicename} Temperature"
accuracy_decimals: 2
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 5
send_first_at: 2
humidity:
name: "${upper_devicename} Humidity"
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 5
send_first_at: 2
switch:
- platform: restart
name: ${upper_devicename} Restart
text_sensor:
- platform: version
name: ${upper_devicename} Version
- platform: template
name: ${upper_devicename} MAC Address
lambda: 'return {WiFi.macAddress().c_str()};'
icon: mdi:fingerprint
update_interval: 60s
- platform: template
name: ${upper_devicename} Wifi Strength
id: ${devicename}_wifi_strength
icon: "mdi:wifi"
lambda: |-
if (id(${devicename}_wifi_signal).state > -50 ) {
return {"Excellent"};
} else if (id(${devicename}_wifi_signal).state > -60) {
return {"Good"};
} else if (id(${devicename}_wifi_signal).state > -70) {
return {"Fair"};
} else if (id(${devicename}_wifi_signal).state < -70) {
return {"Weak"};
} else {
return {"None"};
}
update_interval: 900s