-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBME680 and mmWave sensor.yaml
147 lines (130 loc) · 3.67 KB
/
BME680 and mmWave sensor.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
substitutions:
device_name: occupancy-and--BME680-sensor
device_name_pretty: Multi Sensor
# change the below to be your WiFi SSID
ssid: SSID
# change the below to be your WiFi password
wifi_password: PASSWORD
# UART Pin configured for mmWave sensor
uart_tx_pin: "21"
# TX Pin configured for mmWave sensor - this must be linked to the RX Pin on the radar
uart_rx_pin: "22"
# TX Pin configured for mmWave sensor - this must be linked to the TX Pin on the radar
gpio_pin: "16"
#temperature sensor SDA pin - this must be linked to the SDA pin of the BME680 sensor
sda_pin: "25"
#temperature sensor SCL pin - - this must be linked to the SCL pin of the BME680 sensor
scl_pin: "27"
# include the yml file with the radar code and configuration
packages:
inclusions: !include packages/leapmmw_sensor.yml
esphome:
name: $device_name
esp32:
board: wemos_d1_mini32
framework:
type: arduino
# Enable logging
#logger:
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: "${ssid}"
password: "${wifi_password}"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name_pretty}"
password: "${wifi_password}"
#captive_portal:
#web_server:
# port: 80
# version: 2
# include_internal: true
i2c:
sda: ${sda_pin}
scl: ${scl_pin}
dallas:
- pin: 32
update_interval: 10s
bme680_bsec:
address: 0x77
sample_rate: lp
state_save_interval: 1h
#temperature_offset: 1.42 #(calibration without mmWave radar & v2 case version)
#temperature_offset: 1.81 #(calibrated without mmWave radar & v1 case version)
temperature_offset: 2.48 #(calibration with mmWave radar & v1 case version)
sensor:
- platform: bme680_bsec
temperature:
# Temperature in °C
name: "${entity_name_pretty} Temperature"
sample_rate: lp
accuracy_decimals: 2
filters:
- sliding_window_moving_average:
window_size: 20
send_every: 20
pressure:
name: "${entity_name_pretty} Pressure"
sample_rate: lp
filters:
- median
humidity:
name: "${entity_name_pretty} Humidity"
sample_rate: lp
filters:
- median
gas_resistance:
name: "${entity_name_pretty} Gas Resistance"
filters:
- median
iaq:
name: "${entity_name_pretty} IAQ"
id: iaq
filters:
- median
iaq_accuracy:
name: "${entity_name_pretty} IAQ Accuracy"
co2_equivalent:
name: "${entity_name_pretty} CO2 Equivalent"
filters:
- median
breath_voc_equivalent:
name: "${entity_name_pretty} Breath VOC Equivalent"
filters:
- median
text_sensor:
- platform: bme680_bsec
iaq_accuracy:
name: "${entity_name_pretty} IAQ Accuracy"
- platform: template
name: "${entity_name_pretty} Air Quality"
icon: "mdi:checkbox-marked-circle-outline"
lambda: |-
if ( int(id(iaq).state) <= 50) {
return {"Excellent"};
}
else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
return {"Good"};
}
else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
return {"Lightly polluted"};
}
else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
return {"Moderately polluted"};
}
else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
return {"Heavily polluted"};
}
else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
return {"Severely polluted"};
}
else if (int(id(iaq).state) >= 351) {
return {"Extremely polluted"};
}
else {
return {"error"};
}