-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesp32-aht25-002.yaml
104 lines (90 loc) · 2.25 KB
/
esp32-aht25-002.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
esphome:
name: esp32-aht25-002
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
api:
encryption:
key: !secret api_secret
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
#power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "AP ${node_name}"
password: !secret wifi_ap_password
mqtt:
broker: "192.168.111.201"
port: 1883
username: "mqtt2"
password: "mqtt2"
birth_message:
will_message:
on_message:
- topic: esp32-aht25-002/ota_mode
payload: 'ON'
then:
- deep_sleep.prevent: deep_sleep_1
- topic: esp32-aht25-002/sleep_mode
payload: 'ON'
then:
- deep_sleep.enter: deep_sleep_1
deep_sleep:
id: deep_sleep_1
#run_duration: 10s
sleep_duration: 5min
i2c:
sensor:
- platform: adc
pin: 35
attenuation: auto
name: "esp32-aht25-002 Battery"
update_interval: 60s
filters:
- multiply: 1.96
- platform: aht10
temperature:
name: "esp32-aht25-002 Temperature"
id: temp
humidity:
name: "esp32-aht25-002 Humidity"
id: rh
update_interval: 10s
- platform: template
name: "esp32-aht25-002 Absolute Humidity"
unit_of_measurement: "g/m^3"
lambda: |-
const float mw = 18.01534; // molar mass of water g/mol
const float r = 8.31447215; // Universal gas constant J/mol/K
return (6.112 * powf(2.718281828, (17.67 * id(temp).state) /
(id(temp).state + 243.5)) * id(rh).state * mw) /
((273.15 + id(temp).state) * r); // in grams/m^3
accuracy_decimals: 2
update_interval: 10s
- platform: absolute_humidity
name: "esp32-aht25-002 Absolute Humidity Wobus"
temperature: temp
humidity: rh
equation: Wobus
unit_of_measurement: "g/m^3"
- platform: absolute_humidity
name: "esp32-aht25-002 Absolute Humidity Buck"
temperature: temp
humidity: rh
equation: Buck
unit_of_measurement: "g/m^3"
- platform: absolute_humidity
name: "esp32-aht25-002 Absolute Humidity Tetens"
temperature: temp
humidity: rh
equation: Tetens
unit_of_measurement: "g/m^3"