esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
422 stars 27 forks source link

support for "LiPoly battery monitor - LC709203" #2040

Open cTurtle98 opened 1 year ago

cTurtle98 commented 1 year ago

Describe the problem you have/What new integration you would like

I would like support for reading battery status with this sensor Adafruit LC709203F LiPoly / LiIon Fuel Gauge and Battery Monitor - STEMMA JST PH & QT / Qwiic

Please describe your use case for this integration and alternatives you've tried:

I have an Adafruit ESP32-S2 Feather with BME280 Sensor - STEMMA QT - 4MB Flash + 2 MB PSRAM that I am using for environmental sensing and it has that chip onboard for battery status monitoring.

Additional context

Logs esp32-s2-feather.yaml

INFO Reading configuration /config/esphome/esp32-s2-feather.yaml...
INFO Starting log output from esp32-s2-feather.local using esphome API
INFO Successfully connected to esp32-s2-feather.local
[14:13:52][I][app:102]: ESPHome version 2022.12.3 compiled on Dec 26 2022, 13:35:08
[14:13:52][C][wifi:504]: WiFi:
[14:13:52][C][wifi:362]:   Local MAC: 84:F7:03:D8:61:F0
[14:13:52][C][wifi:363]:   SSID: [redacted]
[14:13:52][C][wifi:364]:   IP Address: 192.168.33.173
[14:13:52][C][wifi:366]:   BSSID: [redacted]
[14:13:52][C][wifi:367]:   Hostname: 'esp32-s2-feather'
[14:13:52][C][wifi:369]:   Signal strength: -46 dB ▂▄▆█
[14:13:52][C][wifi:373]:   Channel: 11
[14:13:52][C][wifi:374]:   Subnet: 255.255.255.0
[14:13:52][C][wifi:375]:   Gateway: 192.168.33.1
[14:13:52][C][wifi:376]:   DNS1: 192.168.33.1
[14:13:52][C][wifi:377]:   DNS2: 0.0.0.0
[14:13:52][C][logger:293]: Logger:
[14:13:52][C][logger:294]:   Level: DEBUG
[14:13:52][C][logger:295]:   Log Baud Rate: 115200
[14:13:52][C][logger:296]:   Hardware UART: UART0
[14:13:52][C][i2c.arduino:052]: I2C Bus:
[14:13:52][C][i2c.arduino:053]:   SDA Pin: GPIO3
[14:13:52][C][i2c.arduino:054]:   SCL Pin: GPIO4
[14:13:52][C][i2c.arduino:055]:   Frequency: 50000 Hz
[14:13:52][C][i2c.arduino:058]:   Recovery: bus successfully recovered
[14:13:52][I][i2c.arduino:068]: Results from i2c bus scan:
[14:13:52][I][i2c.arduino:074]: Found i2c device at address 0x0B
[14:13:52][I][i2c.arduino:074]: Found i2c device at address 0x77

https://learn.adafruit.com/i2c-addresses/the-list says that that 0x0B is the LC709203 (0x77 is the onboard bme280, an already supported sensor)

https://www.adafruit.com/product/5303 says

Features: LiPoly battery monitor - LC709203 chip actively monitors your battery for voltage and state of charge / percentage reporting over I2C

cTurtle98 commented 1 year ago

here's the adafruit library for using the device in arduino https://github.com/adafruit/Adafruit_LC709203F

cTurtle98 commented 1 year ago

adafruit article about using the sensor in arduino https://learn.adafruit.com/adafruit-esp32-s2-feather/lc709203-simple-data

joshspicer commented 1 year ago

For folks that have a newer feather esp32-s2, this might be helpful: https://community.home-assistant.io/t/adafruit-max17048-lipo-battery-gauge-with-esphome/524005/6

def1149 commented 1 year ago

Has support for the LC709203F been incorporated? clicking through various links on this page it looks like someone developed code for it.