mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
144 lines
3.1 KiB
YAML
144 lines
3.1 KiB
YAML
substitutions:
|
|
devicename: test-device-1
|
|
entity_name: test_device_1
|
|
friendly_name: Test Device 1
|
|
board: esp32dev
|
|
framework: esp-idf
|
|
comment: Clever Device
|
|
|
|
esp32:
|
|
board: ${board}
|
|
framework:
|
|
type: ${framework}
|
|
|
|
packages:
|
|
network: !include common/wifi_dhcp.yaml
|
|
device_base: !include common/device_base.yaml
|
|
web_server: !include common/web_server.yaml
|
|
|
|
# For Ultrasonic Sensor
|
|
# trigger_pin: GPIO13
|
|
# echo_pin: GPIO14
|
|
|
|
# i2c:
|
|
# - id: bus_a
|
|
# sda: 21
|
|
# scl: 22
|
|
# scan: true
|
|
|
|
# - id: bus_b
|
|
# sda: 32
|
|
# scl: 33
|
|
# scan: true
|
|
|
|
# sensor:
|
|
# - platform: ultrasonic
|
|
# update_interval: 1s
|
|
# trigger_pin: GPIO13
|
|
# echo_pin: GPIO14
|
|
# name: "Ultrasonic Sensor"
|
|
|
|
# - platform: bme280_i2c
|
|
# i2c_id: bus_a
|
|
# address: 0x76
|
|
# update_interval: 10s
|
|
# temperature:
|
|
# name: "BME280 76A Temperature"
|
|
# pressure:
|
|
# name: "BME280 76A Pressure"
|
|
# humidity:
|
|
# name: "BME280 76A Humidity"
|
|
|
|
# - platform: bme280_i2c
|
|
# i2c_id: bus_b
|
|
# address: 0x76
|
|
# update_interval: 10s
|
|
# temperature:
|
|
# name: "BME280 76B Temperature"
|
|
# pressure:
|
|
# name: "BME280 76B Pressure"
|
|
# humidity:
|
|
# name: "BME280 76B Humidity"
|
|
|
|
# - platform: bme680
|
|
# i2c_id: bus_a
|
|
# temperature:
|
|
# name: "BME680 Temperature"
|
|
# oversampling: 16x
|
|
# pressure:
|
|
# name: "BME680 Pressure"
|
|
# humidity:
|
|
# id: "humidity"
|
|
# name: "BME680 Humidity"
|
|
# gas_resistance:
|
|
# id: "gas_resistance"
|
|
# name: "BME680 Gas Resistance"
|
|
# address: 0x77
|
|
# update_interval: 60s
|
|
# - platform: template
|
|
# name: "BME680 Indoor Air Quality"
|
|
# id: iaq
|
|
# icon: "mdi:gauge"
|
|
# # calculation: comp_gas = log(R_gas[ohm]) + 0.04 log(Ohm)/%rh * hum[%rh]
|
|
# lambda: |-
|
|
# return log(id(gas_resistance).state) + 0.04 * id(humidity).state;
|
|
# state_class: "measurement"
|
|
|
|
|
|
# text_sensor:
|
|
# - platform: template
|
|
# name: "BME680 IAQ Classification"
|
|
# icon: "mdi:checkbox-marked-circle-outline"
|
|
# lambda: |-
|
|
# if (int(id(iaq).state) <= 50) {
|
|
# return {"Excellent"};
|
|
# }
|
|
# else if (int(id(iaq).state) <= 100) {
|
|
# return {"Good"};
|
|
# }
|
|
# else if (int(id(iaq).state) <= 150) {
|
|
# return {"Lightly polluted"};
|
|
# }
|
|
# else if (int(id(iaq).state) <= 200) {
|
|
# return {"Moderately polluted"};
|
|
# }
|
|
# else if (int(id(iaq).state) <= 250) {
|
|
# return {"Heavily polluted"};
|
|
# }
|
|
# else if (int(id(iaq).state) <= 350) {
|
|
# return {"Severely polluted"};
|
|
# }
|
|
# else if (int(id(iaq).state) <= 500) {
|
|
# return {"Extremely polluted"};
|
|
# }
|
|
# else {
|
|
# return {"unknown"};
|
|
# }
|
|
|
|
|
|
# esp32_touch:
|
|
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: "Door"
|
|
device_class: door
|
|
pin:
|
|
number: 16
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
|
|
- platform: gpio
|
|
#threshold: 1000
|
|
name: "Moisture"
|
|
device_class: moisture
|
|
pin:
|
|
number: 12
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
|
|
# - platform: esp32_touch
|
|
# threshold: 1000
|
|
# name: "Moisture"
|
|
# device_class: moisture
|
|
# pin: 14 |