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

View File

@@ -1,74 +1,9 @@
substitutions:
device_name: OutN
device_name: weather-out-n
dn: OutN
esphome:
name: weather-out-n
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# password: "38fdad38872738fe7c08f77643ed5d56"
wifi:
ssid: !secret wifi_oss_ssid
password: !secret wifi_oss_password
manual_ip:
static_ip: 192.168.35.244
gateway: 192.168.35.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Weather-Out-S Fallback Hotspot"
password: "0xINHxW0IbSK"
captive_portal:
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
sensor:
- platform: bme280
temperature:
name: Temp${device_name}
id: bme280_temperature
pressure:
name: Press${device_name}
id: bme280_pressure
humidity:
name: HumidityRel${device_name}
id: bme280_humidity
address: 0x76
update_interval: 15s
# Templates from https://esphome.io/cookbook/bme280_environment.html
- platform: template
name: HumidityAbs${device_name}
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${device_name}
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'
<<: !include .weather.yaml