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

8
_data/.common.yaml Normal file
View File

@@ -0,0 +1,8 @@
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# password: "38fdad38872738fe7c08f77643ed5d56"

4
_data/.esp32.yaml Normal file
View File

@@ -0,0 +1,4 @@
esphome:
name: "${device_name}"
platform: ESP32
board: esp32doit-devkit-v1

4
_data/.esp8266.yaml Normal file
View File

@@ -0,0 +1,4 @@
esphome:
name: "${device_name}"
platform: ESP8266
board: esp01_1m

5
_data/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml

View File

@@ -1,37 +1,3 @@
substitutions:
device_name: r3-cpu-pwr
dn: r3_cpu_pwr
friendly_name: Rack3 Computer Power
esphome:
name: "${device_name}"
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi_oss_ssid
password: !secret wifi_oss_pw
fast_connect: true
manual_ip:
static_ip: 192.168.35.248
gateway: 192.168.35.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name} Fallback Hotspot"
password: !secret wifi_fallback_pw
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# password: !secret gosund_1_ota
binary_sensor:
- platform: gpio
pin:

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'

9
_data/.wifi-oss.yaml Normal file
View File

@@ -0,0 +1,9 @@
wifi:
ssid: !secret wifi_oss_ssid
password: !secret wifi_oss_pw
use_address: "${device_name}"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name}-fallback"
password: !secret wifi_fallback_pw

View File

@@ -0,0 +1,10 @@
substitutions:
device_name: fountain-1-light
dn: fountain_1_light
friendly_name: 1st Floor Fountain Light
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
<<: !include .gosund-wp3.yaml

10
_data/fountain-1.yaml Normal file
View File

@@ -0,0 +1,10 @@
substitutions:
device_name: fountain-1
dn: fountain_1
friendly_name: 1st Floor Fountain Pump
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
<<: !include .gosund-wp3.yaml

View File

@@ -1,33 +1,12 @@
substitutions:
device_name: fountain_outside
device_description: Energy Monitoring Smart Plug with button, blue LED, and red LED.
device_name: fountain-outside
dn: fountain_outside
friendly_name: Fountain Outside
device_description: Energy Monitoring Smart Plug with button, blue LED, and red LED.
esphome:
name: ${device_name}
platform: ESP8266
board: esp01_1m
wifi:
ssid: kungle-ot
password: ThingsWelcomeToKungle
manual_ip:
static_ip: 192.168.37.72
gateway: 192.168.37.1
subnet: 255.255.255.0
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# Enable web server
# web_server:
# port: 80
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
# Enable time component for use by daily power sensor
time:

View File

@@ -1,54 +0,0 @@
esphome:
name: fountain_1
platform: ESP8266
board: esp01_1m
wifi:
ssid: kungle-ot
password: ThingsWelcomeToKungle
manual_ip:
static_ip: 192.168.37.64
gateway: 192.168.37.1
subnet: 255.255.255.0
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLUP
inverted: True
name: "Fountain 1 button"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "Fountain 1 relay"
pin: GPIO14
id: relay
status_led:
pin:
number: GPIO12
inverted: yes
sensor:
- platform: wifi_signal
name: "Fountain 1 WiFi signal"
update_interval: 60s
- platform: uptime
name: "Fountain 1 uptime"
text_sensor:
- platform: version
name: "Fountain 1 ESPHome version"

View File

@@ -1,55 +0,0 @@
esphome:
name: fountain_1_light
platform: ESP8266
board: esp01_1m
wifi:
ssid: kungle-ot
password: ThingsWelcomeToKungle
manual_ip:
static_ip: 192.168.37.66
gateway: 192.168.37.1
subnet: 255.255.255.0
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLUP
inverted: True
name: "Fountain 1 Light button"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "Fountain 1 Light relay"
pin: GPIO14
id: relay
status_led:
pin:
number: GPIO12
inverted: yes
sensor:
- platform: wifi_signal
name: "Fountain 1 Light WiFi signal"
update_interval: 60s
- platform: uptime
name: "Fountain 1 Light uptime"
text_sensor:
- platform: version
name: "Fountain 1 Light ESPHome version"

View File

