Skip to content

Instantly share code, notes, and snippets.

@byurhannurula
Created May 16, 2024 16:57
Show Gist options
  • Save byurhannurula/861c51e573087d54426ce2c59672422f to your computer and use it in GitHub Desktop.
Save byurhannurula/861c51e573087d54426ce2c59672422f to your computer and use it in GitHub Desktop.
substitutions:
....
esphome:
name: ${name}
friendly_name: "${device_name}"
comment: "${device_name} by ${device_make}"
project:
name: "${device_make}.${device_name}"
version: "${sw_version}"
esp8266:
board: esp01_1m
logger:
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: "..."
ota:
password: "..."
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
i2c:
id: bus_a
sda: GPIO4
scl: GPIO5
scan: false
uart:
id: uart_a
tx_pin: GPIO15
rx_pin: GPIO0
baud_rate: 9600
light:
- platform: status_led
name: "ESP Status LED"
pin: GPIO2
entity_category: config
sensor:
- platform: uptime
name: Uptime
id: sys_uptime
update_interval: ${general_update_interval}
- platform: wifi_signal
name: "${device_name} WiFi Signal"
update_interval: ${general_update_interval}
# PMS5003 https://esphome.io/components/sensor/pmsx003.html
- platform: pmsx003
type: PMSX003
uart_id: uart_a
pm_1_0:
id: pm1
name: "PM 1.0µm"
device_class: pm1 # Added to report properly to HomeKit
pm_2_5:
id: pm2
name: "PM 2.5µm"
device_class: pm25 # Added to report properly to HomeKit
pm_10_0:
id: pm10
name: "PM 10µm"
device_class: pm10 # Added to report properly to HomeKit
update_interval: ${pms_update_interval}
- platform: sht3xd
id: sht3xd_sensor
address: ${sht30_addr}
temperature:
id: temperature
name: "Temperature"
accuracy_decimals: 1
filters:
- offset: ${temperature_offset}
- lambda: "return x + id(temperature_offset_ui).state;"
humidity:
id: humidity
name: "Humidity"
accuracy_decimals: 1
filters:
- offset: ${humidity_offset}
- lambda: "return x + id(humidity_offset_ui).state;"
update_interval: ${general_update_interval}
- platform: scd4x
address: ${scd40_addr}
i2c_id: bus_a
id: scd4x_sensor
co2:
id: co2
name: "CO2"
automatic_self_calibration: false
update_interval: ${general_update_interval}
- platform: bh1750
name: Illuminance
id: illuminance_sensor
address: ${illuminance_addr}
update_interval: ${illuminance_update_interval}
number:
.......
button:
- platform: restart
name: "Restart"
entity_category: config
- platform: factory_reset
name: ${device_name} Factory Reset
icon: "mdi:restart-alert"
entity_category: config
disabled_by_default: true
text_sensor:
- platform: template
name: "${device_name} Config Version"
lambda: return {"${sw_version}"};
icon: "mdi:tag"
entity_category: diagnostic
- platform: wifi_info
ip_address:
id: ip_address
name: "${device_name} IP Address"
icon: "mdi:wan"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment