add initial sensor configuration files

This commit is contained in:
2025-07-16 17:07:57 +01:00
parent d2aa21b4de
commit 48a468088a
3 changed files with 439 additions and 0 deletions

View File

@@ -0,0 +1,112 @@
esphome:
name: name
friendly_name: Name
# Boot sequence - start with WiFi connecting effect
on_boot:
- priority: 600
then:
- logger.log: "Device booting, starting WiFi connection"
- light.turn_on:
id: status_led
effect: "wifi_connecting"
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
CONFIG_AUDIO_BOARD_CUSTOM: "y"
psram:
mode: octal
speed: 80MHz
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "ZGLTCJYjvXIJA0LIP8o/k9Vp+Tia9AhHgXZ/WHCQ1gQ="
# API connection event handlers
on_client_connected:
- logger.log: "Home Assistant API connected"
- light.turn_off: status_led
on_client_disconnected:
- logger.log: "Home Assistant API disconnected"
- light.turn_on:
id: status_led
effect: "ha_connecting"
# Allow Over-The-Air updates
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# WiFi connection event handlers
on_connect:
- logger.log: "WiFi connected, attempting Home Assistant connection"
- light.turn_on:
id: status_led
effect: "ha_connecting"
on_disconnect:
- logger.log: "WiFi disconnected"
- light.turn_on:
id: status_led
effect: "wifi_connecting"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Living-Room-Sensor Hotspot"
password: !secret ota_password
# Status LED configuration
light:
- platform: esp32_rmt_led_strip
id: status_led
name: "Status LED"
pin: GPIO48
num_leds: 1
chipset: ws2812
rgb_order: GRB
effects:
# Yellow blinking during WiFi connection
- strobe:
name: "wifi_connecting"
colors:
- state: true
brightness: 80%
red: 100%
green: 100%
blue: 0%
duration: 500ms
- state: false
duration: 500ms
# Orange blinking during Home Assistant connection
- strobe:
name: "ha_connecting"
colors:
- state: true
brightness: 80%
red: 100%
green: 65%
blue: 0%
duration: 300ms
- state: false
duration: 300ms
button:
- platform: restart
name: "Restart Sensor"
id: restart_button