145 lines
3.0 KiB
YAML
145 lines
3.0 KiB
YAML
esphome:
|
|
name: itlabs1
|
|
|
|
esp32:
|
|
board: adafruit_feather_esp32s2_tft
|
|
framework:
|
|
type: esp-idf
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
password: ""
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: ""
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "water alert"
|
|
pin: GPIO5
|
|
|
|
sensor:
|
|
- platform: adc
|
|
pin: A5
|
|
id: plant_0_soil_moisture
|
|
name: "plant_0_soil_moisture"
|
|
attenuation: 12db
|
|
unit_of_measurement: '%'
|
|
# the max voltage on the adc will be ~3V from the sensor, which would
|
|
# be a dead short on the prongs
|
|
# let's say 2V is a good amount of moist, so we compare against that
|
|
# x = the measured voltage
|
|
filters:
|
|
- lambda: return x/2*100;
|
|
|
|
spi:
|
|
clk_pin: GPIO36
|
|
mosi_pin: GPIO35
|
|
miso_pin: GPIO37
|
|
|
|
display:
|
|
- platform: ili9xxx
|
|
id: my_display
|
|
model: st7789v
|
|
cs_pin: GPIO7
|
|
dc_pin: GPIO39
|
|
reset_pin: GPIO40
|
|
invert_colors: true
|
|
dimensions:
|
|
width: 135
|
|
height: 240
|
|
offset_width: 52
|
|
offset_height: 40
|
|
rotation: 90
|
|
pages:
|
|
- id: page1
|
|
lambda: |-
|
|
it.image(0, 0, id(flowerpot));
|
|
it.image(160, 75, id(itlab25));
|
|
it.printf(3, 3, id(hurmit_regular), "Water level:");
|
|
it.printf(50, 35, id(hurmit_regular), "%.1f %%", id(plant_0_soil_moisture).state);
|
|
- id: page2
|
|
lambda: |-
|
|
it.image(0, 0, id(flowerpot));
|
|
it.image(160, 75, id(itlab25));
|
|
it.printf(3, 3, id(hurmit_small), "Network Information");
|
|
it.printf(3, 35, id(hurmit_small), "SSID: %s", id(info_ssid).state.c_str());
|
|
it.printf(3, 55, id(hurmit_small), "IP: %s", id(info_ip).state.c_str());
|
|
it.printf(3, 75, id(hurmit_small), "MAC:");
|
|
it.printf(3, 95, id(hurmit_small), "%s", id(info_mac).state.c_str());
|
|
|
|
interval:
|
|
- interval: 5s
|
|
then:
|
|
- display.page.show_next: my_display
|
|
- component.update: my_display
|
|
|
|
image:
|
|
- file: "flowerpot.png"
|
|
type: rgb
|
|
transparency: alpha_channel
|
|
id: flowerpot
|
|
resize: 135x135
|
|
- file: "itlab25.png"
|
|
type: rgb
|
|
transparency: alpha_channel
|
|
id: itlab25
|
|
resize: 80x80
|
|
|
|
|
|
font:
|
|
- file: "HurmitNerdFont-Regular.otf"
|
|
id: hurmit_regular
|
|
size: 28
|
|
- file: "HurmitNerdFont-Regular.otf"
|
|
id: hurmit_small
|
|
size: 20
|
|
|
|
output:
|
|
- platform: ledc
|
|
pin: GPIO45
|
|
id: screen_led
|
|
|
|
- platform: gpio
|
|
pin: GPIO21
|
|
inverted: true
|
|
id: tft_power
|
|
|
|
|
|
light:
|
|
- platform: monochromatic
|
|
output: screen_led
|
|
id: backlight
|
|
name: Backlight
|
|
restore_mode: ALWAYS_ON
|
|
|
|
|
|
wifi:
|
|
#ssid: "Zyxel"
|
|
#password: "12345678"
|
|
ssid: "ITL@bs"
|
|
password: "StStefan202!"
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "Itlabs1 Fallback Hotspot"
|
|
password: "qsri9vnu7Y9n"
|
|
|
|
# Example configuration entry
|
|
text_sensor:
|
|
- platform: wifi_info
|
|
ip_address:
|
|
name: ESP IP Address
|
|
id: info_ip
|
|
ssid:
|
|
name: ESP Connected SSID
|
|
id: info_ssid
|
|
mac_address:
|
|
name: ESP Mac Wifi Address
|
|
id: info_mac
|
|
|
|
captive_portal:
|
|
|