Skip to main content

CircleCI

Python UM-Meter interface

Support RDTech UM24C, UM25C, UM34C.

Library usage

Open an UM-Meter interface and request data:

from pyummeter import UMmeter, UMmeterInterfaceTTY

with UMmeter(UMmeterInterfaceTTY("/path/to/serial/port")) as meter:
    data = meter.get_data()
    print(f"{data['voltage']} V / {data['power']} W")

It is also possible to export the data to a CSV file:

from datetime import datetime
from pyummeter import UMmeter, UMmeterInterfaceTTY
from pyummeter.export_csv import ExportCSV

csv = ExportCSV("/path/to/csv")
with UMmeter(UMmeterInterfaceTTY("/path/to/serial/port")) as meter:
    csv.update(datetime.now(), meter.get_data())

List of data available:

  • model: UM-Meter model name (exported to CSV)
  • voltage: Voltage (V) (exported to CSV)
  • intensity: Intensity (A) (exported to CSV)
  • power: Power (W) (exported to CSV)
  • resistance: Resistance (Ohm) (exported to CSV)
  • usb_voltage_dp: USB Voltage D+ (V) (exported to CSV)
  • usb_voltage_dn: USB Voltage D- (V) (exported to CSV)
  • charging_mode: Charging mode short name (exported to CSV)
  • charging_mode_full: Charging mode full name
  • temperature_celsius: Temperature (°C) (exported to CSV)
  • temperature_fahrenheit: Temperature (°F)
  • data_group_selected: Selected data group (index)
  • data_group: Data for each data group (list) (exported to CSV, only the selected group)
    • capacity: Capacity (Ah)
    • energy: Energy (Wh)
  • record_capacity_threshold: [Record mode] Capacity threshold (Ah) (exported to CSV)
  • record_energy_threshold: [Record mode] Energy threshold (Wh) (exported to CSV)
  • record_intensity_threshold: [Record mode] Intensity threshold (A) (exported to CSV)
  • record_duration: [Record mode] Duration (seconds) (exported to CSV)
  • record_enabled: [Record mode] Enable status (exported to CSV)
  • screen_index: Screen index
  • screen_timeout: Screen timeout
  • screen_brightness: Screen brightness
  • checksum: Checksum of all data

Meter control managed (not available on all model):

  • Screen control:
    • Change (next/previous)
    • Rotate
    • Set timeout (0 to 9 minutes)
    • Set brightness (0 to 5)
  • Data group control:
    • Select (0 to 9, next)
    • Clear
  • Record threshold (0 to 300 mA)

Running example

Bluetooth initialisation

$ sudo killall rfcomm
$ rfkill block bluetooth
$ rfkill unblock bluetooth
$ sudo bluetoothctl
[bluetooth] power on
[bluetooth] agent on
[bluetooth] scan on
[bluetooth] pair <MAC>
$ sudo rfcomm connect /dev/rfcomm0 <MAC>

Demo application usage

poetry install
poetry run task demo -t /dev/rfcomm0

Release files for pyummeter 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyummeter 0.2.0
File Size Uploaded
pyummeter-0.2.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyummeter 0.2.0
File Interpreter ABI Platform
pyummeter-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / pyummeter-0.2.0.tar.gz

Download URL pyummeter-0.2.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
def19bd72fb238f1ebb225caf5b7d7b254a79aa7b8bd4f0e6249a1c18eb98962
BLAKE2b-256 checksum
How to use checksums
ec47fccddc6f0e953d0e5634013be52bdd06cd6d612e7bce13f659cc89bbfc92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.8.16 Linux/5.15.0-1021-aws

Release files / pyummeter-0.2.0-py3-none-any.whl

Download URL pyummeter-0.2.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ab83c8d4ee25a0df714caa5b094ac8e601f0159fd8f69565137045b569a1688
BLAKE2b-256 checksum
How to use checksums
e89372c5e2031529b690526e1be70a111f1a7e2011bb416ba98ccb7f6e26349c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.8.16 Linux/5.15.0-1021-aws

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page