82 lines
1.7 KiB
Plaintext
82 lines
1.7 KiB
Plaintext
esphome:
|
|
name: esphome-web-ad0671
|
|
friendly_name: WATCH
|
|
min_version: 2024.11.0
|
|
name_add_mac_suffix: false
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
|
|
# Allow Over-The-Air updates
|
|
ota:
|
|
platform: esphome
|
|
|
|
wifi:
|
|
ssid: "DNTD"
|
|
password: "wifipassword"
|
|
ap:
|
|
ssid: "Mini-Display-Tv--Yellow"
|
|
password: "wifipassword"
|
|
|
|
font:
|
|
- file: "gfonts://Bytesized"
|
|
id: font1
|
|
size: 8
|
|
|
|
light:
|
|
- platform: neopixelbus
|
|
name: "WS2812B LED"
|
|
id: ws2812b
|
|
pin: GPIO15
|
|
num_leds: 1 # Adjust the number of LEDs as per your setup
|
|
type: GRB # Set the color order if needed (e.g., GRB for WS2812B)
|
|
variant: WS2812 # Specify the variant (WS2812 for WS2812B)
|
|
|
|
i2c:
|
|
sda: GPIO5 # D1
|
|
scl: GPIO4 # D2
|
|
scan: true
|
|
|
|
display:
|
|
- platform: ssd1306_i2c
|
|
model: "SH1106 128x64"
|
|
id: sh1106_display
|
|
update_interval: 1s
|
|
address: 0x3C # Default I2C address for SH1106
|
|
lambda: |-
|
|
it.print(0, 0, id(font1), "ESPHome Watch");
|
|
|
|
# Buttons configuration
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin: GPIO0 # Possibly DP09, assuming GPIO0 is used
|
|
name: "Button Up"
|
|
on_press:
|
|
- light.toggle: ws2812b
|
|
- platform: gpio
|
|
pin: GPIO2 # Possibly DP10, assuming GPIO2 is used
|
|
name: "Button Down"
|
|
on_press:
|
|
- light.toggle: ws2812b
|
|
- platform: gpio
|
|
pin: GPIO16 # Button A (changed from GPIO4 to GPIO16)
|
|
name: "Button A"
|
|
on_press:
|
|
- light.toggle: ws2812b
|
|
- platform: gpio
|
|
pin: GPIO12 # Side Button 1 (kept as is)
|
|
name: "Side Button 1"
|
|
on_press:
|
|
- light.toggle: ws2812b
|
|
- platform: gpio
|
|
pin: GPIO14 # Side Button 2 (kept as is)
|
|
name: "Side Button 2"
|
|
on_press:
|
|
- light.toggle: ws2812b
|