Skip to main content

aiobiketrax

Python library for interacting with the PowUnity BikeTrax GPS tracker.

Linting PyPI version

Introduction

This library is mainly written to work with a custom component for Home Assistant. You can find this custom component here.

The PowUnity BikeTrax is a GPS tracker for electric bicycles. It provides real-time updates every when the bike is in motion, using a 2G modem. It works in Europe, and requires a subscription after a trial period of one year.

Features

  • Multi-device support.
  • Traccar and admin API support.
  • Live updates using websocket.

Not implemented:

  • Geofencing.
  • Global configuration, such as webhooks.

Known issues

The schemas of the models haven been reversed-engineerd by observing responses for a small number of devices. It is likely that responses of other devices do not map onto the current models. For example, some properties are not set if they have never been configured from the app.

Please open an issue, and provide some responses so that the schemas can be improved. Be sure to redact sensitive information, such as locations, unique identifiers and personal details.

Debugging

In case of issues, it is possible to enable logging in your application for the following loggers:

  • aiobiketrax.api - API logging.
  • aiobiketrax.api.responses - Additional API response logging.
  • aiobiketrax.api.client - Client interaction logging.

Usage

In code

from aiobiketrax import Account

import aiohttp

async with aiohttp.ClientSession() as session:
    account = Account(
        username="someone@example.org",
        password="secret",
        session=session)

    await account.update_devices()

    for device in account.devices:
        print(device.name)

CLI

For demonstration and testing purposes, one can use the CLI as well. If you have the package installed, use biketrax --help command to get started.

Mock server

For development, a mock server is included in contrib/mock/. Simply run server.py and adapt aiobiketrax/consts.py to use other endpoints.

API_TRACCAR_ENDPOINT = "http://localhost:5555/traccar/api"
API_ADMIN_ENDPOINT = "http://localhost:5555/admin/api"

Do note that authentication is not mocked.

Contributing

See the CONTRIBUTING.md file.

License

See the LICENSE.md file (MIT license).

Disclaimer

Use this library at your own risk. I cannot be held responsible for any damages.

This page and its content is not affiliated with PowUnity.

Metadata

Release files for aiobiketrax 1.3.1

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

Source distribution (sdist)

Source distribution for aiobiketrax 1.3.1
File Size Uploaded
aiobiketrax-1.3.1.tar.gz 18.1 kB Details

Built distribution (wheel)

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

Total release size: 37.7 kB

Release files / aiobiketrax-1.3.1.tar.gz

Download URL aiobiketrax-1.3.1.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6e1f615cc14563c4ec6ae4fc92f367556120a151bae9c835548abf6a1e57c732
BLAKE2b-256 checksum
How to use checksums
9f26e6af31cf25df7f1e19125c442933de5112abb489cd331bbffb9456298cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.6.0

Release files / aiobiketrax-1.3.1-py3-none-any.whl

Download URL aiobiketrax-1.3.1-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f988a12299c71da70f3e3e82993f9cdb2b9b47a426958a06b0c108c4caf1a64
BLAKE2b-256 checksum
How to use checksums
e9a6f95164b657abd06389efbb91a3e8e720aef5c0618bd83c5d1e74ee0efeca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

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