M5Stack Lite RGB turns off?

Hi
starting to use ESPHome and I´ve received also my first ESP32 which is M5Stack Atom Lite.

After configuration according to this example:

substitutions:
  device_name: demo2
  friendly_name: Demo 2

## Boilerplate

esphome:
  name: ${device_name}
  platform: ESP32
  board: m5stack-core-esp32

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: Fallback ${device_name}

captive_portal:

logger:

api:
  password: !secret esphome_secret

ota:
  password: !secret esphome_secret


## Device-specific

light:
  - platform: fastled_clockless
    chipset: WS2812B
    pin: 27
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: ${friendly_name} Light
    effects:
      - random:
      - flicker:
      - addressable_rainbow:

binary_sensor:
  - platform: gpio
    pin:
      number: 39
      inverted: true
    name: ${friendly_name} Button
    on_press:
      then:
        - light.toggle: status_led

The M5Stack Atom Lite is working so far but the RGB LED is shutdown after some period without changes. Is there a timer or anything programmed?

According logging screen this is not realy identifyable for me:

[19:02:49][VV][scheduler:185]: Running interval '' with interval=5000 last_execution=204256 (now=209256)
[19:02:49][VV][light.addressable:015]: Addressable Light 'RGB LED' (effect_active=NO)
[19:02:49][VV][light.addressable:019]:   [ 0] Color: R=  1 G=  0 B=  0 W=  0
[19:02:49][VV][light.addressable:021]:  

I already tested a configuration with chipset: SK6812 but without any changes.

Anyone having same behavouir or can give a hint how to solve and have continous working LED?

Big THX!

I have had this but my light would come on randomly and I used this to fix it. I put code to keep light on below but haven’t tested it.

interval:
  - interval: 60s
    then:
      if:
        condition:
          light.is_on: status_led
        then:
          - light.turn_off: 
              id: status_led
          - light.turn_on: 
              id: status_led
        else:
## Use this to turn the light OFF in about 0 - 5 min. Select only 1 else.
##          - light.turn_off: status_led
## Use this to keep the light ON. Select only 1 else.
          - wait_until:
              light.is_on: status_led

hope this helps :smiley:

Not sure if you ever worked this out however after lots of research, I found it was wifi, particularly when the M5Stack Atom Lite wifi goes to sleep, when it randomly wakes again it would send phantom button presses. Turning the light RGB light on or off or toggling anything that you had setup to work with the button press… It did my head in for ages and hours of google didn’t help much. Finally though after watching the logs and what the atom lite was doing on my network, I worked it out so I thought I’d come back here and share as this was the first post google brought me too…

To fix, add this line under your wifi settings to your esphome yaml:

power_save_mode: none

so your yaml would be something like below

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: none

and that’s it, no more phantom button presses. :slight_smile:

2 Likes

I have to add this: power_save_mode: none will not be available if you are using bluetooth_proxy or esp32_ble_tracker.

For that, add a filter to the binary_sensor like this:

binary_sensor:
  - platform: gpio
    pin:
      number: 39
      inverted: true
    filters:
      - delayed_on: 10ms
    name: ${friendly_name} Button

After some more testing and logging of the phantom keypresses on m5stack atom lite and matrix, I ended up with 100ms for the delayed_on value.

Graphing of the phantom showing phantom keypress durations this week:

70ms should actually be enough, but 100ms just gives that extra margin just in case

I’m trying to turn off the LED on my m5stack atom lite, it has BT proxy on it and it complains about the light platform:

substitutions:
  name: "master-m5atom-btproxy"
packages:
  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/m5stack-atom-lite.yaml@main
esphome:
  name: ${name}
  name_add_mac_suffix: false
  compile_process_limit: 1


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

light:
  - platform: fastled_clockless
    chipset: WS2812B
    pin: 27
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: ${friendly_name} Light
    effects:
      - random:
      - flicker:
      - addressable_rainbow:

Error is: This feature is incompatible with esp-idf. Please see note on documentation for FastLED
Any ideas?

I got this working using following config.

Please note:

  • check/fill in credentials
  • use Clean Build Files!
  • led is off by default.

You’ll also get a nice RGB-switch in your HA (for free)

######################
###  Fresh start :) ##
######################
substitutions:
  name: atom-bluetooth-proxy-<**your identifier**>
  friendly_name: Bluetooth Proxy <**your identifier**>

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  name_add_mac_suffix: false
  #project: # https://github.com/esphome/issues/issues/4528
  #  name: esphome.bluetooth-proxy
  #  version: "1.0"

esp32:
  board: m5stack-atom
  framework:
    type: esp-idf

wifi:
  ap:
  # use secrets.yaml (! in esphome dir)
  ssid: !secret iot_wifi_ssid # IoT
  password: !secret iot_wifi_password

api:
  encryption:
    key: [redacted, use-your-own-key :) ]

logger:
ota:
improv_serial:

# https://github.com/esphome/issues/issues/4528
# dashboard_import:
#  package_import_url: github://esphome/bluetooth-proxies/m5stack-atom-lite.yaml@main

esp32_ble_tracker:
  scan_parameters:
    # We currently use the defaults to ensure Bluetooth
    # can co-exist with WiFi In the future we may be able to
    # enable the built-in coexistence logic in ESP-IDF
    active: true

bluetooth_proxy:
  active: true

button:
- platform: safe_mode
  name: Safe Mode Boot
  entity_category: diagnostic

light:
  - platform: esp32_rmt_led_strip
    chipset: SK6812
    rgb_order: GRB
    pin: 27
    num_leds: 1
    rmt_channel: 0
    name: "Atom Lite LED"