AXP192 power management library for ESPHome adopted for a custom ESPHome library for AI and related edge devices.
Copy the components to a custom_components directory next to your .yaml configuration file, or include directly from this repository.
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
.
external_components:
- source: github://vajpeters/esphome-axp192
components: [axp192]
sensor:
- platform: axp192
model: m5stickc
id: power_mgmt
address: 0x34
i2c_id: i2c_bus
update_interval: 60s
brightness: 100%
battery_level:
name: ${device} Battery Level
id: batterylevel
sensor:
- platform: axp192
model: m5core2
id: power_mgmt
address: 0x34
i2c_id: i2c_bus
update_interval: 60s
brightness: 100%
battery_level:
name: ${device} Battery Level
id: batterylevel
sensor:
- platform: axp192
model: m5tough
id: power_mgmt
address: 0x34
i2c_id: i2c_bus
update_interval: 60s
brightness: 100%
battery_level:
name: ${device} Battery Level
id: 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");
This library is built on prior work published by @M5Stack as well as individual contributors like @airy10, @apolselli, @abmantis, @geiseri, @martydingo, @gonzalop, @shish, @cmet7, @JensGuckenbiehl, @leoedin, @rolloo, @paulchilton, @pionizer amongst others.
The original work by @M5STack that most or all of this is based on was originally licensed under MIT License. However, the various Github projects failed to specify the proper license and given this is currently an active fork of several of these repos, the license cannot be set at the repo level. Anyone leveraging this work should consider this to be derived work from the original MIT licensed code.
- Additional contributions from @JensGuckenbiehl and @rolloo to review and merge into this code base