{"id":50421373,"url":"https://github.com/nbuchwitz/usb-meter","last_synced_at":"2026-05-31T08:30:20.326Z","repository":{"id":361141456,"uuid":"1253256346","full_name":"nbuchwitz/usb-meter","owner":"nbuchwitz","description":"Python library for USB-C power meters. Initial support: ChargerLAB POWER-Z KM003C over its HID transport.","archived":false,"fork":false,"pushed_at":"2026-05-29T09:47:30.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T11:21:46.466Z","etag":null,"topics":["km003c","meter","power","powerz","usb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbuchwitz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-29T09:35:38.000Z","updated_at":"2026-05-29T09:47:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nbuchwitz/usb-meter","commit_stats":null,"previous_names":["nbuchwitz/usb-meter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nbuchwitz/usb-meter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbuchwitz%2Fusb-meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbuchwitz%2Fusb-meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbuchwitz%2Fusb-meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbuchwitz%2Fusb-meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbuchwitz","download_url":"https://codeload.github.com/nbuchwitz/usb-meter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbuchwitz%2Fusb-meter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33725060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["km003c","meter","power","powerz","usb"],"created_at":"2026-05-31T08:30:18.473Z","updated_at":"2026-05-31T08:30:20.312Z","avatar_url":"https://github.com/nbuchwitz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2026 Nicolai Buchwitz \u003cn.buchwitz@kunbus.com\u003e\nSPDX-License-Identifier: LGPL-2.1-or-later\n--\u003e\n\n# usb-meter\n\n[![License: LGPL v2.1+](https://img.shields.io/badge/License-LGPL_v2.1+-blue.svg)](https://www.gnu.org/licenses/lgpl-2.1)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n\nPython library for USB-C power meters. Initial support: ChargerLAB\nPOWER-Z **KM003C** over its HID transport.\n\nThe library talks directly to `/dev/hidraw*`, so it does not fight with\nthe upstream Linux `powerz` kernel driver (which binds to the device's\nvendor-bulk interface and exposes a small subset of values via hwmon).\nIt also has no third-party dependencies.\n\n## Features\n\n- Find a connected meter by USB vendor/product id.\n- Read ADC samples (VBUS, IBUS, VCC1/2, VDP/M, VDD, temperature).\n- Compact wire-protocol primitives (message + extension header, opcode\n  and attribute enums) shared with the KM002C.\n- `usb-meter` CLI for one-shot and streaming reads.\n\n## Installation\n\nDirectly from GitHub:\n\n```bash\npip install git+https://github.com/nbuchwitz/usb-meter.git\n```\n\nOr from a local checkout:\n\n```bash\npip install .\n```\n\nInstall the udev rule so non-root users in the `plugdev` group can\naccess the device:\n\n```bash\nsudo install -m 644 etc/udev/rules.d/60-chargerlab-km003c.rules /etc/udev/rules.d/\nsudo udevadm control --reload \u0026\u0026 sudo udevadm trigger\n```\n\n## Usage\n\n```python\nfrom usb_meter import KM003C\n\nwith KM003C.open() as meter:\n    sample = meter.read_adc()\n    print(f\"{sample.vbus_v:.3f} V, {sample.ibus_a:.3f} A, {sample.temperature_c:.1f} C\")\n```\n\nOr from the shell:\n\n```bash\nusb-meter -n 10 -i 0.2     # 10 samples, 200 ms apart\nusb-meter -n 0             # stream forever\n```\n\n## Status\n\nAlpha. Only ADC reading is implemented today. The vendor protocol\ndocuments more attributes (`PD_PACKET`, `ADC_QUEUE_10K`, `SETTINGS`,\netc.) that map to the same request/response shape and will land here\nincrementally.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbuchwitz%2Fusb-meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbuchwitz%2Fusb-meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbuchwitz%2Fusb-meter/lists"}