M5Stack-Fire with ESP Home

Hi all,

I’m trying to use a M5Stack-Fire with ESP Home. I’ve made this yaml:

esphome:
  name: m5-stack-fire
  friendly_name: M5-Stack-Fire

esp32:
  board: m5stack-core-esp32
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "XXXX"

ota:
  password: "XXXXX"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.1.106
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "M5-Stack-Fire Fallback Hotspot"
    password: "XXXX"

captive_portal:

web_server:
  port: 80

i2s_audio:
  - i2s_lrclk_pin: GPIO21
    i2s_bclk_pin: GPIO22

i2c:
  sda: 21
  scl: 22
  scan: true
  id: bus_a

spi:
  clk_pin: GPIO18
  mosi_pin: GPIO23
  miso_pin: GPIO23

output:
  - platform: ledc
    pin: 32
    id: gpio_32_backlight_pwm

binary_sensor:
  - platform: gpio
    name: "M5_BtnA"
    pin:
      number: 39
      inverted: true
  - platform: gpio
    name: M5_BtnB
    pin:
      number: 38
      inverted: true
  - platform: gpio
    name: M5_BtnC
    pin:
      number: 37
      inverted: true

light:
  - platform: neopixelbus
    type: GRB
    variant: 800KBPS
    pin: GPIO15
    num_leds: 10
    name: "NeoPixel Light"
  - platform: monochromatic
    output: gpio_32_backlight_pwm
    name: "Display Backlight"
    id: back_light
    restore_mode: ALWAYS_ON

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 60s
  - platform: mpu6886
    address: 0x68
    accel_x:
      name: "MPU6886 Accel X"
    accel_y:
      name: "MPU6886 Accel Y"
    accel_z:
      name: "MPU6886 Accel z"
    gyro_x:
      name: "MPU6886 Gyro X"
    gyro_y:
      name: "MPU6886 Gyro Y"
    gyro_z:
      name: "MPU6886 Gyro z"
    temperature:
      name: "MPU6886 Temperature"
    update_interval: 60s

media_player:
  - platform: i2s_audio
    id: media_out
    name: None
    dac_type: external
    i2s_dout_pin: GPIO25
    mode: mono

display:
  - platform: ili9xxx
    model: ili9341
    cs_pin: 14
    dc_pin: 27
    reset_pin: 33
    lambda: |-
      it.line(0, 0, 50, 50);

I have problem with screen and media player.
Backlight screen is ok, but i have a little problem with the screen:

With the media player I hear the speaker turn on but no sound.

Thanks for your help!

Display model should be m5stack.

display:
  - platform: ili9xxx
    model: m5stack
    cs_pin: 14
    dc_pin: 27
    reset_pin: 33
1 Like

Found any way to get the speaker and mic working ?

1 Like

The speaker is not an I2S speaker and I could not get it working with i2s_audio or media_player. It seems that it is only a buzzer. I only got it working with the following code:

output:
  - platform: ledc
    pin: 25
    id: core_speaker
rtttl:
  output: core_speaker
  id: rtttl_speaker

See Reddit - Dive into anything