Getting the following error…
I have to custom components loaded and also am referencing the git directly… thoughts?
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/.esphome/external_components/19e2b645/components/axp192/sensor.py", line 11, in <module>
CONFIG_SCHEMA = sensor.sensor_schema(UNIT_PERCENT, ICON_BATTERY, 1).extend({
TypeError: sensor_schema() takes from 0 to 1 positional arguments but 3 were given
esphome:
name: m5stickcplus-test
esp32:
board: m5stick-c
framework:
type: arduino
external_components:
- source:
type: git
url: https://gitlab.com/geiseri/esphome_extras.git
refresh: 0s
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "-Test"
password: ""
captive_portal:
web_server:
i2c:
## - id: bus_a
## sda: 0
## scl: 26
## scan: true
- id: bus_b
sda: 21
scl: 22
scan: true
- id: bus_c
sda: 32
scl: 33
scan: true
axp192:
id: axp
address: 0x34
i2c_id: bus_b
update_interval: 60s
binary_sensor:
- platform: axp192
axp192_id: axp
type: charging
id: axp_charger
name: "${friendly_devicename} Charger"
- platform: status
name: "Node Status"
id: system_status
- platform: gpio
pin:
number: GPIO37
inverted: true
name: ${friendly_devicename} M5 Button
on_press:
then:
- light.turn_on: led1
- display.page.show_next: tft
on_release:
then:
- light.turn_off: led1
- platform: gpio
pin:
number: GPIO39
inverted: true
name: ${friendly_devicename} Button B
on_press:
then:
- light.toggle: led1
- light.toggle: backlight
# internal LED
light:
- platform: monochromatic
output: builtin_led
name: ${friendly_devicename} Led
id: led1
# internal LED
- platform: axp192
id: backlight
axp192_id: axp
restore_mode: ALWAYS_ON
name: "${friendly_devicename} Backlight"
output:
- platform: ledc
pin: GPIO10
inverted: false
id: builtin_led
sensor:
- platform: axp192
axp192_id: axp
id: batterylevel
name: "${friendly_devicename} Battery Level"
- platform: wifi_signal
name: ${friendly_devicename} WiFi Signal
id: wifi_dbm
- platform: uptime
name: ${friendly_devicename} Uptime
spi:
clk_pin: GPIO13
mosi_pin: GPIO15
font:
- file: "arial.ttf"
id: font1
size: 14
- file: "arial.ttf"
id: font2
size: 32
- file: "arial.ttf"
id: font3
size: 14
color:
- id: my_red
red: 100%
green: 0%
blue: 0%
- id: my_yellow
red: 100%
green: 100%
blue: 0%
- id: my_green
red: 0%
green: 100%
blue: 0%
- id: my_blue
red: 0%
green: 0%
blue: 100%
- id: my_gray
red: 50%
green: 50%
blue: 50%
#Display size 135*240
display:
- platform: st7789v
id: tft
cs_pin: GPIO5
dc_pin: GPIO23
reset_pin: GPIO18
rotation: 270
pages:
- id: page1
lambda: |-
// Draw a line from [0,22] to [240,22]
it.line(0, 22, it.get_width(), 22);
//it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_blue));
//it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue)); // header bar
//it.strftime((240 / 2), (140 / 3) * 1 + 5, id(font1), id(my_gray), TextAlign::CENTER, "%Y-%m-%d", id(homeassistant_time).now());
//it.strftime((240 / 2), (140 / 3) * 2 + 5, id(font1), id(my_gray), TextAlign::CENTER, "%H:%M:%S", id(homeassistant_time).now());
it.print(5, 5, id(font1), id(my_yellow), TextAlign::TOP_LEFT, "FAN CONTROLLER");
// Comment out the above lines to see the image without text overlaid
// it.image(0, 0, id(my_image));
if (id(system_status).state) {
it.print(235, 5, id(font1), id(my_green), TextAlign::TOP_RIGHT, "Online");
}
else {
it.print(235, 5, id(font1), id(my_red), TextAlign::TOP_RIGHT, "Offline");
}
it.printf( 5, 25, id(font1), id(my_blue), TextAlign::LEFT, "Battery: %.1f%%", id(batterylevel).state);
it.printf( 5, 45, id(font1), id(my_blue), TextAlign::LEFT, "Temp: %.1f°C", id(rack_temp).state);
- id: page2
lambda: |-
// Draw a line from [0,22] to [240,22]
it.line(0, 22, it.get_width(), 22);
//it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_blue));
//it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue)); // header bar
it.strftime((240 / 2), (140 / 3) * 1 + 5, id(font1), id(my_gray), TextAlign::CENTER, "%Y-%m-%d", id(homeassistant_time).now());
it.strftime((240 / 2), (140 / 3) * 2 + 5, id(font1), id(my_gray), TextAlign::CENTER, "%H:%M:%S", id(homeassistant_time).now());
it.print(5, 5, id(font1), id(my_yellow), TextAlign::TOP_LEFT, "FAN CONTROLLER");
// Comment out the above lines to see the image without text overlaid
// it.image(0, 0, id(my_image));
if (id(system_status).state) {
it.print(235, 5, id(font1), id(my_green), TextAlign::TOP_RIGHT, "Online");
}
else {
it.print(235, 5, id(font1), id(my_red), TextAlign::TOP_RIGHT, "Offline");
}
//it.printf( 5, 25, id(font1), id(my_blue), TextAlign::LEFT, "Battery: %.1f%%", id(batterylevel).state);
//it.printf( 5, 45, id(font1), id(my_blue), TextAlign::LEFT, "Temp: %.1f°C", id(rack_temp).state);
//it.printf( 5, 65, id(font1), id(my_blue), TextAlign::LEFT, "PWM: %.0f%%", id(pwm_var)*100);
//it.printf( 5, 85, id(font1), id(my_blue), TextAlign::LEFT, "FANS: %s", id(disable_fans).state ? "ON" : "OFF");
time:
- platform: homeassistant
id: homeassistant_time
- platform: sntp
id: sntp_time