Files
esphome-axp2101/sample-config/m5stickc.yaml
marty@dingo.sh 401605df03 initial commit
2022-09-03 17:13:33 +01:00

134 lines
2.4 KiB
YAML

esphome:
name: m5stick-c
platform: ESP32
board: m5stick-c
platformio_options:
upload_speed: 115200
# Use this to hardlink the component if it is not discovered
# includes:
# - /config/custom_components/axp192/axp192.h
wifi:
ssid: "SSID"
password: "PASSPHRASE"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "XXX"
password: "XXX"
# Enable logging
logger:
substitutions:
devicename: m5stick
upper_devicename: M5StickC
captive_portal:
api:
ota:
web_server:
binary_sensor:
- platform: gpio
pin:
number: GPIO37
inverted: true
name: ${upper_devicename} Button A
on_press:
then:
- light.turn_on: led1
on_release:
then:
- light.turn_off: led1
- platform: gpio
pin:
number: GPIO39
inverted: true
name: ${upper_devicename} Button B
on_press:
then:
- light.turn_on: led1
on_release:
then:
- light.turn_off: led1
# AXP192 power management - must be present to initialize TFT power on
sensor:
- platform: axp192
model: M5STICKC
address: 0x34
i2c_id: bus_a
update_interval: 30s
battery_level:
name: "M5Stick Battery Level"
id: "m5stick_batterylevel"
- platform: wifi_signal
name: ${upper_devicename} WiFi Signal
id: wifi_dbm
- platform: uptime
name: ${upper_devicename} Uptime
# internal LED
light:
- platform: monochromatic
output: builtin_led
name: ${upper_devicename} Led
id: led1
output:
- platform: ledc
pin: 10
inverted: true
id: builtin_led
#############################################
### Currently causes an error with compilation
##
# internal IR Transmitter
# remote_transmitter:
# - pin:
# number: GPIO9
# carrier_duty_percent: 50%
# id: internal
##
###
#############################################
spi:
clk_pin: GPIO13
mosi_pin: GPIO15
i2c:
- id: bus_a
sda: GPIO21
scl: GPIO22
scan: True
font:
- file: 'fonts/arial.ttf'
id: font1
size: 8
# builtin 80x160 TFT
display:
- platform: st7735
model: "INITR_MINI160X80"
cs_pin: GPIO5
dc_pin: GPIO23
reset_pin: GPIO18
rotation: 270
device_width: 128
device_height: 160
col_start: 0
row_start: 0
eight_bit_color: true
update_interval: 5s
lambda: |-
it.print(80, 0, id(font1), TextAlign::TOP_CENTER, "M5Stick Test");