Skip to main content

Python UM-Meter interface

Project description

CircleCI

Python UM-Meter interface

Support RDTech UM24C, UM25C, UM34C.

Library usage

Open an UM-Meter interface and request data:

from pyummeter import UMmeter

with UMmeter("/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
from pyummeter.export_csv import ExportCSV

csv = ExportCSV("/path/to/csv")
with UMmeter("/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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyummeter-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

pyummeter-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file pyummeter-0.1.0.tar.gz.

File metadata

  • Download URL: pyummeter-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.15 Linux/5.15.0-1021-aws

File hashes

Hashes for pyummeter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83cf37387f2cd6784f1f3bd58202cccaaf28325518ec273244a4e3f53adcb9cd
MD5 0dc8ce521d105b598d7679669a602834
BLAKE2b-256 bc27bbb1ce8d97f9a68ff15d59e111c0ff03fa4e9e02d1102e716100d118a383

See more details on using hashes here.

File details

Details for the file pyummeter-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyummeter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.15 Linux/5.15.0-1021-aws

File hashes

Hashes for pyummeter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae1a8c89bb47a4eeca349b546c348e4c3231a316a872811c2eabcc5f88c6eddf
MD5 bc79ba0881d845214c90152157343cf9
BLAKE2b-256 4b91107c8385d5e1ba8e3f5840a24dedc4d0defce20de1dd68179d82db4d57cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page