mirror of
https://github.com/ryansch/esphome-config.git
synced 2025-04-19 06:47:52 +00:00
239 lines
5.1 KiB
YAML
239 lines
5.1 KiB
YAML
substitutions:
|
|
name: adafruit_feather_esp32s3
|
|
friendly_name: Adafruit Feather ESP32-S3
|
|
area: ""
|
|
|
|
esphome:
|
|
name: ${name}
|
|
friendly_name: ${friendly_name}
|
|
area: ${area}
|
|
name_add_mac_suffix: true
|
|
project:
|
|
name: adafruit.feather-esp32s3
|
|
version: 1.0.0
|
|
on_boot:
|
|
then:
|
|
- switch.turn_on: i2c_power
|
|
|
|
external_components:
|
|
- source:
|
|
# type: local
|
|
# path: ~/dev/esphome/esphome/components
|
|
type: git
|
|
url: https://github.com/ryansch/esphome
|
|
ref: add-max17048
|
|
components: [max17048]
|
|
|
|
esp32:
|
|
board: adafruit_feather_esp32s3
|
|
framework:
|
|
type: arduino
|
|
version: recommended
|
|
|
|
logger:
|
|
|
|
mdns:
|
|
disabled: false
|
|
|
|
api:
|
|
|
|
ota:
|
|
- platform: esphome
|
|
id: adafruit_feather_esp32s3_ota
|
|
|
|
wifi:
|
|
on_connect:
|
|
then:
|
|
- light.turn_on: red_led
|
|
|
|
on_disconnect:
|
|
then:
|
|
- light.turn_off: red_led
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap: {}
|
|
|
|
captive_portal:
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
dashboard_import:
|
|
package_import_url: github://ryansch/esphome-config/adafruit_feather_esp32s3.yaml
|
|
|
|
psram:
|
|
|
|
# spi:
|
|
# clk_pin: GPIO36
|
|
# mosi_pin: GPIO35
|
|
# miso_pin: GPIO37
|
|
|
|
# uart:
|
|
# rx_pin: GPIO38
|
|
# tx_pin: GPIO39
|
|
# baud_rate: ?
|
|
|
|
i2c:
|
|
scl: GPIO4
|
|
sda: GPIO3
|
|
|
|
binary_sensor:
|
|
- platform: status
|
|
name: "Status"
|
|
|
|
- platform: gpio
|
|
name: "Boot Button"
|
|
pin:
|
|
number: 0
|
|
ignore_strapping_warning: true
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
inverted: true
|
|
disabled_by_default: true
|
|
on_multi_click:
|
|
- timing:
|
|
- ON for at most 1s
|
|
- OFF for at most 1s
|
|
- ON for at most 1s
|
|
- OFF for at least 0.2s
|
|
then:
|
|
- logger.log: "Boot Button Double Clicked"
|
|
- button.press: restart_button
|
|
- timing:
|
|
- ON for at least 4s
|
|
- OFF for at least 0.5s
|
|
then:
|
|
- logger.log: "Boot Button Single Long Clicked"
|
|
- button.press: safe_mode_button
|
|
- timing:
|
|
- ON for at most 1s
|
|
- OFF for at least 0.5s
|
|
then:
|
|
- logger.log: "Boot Button Single Short Clicked"
|
|
- light.turn_on:
|
|
id: rgb_led
|
|
brightness: 100%
|
|
red: 100%
|
|
green: 100%
|
|
blue: 100%
|
|
flash_length: 3s
|
|
|
|
button:
|
|
- platform: restart
|
|
name: "Restart"
|
|
id: restart_button
|
|
entity_category: config
|
|
|
|
- platform: safe_mode
|
|
name: "Safe Mode"
|
|
id: safe_mode_button
|
|
entity_category: config
|
|
|
|
sensor:
|
|
- platform: uptime
|
|
name: "Uptime Sensor"
|
|
id: uptime_sensor
|
|
entity_category: diagnostic
|
|
internal: true
|
|
|
|
- platform: wifi_signal
|
|
name: "WiFi Signal"
|
|
id: wifi_signal_db
|
|
update_interval: 60s
|
|
entity_category: diagnostic
|
|
|
|
# Reports the WiFi signal strength in %
|
|
- platform: copy
|
|
source_id: wifi_signal_db
|
|
name: "WiFi Strength"
|
|
filters:
|
|
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
|
|
unit_of_measurement: "%"
|
|
entity_category: diagnostic
|
|
|
|
- platform: max17048
|
|
id: battery_status
|
|
update_interval: 30s
|
|
battery_voltage:
|
|
name: Battery Voltage
|
|
battery_level:
|
|
name: Battery Level
|
|
battery_charge_rate:
|
|
name: Battery Charge Rate
|
|
|
|
text_sensor:
|
|
- platform: wifi_info
|
|
ip_address:
|
|
name: "IP Address"
|
|
entity_category: diagnostic
|
|
ssid:
|
|
name: "Connected SSID"
|
|
entity_category: diagnostic
|
|
mac_address:
|
|
name: "Mac Address"
|
|
entity_category: diagnostic
|
|
|
|
# Creates a sensor showing when the device was last restarted
|
|
- platform: template
|
|
name: "Last Restart"
|
|
id: device_last_restart
|
|
icon: mdi:clock
|
|
entity_category: diagnostic
|
|
|
|
# Creates a sensor of the uptime of the device, in formatted days, hours, minutes and seconds
|
|
- platform: template
|
|
name: "Uptime"
|
|
entity_category: diagnostic
|
|
lambda: |-
|
|
int seconds = (id(uptime_sensor).state);
|
|
int days = seconds / (24 * 3600);
|
|
seconds = seconds % (24 * 3600);
|
|
int hours = seconds / 3600;
|
|
seconds = seconds % 3600;
|
|
int minutes = seconds / 60;
|
|
seconds = seconds % 60;
|
|
if ( days > 3650 ) {
|
|
return { "Starting up" };
|
|
} else if ( days ) {
|
|
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
|
|
} else if ( hours ) {
|
|
return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
|
|
} else if ( minutes ) {
|
|
return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
|
|
} else {
|
|
return { (String(seconds) +"s").c_str() };
|
|
}
|
|
icon: mdi:clock-start
|
|
|
|
light:
|
|
- platform: status_led
|
|
name: "Status LED"
|
|
id: red_led
|
|
disabled_by_default: true
|
|
pin:
|
|
number: GPIO13
|
|
|
|
- platform: neopixelbus
|
|
type: GRB
|
|
variant: 800KBPS
|
|
pin: GPIO33
|
|
num_leds: 1
|
|
name: "RGB LED"
|
|
id: rgb_led
|
|
on_turn_on:
|
|
then:
|
|
- switch.turn_on: neopixel_power
|
|
on_turn_off:
|
|
then:
|
|
- switch.turn_off: neopixel_power
|
|
|
|
switch:
|
|
- platform: gpio
|
|
pin: 7
|
|
id: i2c_power
|
|
|
|
- platform: gpio
|
|
pin: 21
|
|
id: neopixel_power
|