@@ -1,83 +0,0 @@
substitutions:
device_name: "pj_3_duct_fan_pwr"
friendly_name: "Prj 3 Duct Fan Pwr"
esphome:
name: pj_3_duct_fan_pwr
platform: ESP8266
board: esp01_1m
wifi:
ssid: "kungle-oss"
password: "hcfU8@gG&8Hm"
fast_connect: true
manual_ip:
static_ip: 192.168.35.240
gateway: 192.168.35.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Pj 3 Duct Fan Pwr"
password: "ImgAxoEGSc90"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLUP
inverted: True
name: "${friendly_name} Button"
id: "${device_name}_button"
on_press:
- switch.toggle: "${device_name}_relay"
- platform: status
name: "${friendly_name} Status"
id: "${device_name}_status"
switch:
- platform: gpio
name: "${friendly_name} Relay"
id: "${device_name}_relay"
pin: GPIO14
on_turn_on:
- output.turn_on: led
on_turn_off:
- output.turn_off: led
status_led:
pin:
number: GPIO12
inverted: yes
output:
- platform: gpio
pin: GPIO13
inverted: true
id: led
sensor:
- platform: wifi_signal
name: "${friendly_name} WiFi signal"
id: "${device_name}_wifi_signal"
update_interval: 60s
- platform: uptime
name: "${friendly_name} Uptime"
id: "${device_name}_uptime"
update_interval: 60s
text_sensor:
- platform: version
name: "${friendly_name} ESPHome Version"
id: "${device_name}_esphome_version"

View File

