-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3ef4903
Showing
29 changed files
with
470 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/secrets.yaml | ||
|
||
# Folder view configuration files | ||
.DS_Store | ||
Desktop.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Stefan's ESPHomeLab | ||
|
||
Currently a WIP, Reuseable config across my ESPHome devices | ||
|
||
## Deploying | ||
|
||
```shell | ||
cd [projectdir] | ||
esphome --substitution release_id "$(md5sum main.yaml | awk '{print $1}' | cut -b-8 )" run main.yaml --device /dev/xxxx | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- platform: as3935 | ||
name: "${node_name} Storm Alert" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- platform: status | ||
name: "${node_name} Connectivity" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# Trick to include secrets in imports | ||
<<: !include ../../secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
esphome: | ||
name: ${node_name} | ||
name_add_mac_suffix: true | ||
project: | ||
name: "stefancrain.${node_name}" | ||
version: ${release_id} | ||
board: ${board} | ||
platform: ${platform} | ||
|
||
# Enable logging | ||
logger: | ||
level: ${log_level} | ||
logs: | ||
switch: INFO | ||
light: WARN | ||
|
||
ota: | ||
password: !secret ota_password | ||
|
||
api: | ||
password: !secret api_password | ||
|
||
light: | ||
- platform: status_led | ||
name: "${node_name} Status LED" | ||
pin: "${pin_led_status}" | ||
restore_mode: ALWAYS_OFF | ||
|
||
web_server: | ||
port: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
wifi: | ||
power_save_mode: none | ||
output_power: 17.5db | ||
networks: | ||
- ssid: !secret wifi_ssid | ||
password: !secret wifi_password | ||
# Enable fallback hotspot (captive portal) in case wifi connection fails | ||
ap: | ||
ssid: "${node_name} Fallback Hotspot" | ||
password: !secret fallback_hotspot_password | ||
|
||
captive_portal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
- id: aqi | ||
mode: restart | ||
then: | ||
# Bad if at least one of the sensor values is bad | ||
- if: | ||
condition: | ||
or: | ||
- sensor.in_range: | ||
id: pm2_5_avg_24h | ||
above: 25 | ||
- sensor.in_range: | ||
id: pm10_avg_24h | ||
above: 50 | ||
then: | ||
- text_sensor.template.publish: | ||
id: aqi | ||
state: Bad | ||
# else: | ||
# # Acceptable if at least one of the sensor values is acceptable | ||
# - if: | ||
# condition: | ||
# or: | ||
# - sensor.in_range: | ||
# id: pm2_5_avg_24h | ||
# above: 12 | ||
# - sensor.in_range: | ||
# id: pm10_avg_24h | ||
# above: 25 | ||
# then: | ||
# - text_sensor.template.publish: | ||
# id: aqi | ||
# state: Acceptable | ||
# else: | ||
# # Otherwise good (all of the sensor values are good) | ||
# - text_sensor.template.publish: | ||
# id: aqi | ||
# state: Good | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# Trick to include secrets in imports | ||
<<: !include ../secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
- platform: pmsx003 | ||
type: PMSX003 | ||
|
||
pm_1_0: | ||
name: "${node_name} Particulate Matter <1.0µm Concentration" | ||
id: pm1 | ||
icon: mdi:chemical-weapon | ||
filters: | ||
- sliding_window_moving_average: | ||
window_size: 30 | ||
send_every: 30 | ||
|
||
pm_2_5: | ||
name: "${node_name} Particulate Matter <2.5µm Concentration" | ||
id: pm2_5 | ||
icon: mdi:chemical-weapon | ||
filters: | ||
- sliding_window_moving_average: | ||
window_size: 30 | ||
send_every: 30 | ||
|
||
pm_10_0: | ||
name: "${node_name} Particulate Matter <10.0µm Concentration" | ||
id: pm10 | ||
icon: mdi:chemical-weapon | ||
filters: | ||
- sliding_window_moving_average: | ||
window_size: 30 | ||
send_every: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
|
||
# https://aqs.epa.gov/aqsweb/documents/codetables/aqi_breakpoints.html | ||
- platform: template | ||
name: "${node_name} US Air Quality Index" | ||
id: us_aqi | ||
value_template: > | ||
{% set vv = states('sensor.pm2_5_avg_24h')|float %} | ||
{% if vv > 0 and vv <= 12 %} | ||
GOOD | ||
{% elif vv > 12 and vv <= 35.5 %} | ||
MODERATE | ||
{% elif vv > 35.5 and vv <= 55.5 %} | ||
UNHEALTHY FOR SENSITIVE | ||
{% elif vv > 55.5 and vv <= 150.5 %} | ||
UNHEALTHY | ||
{% elif vv > 150.5 and vv <= 250.5 %} | ||
VERY UNHEALTHY | ||
{% elif vv > 250.5 %} | ||
HAZARDOUS | ||
{% else %} | ||
UNKNOWN | ||
{% endif %} | ||
- platform: template | ||
name: "${node_name} China Air Quality Index" | ||
id: china_aqi | ||
value_template: > | ||
{% set vv = states('sensor.pm2_5_avg_24h')|float %} | ||
{% if vv > 0 and vv <= 35 %} | ||
GOOD | ||
{% elif vv > 35 and vv <= 75 %} | ||
MODERATE | ||
{% elif vv > 75 and vv <= 115 %} | ||
UNHEALTHY FOR SENSITIVE | ||
{% elif vv > 115 and vv <= 150 %} | ||
UNHEALTHY | ||
{% elif vv > 150 and vv <= 250 %} | ||
VERY UNHEALTHY | ||
{% elif vv > 250 %} | ||
HAZARDOUS | ||
{% else %} | ||
UNKNOWN | ||
{% endif %} | ||
# # The WHO guidelines work with 24-hour averages of the PM2.5 and PM10 sensors | ||
- platform: template | ||
name: "${node_name} Particulate Matter <1µm 24h average" | ||
id: pm1_avg_24h | ||
icon: mdi:chemical-weapon | ||
unit_of_measurement: µg/m³ | ||
lambda: |- | ||
return id(pm1).state; | ||
update_interval: 60s | ||
filters: | ||
- sliding_window_moving_average: | ||
window_size: 1440 # = 24 hours x 60 minutes | ||
send_every: 1 | ||
on_value: | ||
then: | ||
- script.execute: aqi | ||
|
||
# - platform: template | ||
# name: "${node_name} Particulate Matter <2.5µm 24h average" | ||
# id: pm2_5_avg_24h | ||
# icon: mdi:chemical-weapon | ||
# unit_of_measurement: µg/m³ | ||
# lambda: |- | ||
# return id(pm2_5).state; | ||
# update_interval: 60s | ||
# filters: | ||
# - sliding_window_moving_average: | ||
# window_size: 1440 # = 24 hours x 60 minutes | ||
# send_every: 1 | ||
# on_value: | ||
# then: | ||
# - script.execute: update_aqi | ||
|
||
# - platform: template | ||
# name: "${node_name} Particulate Matter <10.0µm 24h average" | ||
# id: pm10_avg_24h | ||
# icon: mdi:chemical-weapon | ||
# unit_of_measurement: µg/m³ | ||
# lambda: |- | ||
# return id(pm10).state; | ||
# update_interval: 60s | ||
# filters: | ||
# - sliding_window_moving_average: | ||
# window_size: 1440 # = 24 hours x 60 minutes | ||
# send_every: 1 | ||
# on_value: | ||
# then: | ||
# - script.execute: update_aqi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- platform: as3935 | ||
lightning_energy: | ||
name: "${node_name} Lightning Energy" | ||
distance: | ||
name: "${node_name} Distance Storm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- platform: bme680_bsec | ||
# Temperature in °C | ||
temperature: | ||
name: "${node_name} BME680 Temperature" | ||
sample_rate: lp | ||
# Pressure in hPa | ||
pressure: | ||
name: "${node_name} BME680 Pressure" | ||
sample_rate: lp | ||
# Relative humidity % | ||
humidity: | ||
name: "${node_name} BME680 Humidity" | ||
sample_rate: lp | ||
# Gas resistance in Ω | ||
gas_resistance: | ||
name: "${node_name} BME680 Gas Resistance" | ||
# Indoor air quality value | ||
iaq: | ||
name: "${node_name} BME680 IAQ" | ||
# IAQ accuracy as a numeric value of 0, 1, 2, 3 | ||
iaq_accuracy: | ||
name: "${node_name} BME680 Numeric IAQ Accuracy" | ||
|
||
# CO2 equivalent estimate in ppm | ||
co2_equivalent: | ||
name: "${node_name} BME680 CO2 Equivalent" | ||
# Volatile organic compounds equivalent estimate in ppm | ||
breath_voc_equivalent: | ||
name: "${node_name} BME680 Breath VOC Equivalent" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# Trick to include secrets in imports | ||
<<: !include ../../secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
- platform: uptime | ||
name: "${node_name} Uptime" | ||
id: uptime_sensor | ||
update_interval: 60s | ||
on_raw_value: | ||
then: | ||
- text_sensor.template.publish: | ||
id: uptime_human | ||
state: !lambda |- | ||
int seconds = round(id(uptime_sensor).raw_state); | ||
int days = seconds / (24 * 3600); | ||
seconds = seconds % (24 * 3600); | ||
int hours = seconds / 3600; | ||
seconds = seconds % 3600; | ||
int minutes = seconds / 60; | ||
seconds = seconds % 60; | ||
return ( | ||
(days ? to_string(days) + "d " : "") + | ||
(hours ? to_string(hours) + "h " : "") + | ||
(minutes ? to_string(minutes) + "m " : "") + | ||
(to_string(seconds) + "s") | ||
).c_str(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# WiFi Signal sensor. | ||
- platform: wifi_signal | ||
name: "${node_name} WiFi Signal" | ||
update_interval: 60s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- platform: bme680_bsec | ||
iaq_accuracy: | ||
name: "${node_name} BME680 IAQ Accuracy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# Trick to include secrets in imports | ||
<<: !include ../../secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
# Make uptime Human Readable | ||
- platform: template | ||
name: "${node_name} Uptime Human Readable" | ||
id: uptime_human | ||
icon: mdi:clock-start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- platform: wifi_info | ||
ip_address: | ||
name: "${node_name} Wifi Device IP Address" | ||
mac_address: | ||
name: "${node_name} Wifi Device Mac Address" | ||
ssid: | ||
name: "${node_name} Wifi Network name - SSID" | ||
bssid: | ||
name: "${node_name} Wifi Router - BSSID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# Trick to include secrets in imports | ||
<<: !include ../../secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# https://esphome.io/components/time.html#home-assistant-time-source | ||
- platform: homeassistant | ||
id: homeassistant_time | ||
on_time_sync: | ||
then: | ||
- logger.log: "Synchronized system clock from Home Assistant" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# https://esphome.io/components/time.html#sntp-time-source | ||
- platform: sntp | ||
timezone: !secret timezone | ||
on_time_sync: | ||
then: | ||
- logger.log: "Synchronized system clock from SNTP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- file: "gfonts://Roboto+Mono" | ||
id: roboto_mono_regular_20 | ||
size: 20 | ||
- file: "gfonts://Roboto+Mono" | ||
id: roboto_mono_regular_16 | ||
size: 16 | ||
- file: "gfonts://Roboto+Mono" | ||
id: roboto_mono_regular_12 | ||
size: 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- file: "gfonts://Roboto" | ||
id: roboto_regular_20 | ||
size: 20 | ||
- file: "gfonts://Roboto" | ||
id: roboto_regular_16 | ||
size: 16 | ||
- file: "gfonts://Roboto" | ||
id: roboto_regular_12 | ||
size: 12 |
Oops, something went wrong.