esphome: name: m5stack-core2 friendly_name: M5Stack Core2 esp32: board: m5stack-core2 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: GPIO18 mosi_pin: GPIO23 miso_pin: GPIO38 i2c: - id: bus_a sda: GPIO21 scl: GPIO22 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" - platform: mpu6886 address: 0x68 accel_x: name: "Accel X" accel_y: name: "Accel Y" accel_z: name: "Accel z" gyro_x: name: "Gyro X" gyro_y: name: "Gyro Y" gyro_z: name: "Gyro z" temperature: name: "Temperature" 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");