Modularize and move all to kungle-oss.

This commit is contained in:
2022-07-03 08:40:41 -07:00
parent 918bf7e19a
commit d9bbeb1704
26 changed files with 207 additions and 725 deletions

40
_data/.weather.yaml Normal file
View File

@@ -0,0 +1,40 @@
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
sensor:
- platform: bme280
temperature:
name: Temp${dn}
id: bme280_temperature
pressure:
name: Press${dn}
id: bme280_pressure
humidity:
name: HumidityRel${dn}
id: bme280_humidity
address: 0x76
update_interval: 15s
# Templates from https://esphome.io/cookbook/bme280_environment.html
- platform: template
name: HumidityAbs${dn}
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(bme280_temperature).state) /
(id(bme280_temperature).state + 243.5)) * id(bme280_humidity).state * mw) /
((273.15 + id(bme280_temperature).state) * r); // in grams/m^3
accuracy_decimals: 2
update_interval: 15s
icon: 'mdi:water'
unit_of_measurement: 'g/m³'
- platform: template
name: DewPt${dn}
lambda: |-
return (243.5*(log(id(bme280_humidity).state/100)+((17.67*id(bme280_temperature).state)/
(243.5+id(bme280_temperature).state)))/(17.67-log(id(bme280_humidity).state/100)-
((17.67*id(bme280_temperature).state)/(243.5+id(bme280_temperature).state))));
unit_of_measurement: °C
icon: 'mdi:thermometer-alert'