@@ -1,68 +1,56 @@
substitutions:
device_name: prj-3
dn: prj_3
sn: P3
friendly_name: Prj 3
duct_fan_pin: GPIO14
duct_fan_spd_name: Prj3 Duct Fan Speed
duct_fan_target_spd_in_name: Prj3 Duct Fan Target Speed In
duct_fan_target_spd_prj_name: Prj3 Duct Fan Target Speed Prj
duct_fan_target_spd_out_name: Prj3 Duct Fan Target Speed Out
duct_fan_name: ${sn} Duct Fan Spd
duct_fan_tgt_spd_in_name: ${sn} Duct Fan Tgt Spd In
duct_fan_tgt_spd_prj_name: ${sn} Duct Fan Tgt Spd Prj
duct_fan_tgt_spd_out_name: ${sn} Duct Fan Tgt Spd Out
duct_fan_pwmfreq: 5000Hz
duct_fan_off_spd: "0.0"
duct_fan_lo_spd: "1.0"
duct_fan_vent_spd: "50.0"
duct_fan_hi_spd: "100.0"
prjpwr_pin: GPIO19
prjpwr_name: Prj3 Pwr
prjpwr_name: ${sn} Pwr
dallas_pin: GPIO32
dallas_in_addr: "0x1F3C01D0756F0928"
dallas_in_name: Prj3 Temp In
dallas_in_name: ${sn} Temp In
dallas_prj_addr: "0x873C01D0756D4B28"
dallas_prj_name: Prj3 Temp Prj
dallas_prj_name: ${sn} Temp Prj
dallas_out_addr: "0xA901143295610E28"
dallas_out_name: Prj3 Temp Out
dallas_out_name: ${sn} Temp Out
dallas_update_interval: 30s
globals:
- id: duct_fan_off_spd
- id: duct_fan_off_spd_id
type: float
initial_value: ${duct_fan_off_spd}
- id: duct_fan_lo_spd
- id: duct_fan_lo_spd_id
type: float
initial_value: ${duct_fan_lo_spd}
- id: duct_fan_vent_spd
- id: duct_fan_vent_spd_id
type: float
initial_value: ${duct_fan_vent_spd}
- id: duct_fan_hi_spd
- id: duct_fan_hi_spd_id
type: float
initial_value: ${duct_fan_hi_spd}
<<: !include .common.yaml
<<: !include .wifi-oss.yaml
esphome:
name: prj3
platform: ESP32
board: esp32doit-devkit-v1
wifi:
ssid: "kungle-oss"
password: "hcfU8@gG&8Hm"
fast_connect: true
manual_ip:
static_ip: 192.168.35.192
gateway: 192.168.35.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Prj3 Fallback Hotspot"
password: "xfPfYSP3N0C3"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
on_boot:
- priority: 200.0
then:
- output.set_level:
id: duct_fan_output_id
level: ${duct_fan_vent_spd}%
switch:
- platform: template
@@ -80,7 +68,7 @@ fan:
- platform: speed
id: duct_fan_spd_id
output: duct_fan_output_id
name: ${duct_fan_spd_name}
name: ${duct_fan_name}
dallas:
- pin:
@@ -114,15 +102,15 @@ binary_sensor:
number:
- platform: template
id: duct_fan_target_spd_in
name: ${duct_fan_target_spd_in_name}
id: duct_fan_tgt_spd_in
name: ${duct_fan_tgt_spd_in_name}
optimistic: true
min_value: ${duct_fan_lo_spd}
max_value: ${duct_fan_hi_spd}
step: 1
- platform: template
id: duct_fan_target_spd_prj
name: ${duct_fan_target_spd_prj_name}
id: duct_fan_tgt_spd_prj
name: ${duct_fan_tgt_spd_prj_name}
min_value: ${duct_fan_off_spd}
max_value: ${duct_fan_hi_spd}
step: 1
@@ -140,10 +128,10 @@ number:
lo_temp = id(thermostat_prj_id).target_temperature_low;
hi_temp = id(thermostat_prj_id).target_temperature_high;
curtemp = id(dallas_prj_id).state;
off_spd = id(duct_fan_off_spd);
lo_spd = id(duct_fan_lo_spd);
vent_spd = id(duct_fan_vent_spd);
hi_spd = id(duct_fan_hi_spd);
off_spd = id(duct_fan_off_spd_id);
lo_spd = id(duct_fan_lo_spd_id);
vent_spd = id(duct_fan_vent_spd_id);
hi_spd = id(duct_fan_hi_spd_id);
ESP_LOGD("fan_speed", "DEBUG Ventilate House: %d", id(ventilate_house).state);
ESP_LOGD("fan_speed", "DEBUG Current Temp: %f", curtemp);
ESP_LOGD("fan_speed", "DEBUG Thermostat State: %d", id(thermostat_on_id).state);
@@ -154,9 +142,14 @@ number:
call.perform();
return off_spd;
}
if (curtemp > hi_temp) {
if (std::isnan(curtemp)) {
ESP_LOGD("fan_speed", "DEBUG current temp unknown. Set spd to vent.");
newspd = vent_spd;
} else if (curtemp > hi_temp) {
ESP_LOGD("fan_speed", "DEBUG curtemp > hi_temp");
newspd = hi_spd;
} else if (curtemp < lo_temp) {
newspd = lo_spd;
} else {
// Set newspd to same linear proportion of spd range as current temp is of temp range
newspd = lo_spd + ((hi_spd - lo_spd) * (curtemp - lo_temp) / (hi_temp - lo_temp));
@@ -178,8 +171,8 @@ number:
call.perform();
return newspd;
- platform: template
id: duct_fan_target_spd_out
name: ${duct_fan_target_spd_out_name}
id: duct_fan_tgt_spd_out
name: ${duct_fan_tgt_spd_out_name}
optimistic: true
min_value: ${duct_fan_off_spd}
max_value: ${duct_fan_hi_spd}
@@ -204,12 +197,12 @@ climate:
min_heating_run_time: 60s
min_idle_time: 60s
heat_action:
- logger.log: "Turning off Prj3 Thermostat"
- logger.log: "Turning off ${friendly_name} Thermostat"
- switch.turn_off: thermostat_on_id
idle_action:
- logger.log: "Turning on Prj3 Thermostat"
- logger.log: "Turning on ${friendly_name} Thermostat"
- switch.turn_on: thermostat_on_id
cool_action:
- logger.log: "WARNING: Prj3 Thermostat has hit high temp!"
- logger.log: "WARNING: ${friendly_name} Thermostat has hit high temp!"
- switch.turn_on: thermostat_on_id
#TODO - provide some kind of warning / action here

View File

@@ -0,0 +1,10 @@
substitutions:
device_name: "prj3-duct-fan-pwr"
dn: "prj3_duct_fan_pwr"
friendly_name: "Prj 3 Duct Fan Pwr"
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
<<: !include .gosund-wp3.yaml

10
_data/rack-2-df-pwr.yaml Normal file
View File

@@ -0,0 +1,10 @@
substitutions:
device_name: rack-2-df-pwr
dn: rack_2_df_pwr
friendly_name: Rack 2 Duct Fan Power
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
<<: !include .gosund-wp3.yaml

10
_data/rack-3-cpu-pwr.yaml Normal file
View File

@@ -0,0 +1,10 @@
substitutions:
device_name: rack-3-cpu-pwr
dn: rack_3_cpu_pwr
friendly_name: Rack3 Computer Power
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
<<: !include .gosund-wp3.yaml

10
_data/rack-3-df-pwr.yaml Normal file
View File

@@ -0,0 +1,10 @@
substitutions:
device_name: rack-3-df-pwr
dn: rack_3_df_pwr
friendly_name: Rack 3 Duct Fan Power
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
<<: !include .gosund-wp3.yaml

View File

@@ -1,55 +0,0 @@
esphome:
name: rack_2_duct_fan_pwr
platform: ESP8266
board: esp01_1m
wifi:
ssid: kungle-ot
password: ThingsWelcomeToKungle
manual_ip:
static_ip: 192.168.37.70
gateway: 192.168.37.1
subnet: 255.255.255.0
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# binary_sensor:
# - platform: gpio
# pin:
# number: GPIO4
# mode: INPUT_PULLUP
# inverted: True
# name: "Rack 2 Duct Fan Power Button"
# on_press:
# - switch.toggle: relay
switch:
- platform: gpio
name: "Rack 2 Duct Fan Power Relay"
pin: GPIO14
id: relay
status_led:
pin:
number: GPIO12
inverted: yes
# sensor:
# - platform: wifi_signal
# name: "Rack 2 Duct Fan Power WiFi Signal"
# update_interval: 60s
# - platform: uptime
# name: "Rack 2 Duct Fan Power uptime"
# text_sensor:
# - platform: version
# name: "Rack 2 Duct Fan Power ESPHome Version"

View File

@@ -39,6 +39,9 @@ globals:
type: float
initial_value: ${duct_fan_hi_spd}
<<: !include .common.yaml
<<: !include .wifi-oss.yaml
esphome:
name: rack_3
platform: ESP32
@@ -50,30 +53,6 @@ esphome:
id: duct_fan_output_id
level: ${duct_fan_vent_spd}%
wifi:
ssid: "kungle-ot"
password: "ThingsWelcomeToKungle"
manual_ip:
static_ip: 192.168.37.74
gateway: 192.168.37.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Rack 3 Fallback Hotspot"
password: "jj0CXEgu3Lzo"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
switch:
- platform: template
name: Thermostat On

View File

@@ -1,55 +0,0 @@
esphome:
name: rack_3_duct_fan_pwr
platform: ESP8266
board: esp01_1m
wifi:
ssid: kungle-ot
password: ThingsWelcomeToKungle
manual_ip:
static_ip: 192.168.37.68
gateway: 192.168.37.1
subnet: 255.255.255.0
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# binary_sensor:
# - platform: gpio
# pin:
# number: GPIO4
# mode: INPUT_PULLUP
# inverted: True
# name: "Rack 3 Duct Fan Power Button"
# on_press:
# - switch.toggle: relay
switch:
- platform: gpio
name: "Rack 3 Duct Fan Power Relay"
pin: GPIO14
id: relay
status_led:
pin:
number: GPIO12
inverted: yes
# sensor:
# - platform: wifi_signal
# name: "Rack 3 Duct Fan Power WiFi Signal"
# update_interval: 60s
# - platform: uptime
# name: "Rack 3 Duct Fan Power uptime"
# text_sensor:
# - platform: version
# name: "Rack 3 Duct Fan Power ESPHome Version"

View File

@@ -3,76 +3,8 @@ substitutions:
dn: tv1_cpu_pwr
friendly_name: 1st Floor TV Computer Power
esphome:
name: "${device_name}"
platform: ESP8266
board: esp01_1m
<<: !include .common.yaml
<<: !include .esp8266.yaml
<<: !include .wifi-oss.yaml
wifi:
ssid: !secret wifi_oss_ssid
password: !secret wifi_oss_pw
use_address: "${device_name}"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name}-fallback"
password: !secret wifi_fallback_pw
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# password: !secret gosund_1_ota
binary_sensor:
- platform: gpio
pin:
number: GPIO4
mode: INPUT_PULLUP
inverted: True
name: "${friendly_name} Button"
id: "${dn}_button"
on_press:
- switch.toggle: "${dn}_relay"
- platform: status
name: "${friendly_name} Status"
id: "${dn}_status"
switch:
- platform: gpio
name: "${friendly_name} Relay"
id: "${dn}_relay"
pin: GPIO14
on_turn_on:
- output.turn_on: led
on_turn_off:
- output.turn_off: led
status_led:
pin:
number: GPIO12
inverted: yes
output:
- platform: gpio
pin: GPIO13
inverted: true
id: led
sensor:
- platform: wifi_signal
name: "${friendly_name} WiFi signal"
id: "${dn}_wifi_signal"
update_interval: 60s
- platform: uptime
name: "${friendly_name} Uptime"
id: "${dn}_uptime"
update_interval: 60s
text_sensor:
- platform: version
name: "${friendly_name} ESPHome Version"
id: "${dn}_esphome_version"
<<: !include .gosund-wp3.yaml

View File

@@ -1,74 +1,9 @@
substitutions:
device_name: In1
device_name: weather-in-1
dn: In1
esphome:
name: weather-in-1
<<: !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.246
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

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

View File

@@ -1,74 +1,9 @@
substitutions:
device_name: OutS
device_name: weather-out-s
dn: OutS
esphome:
name: weather-out-s
<<: !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.242
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