83 lines
1.6 KiB
YAML
83 lines
1.6 KiB
YAML
esphome:
|
|
name: esp32-c3-mini
|
|
friendly_name: esp32-c3-mini
|
|
|
|
esp32:
|
|
board: esp32-c3-devkitm-1
|
|
framework:
|
|
type: esp-idf
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: "A5RVepFuPVpUhQwqQfa8rGoRK4f2i5XUGX5YoJY4Tkw="
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: "ad893c624f32313071dc42a75e6a3c6c"
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "Esp32-C3-Mini Fallback Hotspot"
|
|
password: "0fPh87TAs9ZB"
|
|
|
|
captive_portal:
|
|
|
|
time:
|
|
- platform: homeassistant
|
|
id: ha_time
|
|
|
|
spi:
|
|
id: spi_display
|
|
clk_pin: 4 # 4 SCL 핀
|
|
mosi_pin: 3 # 6 SDA 핀 (변경)
|
|
|
|
display:
|
|
- platform: st7789v
|
|
spi_id: spi_display
|
|
model: Custom
|
|
width: 240
|
|
height: 320
|
|
offset_height: 0
|
|
offset_width: 0
|
|
dc_pin: 2
|
|
reset_pin: 1
|
|
cs_pin: 0
|
|
eightbitcolor: true
|
|
rotation: 90
|
|
update_interval: 10s
|
|
|
|
|
|
lambda: |-
|
|
it.fill(Color(0, 0, 0));
|
|
|
|
// 현재 시간 가져오기
|
|
auto time = id(ha_time).now();
|
|
|
|
// 위: 월/일 표시
|
|
it.printf(160, 60, id(my_font), Color(255, 255, 255), TextAlign::CENTER,
|
|
"%02d-%02d", time.month, time.day_of_month);
|
|
|
|
// 아래: 시간:분 표시 (큰 글씨)
|
|
it.printf(160, 180, id(time_font), Color(255, 255, 0), TextAlign::CENTER,
|
|
"%02d:%02d", time.hour, time.minute);
|
|
|
|
|
|
font:
|
|
- file: "IBMPlexSansKR-Text.ttf"
|
|
id: my_font
|
|
size: 65
|
|
glyphs: "0123456789:-"
|
|
|
|
- file: "IBMPlexSansKR-Text.ttf"
|
|
id: time_font
|
|
size: 100
|
|
glyphs: "0123456789:"
|