{"id":22691460,"url":"https://github.com/boverby/lc709203f","last_synced_at":"2025-04-12T23:09:59.530Z","repository":{"id":263719564,"uuid":"356096227","full_name":"boverby/lc709203f","owner":"boverby","description":"esphome support for lc709203f on ESP32_Bat_Pro","archived":false,"fork":false,"pushed_at":"2021-04-09T01:50:05.000Z","size":8,"stargazers_count":8,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-12T23:09:57.016Z","etag":null,"topics":["esp32","esphome","ezsbc","lc709203f"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boverby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-09T01:25:16.000Z","updated_at":"2024-09-07T15:03:31.000Z","dependencies_parsed_at":"2024-11-20T06:17:23.192Z","dependency_job_id":null,"html_url":"https://github.com/boverby/lc709203f","commit_stats":null,"previous_names":["boverby/lc709203f"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boverby%2Flc709203f","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boverby%2Flc709203f/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boverby%2Flc709203f/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boverby%2Flc709203f/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boverby","download_url":"https://codeload.github.com/boverby/lc709203f/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643004,"owners_count":21138355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","esphome","ezsbc","lc709203f"],"created_at":"2024-12-10T01:11:12.697Z","updated_at":"2025-04-12T23:09:59.510Z","avatar_url":"https://github.com/boverby.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## initial support for lc709203f on  ESP32_Bat_Pro \n This is an attempt to add wrappers to the code provided by EzSBC in https://github.com/EzSBC/ESP32_Bat_Pro by\nadding required functions and renaming some subroutines. These were modelled on the esphome ads1115 and ina219 components\n\n```\ncaptured with mosquitto_sub  -F \"%I %t %p\" -v -t ezmin/debug\n...\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:119]: LC709203F:\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:120]:   Address: 0x0B\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:126]:   Update Interval: 30.0s\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:128]:   Cell Voltage 'ezmin battery V'\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:128]:     Unit of Measurement: 'V'\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:128]:     Accuracy Decimals: 2\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:129]:   Cell Rem Pct 'ezmin battery lvl'\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:129]:     Unit of Measurement: '%'\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:129]:     Accuracy Decimals: 1\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:130]:   Cell StateCharge 'ezmin cell charge'\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:130]:     Unit of Measurement: '%'\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:130]:     Accuracy Decimals: 0\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:131]:   IC version 'ezmin ic'\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:131]:     Unit of Measurement: ''\n2021-04-04T11:38:24-0400 ezmin/debug [C][lc709203f.sensor:131]:     Accuracy Decimals: 0\n...\n2021-04-04T11:38:42-0400 ezmin/debug [D][lc709203f.sensor:092]: Got Battery values: cellVoltage_mV=4149 cellRemainingPercent10=964 cellStateOfCharge=96 ic=0x2717\n2021-04-04T11:38:42-0400 ezmin/debug [D][sensor:092]: 'ezmin battery V': Sending state 4.14900 V with 2 decimals of accuracy\n2021-04-04T11:38:42-0400 ezmin/debug [D][sensor:092]: 'ezmin battery lvl': Sending state 96.40000 % with 1 decimals of accuracy\n2021-04-04T11:38:42-0400 ezmin/debug [D][sensor:092]: 'ezmin ic': Sending state 10007.00000  with 0 decimals of accuracy\n2021-04-04T11:38:42-0400 ezmin/debug [D][sensor:092]: 'ezmin cell charge': Sending state 96.00000 % with 0 decimals of accuracy\n2021-04-04T11:39:23-0400 ezmin/debug [I][deep_sleep:067]: Beginning Deep Sleep\n...\n```\n\nworks to retreive these 4 values. I have hard coded my battery config in setup routine\n\n\n\n#### Required code changes:\n- revised [ESPHOME]/custom_components/lc709203f/lc709203f.h\n- revised [ESPHOME]/custom_components/lc709203f/lc709203f.cpp\n- revised [ESPHOME]/custom_components/lc709203f/sensor.py\n\n\n\n#### add stanza to yaml for RGB led\n```\nswitch:\n  - platform: gpio\n    pin:\n      number: GPIO16\n      inverted: true\n    name: \"${devicename} ledr\"\n    id:  ${devicename}_ledr\n  - platform: gpio\n    pin:\n      number: GPIO17\n      inverted: true\n    name: \"${devicename} ledb\"\n    id:  ${devicename}_ledb\n  - platform: gpio\n    pin:\n      number: GPIO18\n      inverted: true\n    name: \"${devicename} ledg\"\n    id:  ${devicename}_ledg\n```\n\n\n#### add stanza to yaml for fuel gauge \n```\n - platform: lc709203f\n    address: \"0x0B\"\n    i2c_id: bus_a\n    battery_voltage:\n      name: \"${devicename} battery V\"\n    battery_level:\n      name: \"${devicename} battery lvl\"\n    icversion:\n      name: \"${devicename} ic\"\n    cell_charge:\n      name: \"${devicename} cell charge\"\n    update_interval: 30s\n```\n\n\n\n\n\n\n#### TODO\n- accept config for setPowerMode, setCellCapacity, setCellProfile  ( to replace hard coded setup )\n- accept value for lc709203f_current_direction_t mentioned at : https://github.com/RIOT-OS/RIOT/blob/df3ab9f16135dca610d81c0286eb23791170b21d/drivers/include/lc709203f.h\n- TODO  low priority because no resource/application for me---------------------\n- capture values for getThermistorBeta, getCellTemperature \n- accept config for setThermistorB, setTemperatureMode, setAlarmRSOC, setAlarmVoltage\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboverby%2Flc709203f","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboverby%2Flc709203f","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboverby%2Flc709203f/lists"}