2022-10-01 16:03:08
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
esphome:
|
||||
name: bme280
|
||||
board: d1_mini
|
||||
platform: esp8266
|
||||
|
||||
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
# Enable Home Assistant API
|
||||
#api:
|
||||
|
||||
|
||||
ota:
|
||||
password: !secret ota
|
||||
|
||||
wifi:
|
||||
networks:
|
||||
- ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
- ssid: !secret wifi_ssid2
|
||||
password: !secret wifi_password2
|
||||
domain: .lan
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "bme280 Fallback Hotspot"
|
||||
password: !secret ap_password
|
||||
|
||||
captive_portal:
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
timezone: Europe/Amsterdam
|
||||
id: time1
|
||||
|
||||
|
||||
status_led:
|
||||
pin:
|
||||
number: GPIO2
|
||||
inverted: True
|
||||
|
||||
|
||||
|
||||
mqtt:
|
||||
broker: mqtt.lan
|
||||
discovery: true
|
||||
|
||||
i2c:
|
||||
sda: D2
|
||||
scl: D1
|
||||
scan: true
|
||||
|
||||
sensor:
|
||||
- platform: sht3xd
|
||||
temperature:
|
||||
name: "SHT30 Temp"
|
||||
id: z41_temp
|
||||
accuracy_decimals: 2
|
||||
filters:
|
||||
- offset: -1.9
|
||||
humidity:
|
||||
name: "SHT30 Hum"
|
||||
id: z41_hum
|
||||
address: 0x45
|
||||
update_interval: 60s
|
||||
|
||||
- platform: htu21d
|
||||
temperature:
|
||||
name: " HTU21 Temp"
|
||||
accuracy_decimals: 2
|
||||
id: z3_temp
|
||||
humidity:
|
||||
name: " HTU21 Hum"
|
||||
accuracy_decimals: 1
|
||||
id: z3_hum
|
||||
|
||||
- platform: bme280
|
||||
temperature:
|
||||
name: " BME280 Temperature"
|
||||
accuracy_decimals: 2
|
||||
oversampling: 16x
|
||||
id: z7_temp
|
||||
pressure:
|
||||
name: " BME280 Pressure"
|
||||
id: z6_press
|
||||
humidity:
|
||||
name: " BME280 Humidity"
|
||||
id: z6_hum
|
||||
address: 0x76
|
||||
update_interval: 60s
|
||||
- platform: template
|
||||
name: " BME280 Absolute Humidity"
|
||||
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(z7_temp).state) /
|
||||
(id(z7_temp).state + 243.5)) * id(z6_hum).state * mw) /
|
||||
((273.15 + id(z7_temp).state) * r); // in grams/m^3
|
||||
accuracy_decimals: 2
|
||||
update_interval: 15s
|
||||
icon: 'mdi:water'
|
||||
unit_of_measurement: 'g/m³'
|
||||
- platform: template
|
||||
name: " BME280 Dew Point"
|
||||
lambda: |-
|
||||
return (243.5*(log(id(z6_hum).state/100)+((17.67*id(z7_temp).state)/
|
||||
(243.5+id(z7_temp).state)))/(17.67-log(id(z6_hum).state/100)-
|
||||
((17.67*id(z7_temp).state)/(243.5+id(z7_temp).state))));
|
||||
unit_of_measurement: °C
|
||||
icon: 'mdi:thermometer-alert'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user