Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save BrianAker/1e40226de07746bc10588cc4c8593bce to your computer and use it in GitHub Desktop.

Select an option

Save BrianAker/1e40226de07746bc10588cc4c8593bce to your computer and use it in GitHub Desktop.
esphome:
name: esp32-c3
friendly_name: esp32-c3
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "replace_me="
ota:
password: "replace_me"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
i2c:
sda: 5
scl: 6
scan: true
id: bus_a
external_components:
- source: github://pr#4243
components:
- ens160
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 60s
- platform: bme280
temperature:
name: "BME280 Temperature"
oversampling: 16x
id: bme280_sensor_temp
pressure:
name: "BME280 Pressure"
id: bme280_sensor_pressure
humidity:
name: "BME280 Humidity"
id: bme280_sensor_humidity
update_interval: 60s
- platform: ens160
eco2:
name: "eCO2 Value"
tvoc:
name: "Total Volatile Organic Compounds"
aqi:
name: "Air Quality Index"
id: ens160_air_quality_index
compensation:
temperature: bme280_sensor_temp
humidity: bme280_sensor_humidity
address: 0x53
# update_interval: 5s
text_sensor:
- platform: template
name: "ENS160 Air Quality Rating"
lambda: |-
switch ( (int) (id(ens160_air_quality_index).state) ) {
case 1: return {"Excellent"};
case 2: return {"Good"};
case 3: return {"Moderate"};
case 4: return {"Poor"};
case 5: return {"Unhealthy"};
default: return {"Not Available"};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment