145 lines
3.7 KiB
Plaintext
145 lines
3.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 with debug level
|
|
logger:
|
|
level: DEBUG # Explicitly set logging level to DEBUG
|
|
|
|
# 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://Roboto"
|
|
id: font1
|
|
size: 12
|
|
|
|
|
|
light:
|
|
# WS2812B LED strip configuration
|
|
- platform: neopixelbus
|
|
name: "WS2812B LED"
|
|
id: ws2812b
|
|
pin: GPIO15 # Keeping WS2812B on 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)
|
|
effects:
|
|
- pulse:
|
|
- pulse:
|
|
name: "Fast Pulse"
|
|
transition_length: 0.5s
|
|
update_interval: 0.5s
|
|
min_brightness: 0%
|
|
max_brightness: 100%
|
|
- pulse:
|
|
name: "Slow Pulse"
|
|
transition_length: 500ms
|
|
update_interval: 2s
|
|
- pulse:
|
|
name: "Asymmetrical Pulse"
|
|
transition_length:
|
|
on_length: 1s
|
|
off_length: 500ms
|
|
update_interval: 1.5s
|
|
- random:
|
|
name: Random Effect With Custom Values
|
|
transition_length: 5s
|
|
update_interval: 7s
|
|
- strobe:
|
|
name: Strobe Effect With Custom Values
|
|
colors:
|
|
- state: true
|
|
brightness: 100%
|
|
red: 100%
|
|
green: 90%
|
|
blue: 0%
|
|
duration: 500ms
|
|
- state: false
|
|
duration: 250ms
|
|
- state: true
|
|
brightness: 100%
|
|
red: 0%
|
|
green: 100%
|
|
blue: 0%
|
|
duration: 500ms
|
|
- flicker:
|
|
name: Flicker Effect With Custom Values
|
|
alpha: 95%
|
|
intensity: 3.3%
|
|
|
|
i2c:
|
|
sda: GPIO5 # D1
|
|
scl: GPIO4 # D2
|
|
scan: true
|
|
|
|
# Define a sensor to grab the temperature from Home Assistant weather entity
|
|
sensor:
|
|
- platform: homeassistant
|
|
id: temperature
|
|
entity_id: weather.home
|
|
attribute: temperature
|
|
internal: true
|
|
|
|
# Text sensors for weather and location information
|
|
text_sensor:
|
|
# Current weather condition from Home Assistant
|
|
- platform: homeassistant
|
|
id: weather_condition
|
|
entity_id: weather.home # The entity_id for weather condition
|
|
internal: true
|
|
|
|
# Display configuration to show the weather condition and location
|
|
display:
|
|
- platform: ssd1306_i2c
|
|
model: "SH1106 128x64"
|
|
id: sh1106_display
|
|
update_interval: 1s
|
|
address: 0x3C # Default I2C address for SH1106
|
|
lambda: |-
|
|
// Display current weather condition
|
|
it.print(0, 10, id(font1), id(weather_condition).state.c_str());
|
|
|
|
// Display current temperature under the weather condition
|
|
String temp_str = "Temp: " + String(id(temperature).state) + " °F"; // Create the temperature string
|
|
it.print(0, 20, id(font1), temp_str.c_str()); // Convert the String to a const char* and display it
|
|
|
|
# Define pull-up buttons for GPIOs
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO12
|
|
mode: INPUT_PULLUP
|
|
name: "Button GPIO12"
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO13
|
|
mode: INPUT_PULLUP
|
|
name: "Button GPIO13"
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO14
|
|
mode: INPUT_PULLUP
|
|
name: "Button GPIO14"
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0 # Boot button on most ESP32 boards
|
|
mode: INPUT_PULLUP
|
|
inverted: true # Inverted because it's typically pulled low when pressed
|
|
name: "Boot Button" |