Skip to main content

TA-CMI

A Python wrapper to read out sensors from Technische Alternative using the C.M.I.

How to use package

Json API

import asyncio

from ta_cmi import CMI, Languages, ApiError, RateLimitError, InvalidCredentialsError, InvalidDeviceError, ChannelType


async def main():
    try:
        cmi = CMI("http://192.168.1.101", "admin", "admin")

        devices = await cmi.get_devices()

        device = devices[0]

        # Set type automatically
        await device.fetch_type()

        # Set type manually
        device.set_device_type("UVR16x2")

        await device.update()

        print(str(device))

        inputChannels = device.get_channels(ChannelType.INPUT)
        outputChannels = device.get_channels(ChannelType.OUTPUT)
        analogLogging = device.get_channels(ChannelType.ANALOG_LOGGING)

        for i in inputChannels:
            ch = inputChannels.get(i)
            print(str(ch))

        for o in outputChannels:
            ch = outputChannels.get(o)
            print(f"{str(ch)} - {ch.get_unit(Languages.DE)}")

        for al in analogLogging:
            ch = analogLogging.get(al)
            print(f"{str(ch)} - {ch.get_unit(Languages.DE)}")

    except (ApiError, RateLimitError, InvalidCredentialsError, InvalidDeviceError) as error:
        print(f"Error: {error}")


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Supported data types

Device type Inputs Outputs DL-inputs System-values: General System-values: Date System-values: Time System-values: Sun System-values: Electrical power Analog network inputs Digital network inputs M-Bus Modbus KNX Analog logging Digital logging
UVR1611 ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ✔ ✔ ❌ ❌ ❌ ❌ ❌
UVR16x2 ✔ ✔ ✔ ✔ ✔ ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ✔ ✔
RSM610 ✔ ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ✔ ❌ ❌ ❌ ❌
CAN-I/O45 ✔ ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌
CAN-EZ2 ✔ ✔ ❌ ❌ ❌ ❌ ❌ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ❌
CAN-MTx2 ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌
CAN-BC2 ❌ ❌ ✔ ✔ ✔ ✔ ✔ ❌ ❌ ❌ ✔ ✔ ✔ ✔ ✔
UVR65 ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌
CAN-EZ3 ❌ ❌ ✔ ✔ ✔ ✔ ✔ ✔ ❌ ❌ ❌ ✔ ❌ ✔ ✔
UVR610 ✔ ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ✔ ✔ ❌ ✔ ✔
UVR67 ✔ ✔ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ✔ ✔ ❌ ❌

Note The supported data types may differ from the official API. If a device type supports other data types than listed here, please create an issue.

CoE Server

Data can be retrieved using this CoE to HTTP server

import asyncio

from ta_cmi import (
    ApiError,
    ChannelMode,
    CoE,
    InvalidCredentialsError,
    InvalidDeviceError,
    Languages,
    RateLimitError,
)


async def main():
    try:
        coe = CoE("http://192.168.2.201:9000")

        can_id = 42

        await coe.update(can_id)

        analog_channels = coe.get_channels(can_id, ChannelMode.ANALOG)
        digital_channels = coe.get_channels(can_id, ChannelMode.DIGITAL)

        for i in analog_channels:
            ch = analog_channels.get(i)
            print(str(ch))

        for o in digital_channels:
            ch = digital_channels.get(o)
            print(f"{str(ch)} - {ch.get_unit(Languages.DE)}")

    except (ApiError, RateLimitError, InvalidCredentialsError, InvalidDeviceError) as error:
        print(f"Error: {error}")


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Metadata

Release files for ta-cmi 3.7.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 ta-cmi 3.7.1
File Size Uploaded Provenance
ta_cmi-3.7.1.tar.gz 18.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ta-cmi 3.7.1
File Interpreter ABI Platform
ta_cmi-3.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / ta_cmi-3.7.1.tar.gz

Download URL ta_cmi-3.7.1.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a5d5d6272fc0dc6cf100a151abd32a9ef3cb942180a91461fdcbb2a1d7a391e4
BLAKE2b-256 checksum
How to use checksums
eb32debad4a3c6b5c3d168ef34ac6fff29c8bc956b68a8dc24798e8ad9c16ac7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.22

Release files / ta_cmi-3.7.1-py3-none-any.whl

Download URL ta_cmi-3.7.1-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26824108a8107cd78862f018b6f619fbe03374d2a9b14f8b745efd9c805dc5a1
BLAKE2b-256 checksum
How to use checksums
0506dac3526eb7cd657f7f0c65faabbf3fdef4be2fd8eee54a3439aaf04c96e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.22

Security for ta-cmi 3.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

3.7.1 This release

2 release files No provenance

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