M5Stack ATOM Matrix work with esphome



  • I tried to use ATOM Matrix in Ephome,here is a template that i hoping to be helpful to you.

    我尝试在esphome中使用它,可以驱动大部分组件,并接入homeassistant。希望对你有所帮助。

    分别使用了角速度仪、线速度仪(mpu6886),灯板,按钮。均可以在homeassistant中进行操作。

    esphome:
      name: gradienter
      friendly_name: gradienter
    
    esp32:
      board: esp32dev
      framework:
        type: arduino
    
    # Enable logging
    logger:
    
    # Enable Home Assistant API
    api:
      encryption:
        key: ""
                
    ota:
      password: "homeassistant"
    
    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
    
      # Enable fallback hotspot (captive portal) in case wifi connection fails
      ap:
        ssid: "Gradienter"
        password: "homeassistant"
    
    captive_portal:
        
    i2c:
      sda: 25
      scl: 21
      scan: true
      id: bus_a
    
    sensor:
      - platform: mpu6886
        i2c_id: bus_a
        id: gradienter_info
        address: 0x68
        update_interval: 1s
        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"
        
    binary_sensor:
      - platform: gpio
        pin: 39
        name: user_button
    
    
    
    light:
      - platform: esp32_rmt_led_strip
        rgb_order: GRB
        pin: 27
        num_leds: 25
        rmt_channel: 0
        chipset: ws2812
        name: "My Light"
        effects:
          # Customize parameters
          - random:
              name: "My Slow Random Effect"
              transition_length: 30s
              update_interval: 30s
          - random:
              name: "My Fast Random Effect"
              transition_length: 4s
              update_interval: 5s
          - pulse:
              name: "Fast Pulse"
              transition_length: 0.5s
              update_interval: 0.5s
              min_brightness: 0%
              max_brightness: 100%
          - pulse:
              name: "Slow Pulse"
              # transition_length: 1s      # defaults to 1s
              update_interval: 2s
          - random:
              name: Random Effect With Custom Values
              transition_length: 5s
              update_interval: 7s
          - strobe:
              name: Strobe Effect With Custom Values
              colors:
                - state: true
                  brightness: 100%
                  red: 100%
                  green: 90%
                  blue: 0%
                  duration: 500ms
                - state: false
                  duration: 250ms
                - state: true
                  brightness: 100%
                  red: 0%
                  green: 100%
                  blue: 0%
                  duration: 500ms
          - flicker:
              name: Flicker Effect With Custom Values
              alpha: 95%
              intensity: 1.5%
          - addressable_rainbow:
              name: Rainbow Effect With Custom Values
              speed: 10
              width: 50
          - addressable_color_wipe:
              # name: Color Wipe Effect With Custom Values
              # colors:
              #   - red: 100%
              #     green: 100%
              #     blue: 100%
              #     num_leds: 1
              #   - red: 0%
              #     green: 0%
              #     blue: 0%
              #     num_leds: 1
              # add_led_interval: 100ms
              # reverse: false
          - addressable_scan:
              name: Scan Effect With Custom Values
              move_interval: 100ms
              scan_width: 1
          - addressable_twinkle:
              name: Twinkle Effect With Custom Values
              twinkle_probability: 5%
              progress_interval: 4ms
          - addressable_random_twinkle:
              name: Random Twinkle Effect With Custom Values
              twinkle_probability: 5%
              progress_interval: 32ms
          - addressable_fireworks:
              name: Fireworks Effect With Custom Values
              update_interval: 32ms
              spark_probability: 10%
              use_random_color: false
              fade_out_rate: 120
    
    
    # remote_transmitter:
    #   pin: GPIO12
    #   carrier_duty_percent: 50%  #don't work,don;t use it.
    
    

    注意:红外未能成功操作,会出现以下错误,如果知道如何处理还请指导:

    [05:53:02][C][mpu6886:103]:     Accuracy Decimals: 1
    [05:53:02][C][remote_transmitter:015]: Remote Transmitter...
    [05:53:02][C][remote_transmitter:016]:   Channel: 0
    [05:53:02][C][remote_transmitter:017]:   RMT memory blocks: 1
    [05:53:02][C][remote_transmitter:018]:   Clock divider: 80
    [05:53:02][C][remote_transmitter:019]:   Pin: GPIO12
    [05:53:02][C][remote_transmitter:022]:     Carrier Duty: 50%
    [05:53:02][E][remote_transmitter:026]: Configuring RMT driver failed: ESP_ERR_INVALID_STATE
    [05:53:02][C][captive_portal:088]: Captive Portal: