Skip to main content

teltasync

teltasync is an async python library for interfacing with Teltonika routers via their HTTP API.

Installation

You can install the library using pip:

pip install teltasync

Usage

This is a simple example of how to use the library:

import asyncio

from teltasync import Teltasync


async def main():
    # Create client
    client = Teltasync(
        base_url="https://192.168.1.1/api",  # Full API URL
        username="admin",  # Admin username
        password="YOUR_PASSWORD",  # Admin password
        verify_ssl=False  # Most Teltonika devices use self-signed certs
    )

    try:
        # Get basic device info (no authentication required)
        device_info = await client.get_device_info()
        print(f"Device: {device_info.device_name} ({device_info.device_model})")

        # Validate credentials
        if await client.validate_credentials():
            print("Credentials are valid!")

            # Get detailed system information
            system_info = await client.get_system_info()
            print(f"Firmware version: {system_info.static.fw_version}")

            # Get modem status
            modems = await client.get_modem_status()
            for modem in modems:
                print(f"Modem {modem.id}: {modem.operator} ({modem.conntype})")
                print(f"  Signal: {modem.rssi} dBm")

        else:
            print("Invalid credentials!")

    finally:
        # Always close the session
        await client.close()


# Using as async context manager (recommended)
async def context_manager_example():
    async with Teltasync(
            base_url="https://192.168.1.1/api",
            username="admin",
            password="YOUR_PASSWORD",
            verify_ssl=False
    ) as client:
        device_info = await client.get_device_info()
        print(f"Device: {device_info.device_name}")
        # Session automatically closed when exiting context


# Run the example
if __name__ == "__main__":
    asyncio.run(main())

Supported Devices

Although it was currently only tested against a RUTX50, this library should work with most Teltonika routers that support the HTTP API, including:

  • RUT series (RUT240, etc.)
  • RUTX series (RUTX09, RUTX11, RUTX12, etc.)
  • TRB series gateways
  • Other Teltonika devices with HTTP API support

There are fixtures for a few other devices (RUT240, RUT241, RUT950, RUTX12, TRB140, TRB500), but no real-world testing against them was done yet.

Compatibility notes

Some Teltonika devices and firmware versions omit fields that are present on others. For example, older unauthenticated status responses may not include device_model or device_identifier, and some system/device/status responses may omit board.modems. These values are parsed as None, so downstream code should handle them as optional.

Requirements

  • Python 3.13+
  • aiohttp
  • pydantic

Metadata

Release files for teltasync 0.4.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 teltasync 0.4.1
File Size Uploaded
teltasync-0.4.1.tar.gz 19.2 kB Details

Built distribution (wheel)

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

Total release size: 42.6 kB

Release files / teltasync-0.4.1.tar.gz

Download URL teltasync-0.4.1.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7b1c8e0808e3c938879abcd1289f81834e41760d649ea516f329580e4a55d119
BLAKE2b-256 checksum
How to use checksums
137ec085bb0091aecb76bf7c0a366bf94de50bd4a78a9bb6378532ceaeaca93e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / teltasync-0.4.1-py3-none-any.whl

Download URL teltasync-0.4.1-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0b48a5e8448f0f9bfd4becf125b558dd1d1abd62e9568543ae8746ba453a6a3
BLAKE2b-256 checksum
How to use checksums
7077671257a8433aff3ccf45574e3357916070eb99f5399322a72cd9430cadd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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