108 lines
1.7 KiB
YAML
108 lines
1.7 KiB
YAML
esphome:
|
|
name: m5stack-core-s3
|
|
friendly_name: M5Stack CoreS3
|
|
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
framework:
|
|
type: arduino
|
|
|
|
external_components:
|
|
- source: github://stefanthoss/esphome-axp2101
|
|
components: [ axp2101 ]
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: "XXX"
|
|
|
|
ota:
|
|
password: "XXX"
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "XXX"
|
|
password: "XXX"
|
|
|
|
captive_portal:
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
spi:
|
|
clk_pin: GPIO36
|
|
mosi_pin: GPIO37
|
|
miso_pin: GPIO35
|
|
|
|
i2c:
|
|
- id: bus_a
|
|
sda: GPIO12
|
|
scl: GPIO11
|
|
scan: True
|
|
|
|
sensor:
|
|
- platform: axp2101
|
|
model: M5CORE2
|
|
address: 0x34
|
|
i2c_id: bus_a
|
|
update_interval: 30s
|
|
brightness: 75%
|
|
battery_voltage:
|
|
name: "Battery Voltage"
|
|
battery_level:
|
|
name: "Battery Level"
|
|
battery_charging:
|
|
name: "Battery Charging"
|
|
|
|
touchscreen:
|
|
- platform: ft63x6
|
|
i2c_id: bus_a
|
|
on_touch:
|
|
- logger.log:
|
|
format: Touch %d at (%d, %d)
|
|
args: [touch.id, touch.x, touch.y]
|
|
|
|
binary_sensor:
|
|
- platform: touchscreen
|
|
name: Left Touch Button
|
|
x_min: 0
|
|
x_max: 106
|
|
y_min: 120
|
|
y_max: 140
|
|
|
|
- platform: touchscreen
|
|
name: Middle Touch Button
|
|
x_min: 107
|
|
x_max: 213
|
|
y_min: 120
|
|
y_max: 140
|
|
|
|
- platform: touchscreen
|
|
name: Right Touch Button
|
|
x_min: 214
|
|
x_max: 320
|
|
y_min: 120
|
|
y_max: 140
|
|
|
|
font:
|
|
- file: "gfonts://Roboto"
|
|
id: roboto
|
|
size: 24
|
|
|
|
display:
|
|
- platform: ili9xxx
|
|
model: M5STACK
|
|
dimensions: 320x240
|
|
cs_pin: GPIO5
|
|
dc_pin: GPIO15
|
|
lambda: |-
|
|
it.print(0, 0, id(roboto), "Hello World");
|
|
|