Skip to content

paulchilton/esphome-axp192

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 

Repository files navigation

ESPHome AXP192 Component

Built on top of martydingo's version of the axp192 power management IC library for ESPHome, I have added support for the M5Tough, which requires a different register configuration for the M5Tough ILI9342C display. Other changes include a fix to stop the log being spammed with brightness values continually, these are only logged on change. Also the M5Tough needs resetting once the axp192 registers are set for the display to properly initialise so this version sets up the axp and then resets the ESP32 automatically.

Installation

Copy the components to a custom_components directory next to your .yaml configuration file, or include directly from this repository.

Configuration

Sample configurations are found in the /sample-config folder.

This component adds a new model configuration to the AXP192 sensor which determines which registers are needed for each device. Available models are model: M5CORE2, model: M5STICKC and model: M5TOUGH.

Include axp192 component

external_components:
  - source: github://paulchilton/esphome-axp192
    components: [axp192]

M5Stick-C

sensor:
  - platform: axp192
    model: M5STICKC
    address: 0x34
    i2c_id: bus_a
    update_interval: 30s
    battery_level:
      name: "M5Stick Battery Level"
      id: "m5stick_batterylevel"

M5Stack Core2

sensor:
  - platform: axp192
    model: M5CORE2
    address: 0x34
    i2c_id: bus_a
    update_interval: 30s
    battery_level:
      name: "${upper_devicename} Battery Level"
      id: "${devicename}_batterylevel"

M5Tough

sensor:
  - platform: axp192
    model: M5Tough
    address: 0x34
    i2c_id: bus_a
    update_interval: 30s
    battery_level:
      name: "${upper_devicename} Battery Level"
      id: "${devicename}_batterylevel"

The display component required for the M5Tough is as follows:

display:
  - platform: ili9341
    # 320x240
    model: M5STACK
    cs_pin: GPIO5
    dc_pin: GPIO15
    lambda: |-
      it.print(160, 0, id(title_font), id(color_white), TextAlign::TOP_CENTER, "Hello World");

About

axp192 esphome component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.2%
  • Python 7.8%