forked from nicolaij/esphomes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
barometer.yaml
executable file
·90 lines (76 loc) · 1.63 KB
/
barometer.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
esphome:
name: barometer
on_boot:
- priority: -100
then:
- delay: 30s
- deep_sleep.enter:
id: deep_sleep_1
sleep_duration: !lambda "if (id(batt).state > 3.3) return 10 * 60 * 1000 /*10min*/; else return 60 * 60 * 1000 /*60min*/;"
esp8266:
board: d1_mini
deep_sleep:
id: deep_sleep_1
run_duration: 60s
sleep_duration: 1h
# Enable logging
logger:
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
networks:
- ssid: !secret wifi_ssid_my_home1
password: !secret wifi_password_my_home1
- ssid: !secret wifi_ssid_my_home2
password: !secret wifi_password_my_home2
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "barometer Fallback Hotspot"
password: !secret ap_password
web_server:
port: 80
include_internal: true
ota: true
#status_led:
# pin:
# number: D4
# inverted: true
i2c:
sda: D3
scl: D1
scan: false
id: bus_a
frequency: 100khz
sensor:
- platform: dht
pin: D2
model: DHT11
temperature:
name: "Temperature dht"
humidity:
name: "Humidity dht"
- platform: bmp085
temperature:
name: "Temperature BMP180"
pressure:
name: "Pressure BMP180"
- platform: wifi_signal
name: "WiFi Signal Sensor"
- platform: adc
id: batt
pin: A0
name: "Battery voltage"
filters:
- multiply: 5.93
on_value:
then:
- if:
condition:
lambda: 'return x < 3.0;'
then:
- deep_sleep.enter:
id: deep_sleep_1
sleep_duration: 24h