Hello, I have several M5 products, M5StickC, M5StickCPlus. M5Though, M5Core2 that need the APX192 in the custom_components to work and since the latest upgrades I have been getting these errors, however the library is still located in the custom_components…
INFO Reading configuration /config/esphome/m5stick1.yaml…
ERROR Unable to load component axp192.sensor:
Traceback (most recent call last):
File “/esphome/esphome/loader.py”, line 162, in _lookup_module
module = importlib.import_module(f"esphome.components.{domain}")
File “/usr/lib/python3.9/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1030, in _gcd_import
File “”, line 1007, in _find_and_load
File “”, line 986, in _find_and_load_unlocked
File “”, line 680, in _load_unlocked
File “”, line 790, in exec_module
File “”, line 228, in _call_with_frames_removed
File “/config/esphome/custom_components/axp192/sensor.py”, line 16, in
sensor.sensor_schema(UNIT_PERCENT, ICON_BATTERY, 1).extend({
TypeError: sensor_schema() takes from 0 to 1 positional arguments but 3 were given
INFO Detected timezone ‘America/Toronto’
WARNING GPIO15 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
Failed config
I have the same bug. The latest changelog under Breaking Changes says: " * Add class as first positional arg to sensor_schema esphome#3216 by @jesserockz (breaking-change)" My configuration.yaml in part says `
external_components:
- source: github://airy10/esphome-m5stickC
components: [ axp192 ]
AXP192 power management - must be present to initialize TFT power on
platform: axp192
address: 0x34
i2c_id: bus_a
update_interval: 5min
battery_level:
name: “M5Stick Battery Level”
id: m5stick_batterylevel `
Seems to me axp192.cpp needs updating by airy10 but I am not equipped to do it.
This is frustrating, I can’t even get the logs. I spent money and time to configure these and now suddenly I can’t upgrade, get logs or make changes to them.
This is the error message I get when I try t get the log:
INFO Reading configuration /config/esphome/shed.yml...
ERROR Unable to load component axp192.sensor:
Traceback (most recent call last):
File "/esphome/esphome/loader.py", line 162, in _lookup_module
module = importlib.import_module(f"esphome.components.{domain}")
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/config/esphome/custom_components/axp192/sensor.py", line 16, in <module>
sensor.sensor_schema(UNIT_PERCENT, ICON_BATTERY, 1).extend({
TypeError: sensor_schema() takes from 0 to 1 positional arguments but 3 were given
INFO Detected timezone 'America/Toronto'
WARNING GPIO15 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING Pin 10 (9-10) might already be used by the flash interface in QUAD IO flash mode.
Failed config
sensor.axp192: [source /config/esphome/shed.yml:134]
Platform not found: 'sensor.axp192'.
platform: axp192
address: 52
i2c_id: bus_b
update_interval: 30s
battery_level:
id: shed_m5_battery_level
name: Shed m5 Bat
Well, I have been trying to figure it out by removing and re-adding and I guess I misspelled that file name when I added it again, however that is not causing the problem, all my m5 products are in limbo since the ESPHome upgrade. I’m running Home Assistant Operating System on a Pi4, I will try reverting and see, thanks for the suggestion.
Thank you again for the simple fix, reverting to the previous version worked.
I somehow forgot that you can do that, I never had to do it before in the many years I used Home Assistant.
I guess I will keep an eye on this issue…
@therafman : I think this is fixed now; was having a similar issue following ESPHome 2022.3.0; if you are using the code from here it appears the dev has updated it and it’ll compile once more.
@satmjm : Thank you! Yes it works now, however I could only use the axp192 component, the st7735 wouldn’t compile so I ended up reverting to my previous version. Now every one of my M5 products works with ESPHOME (except for the M5 Core 2 for AWS, but it is a known issue with this one…)
FYI I converted to an Atom Lite as my Bluetooth Low Energy Tracker Hub, it’s tucked away in the laundry room and it has been rock solid, awesome buy for $8.
Thanks again for the update.