ta-cmi


Nameta-cmi JSON
Version 3.2.0 PyPI version JSON
download
home_pagehttps://gitlab.com/DeerMaximum/ta-cmi
SummaryA Python wrapper to read out sensors from Technische Alternative using the C.M.I.
upload_time2024-01-15 17:55:28
maintainer
docs_urlNone
authorDeerMaximum
requires_python
licenseMIT License Copyright (c) 2021 DeerMaximum Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TA-CMI
A Python wrapper to read out  sensors from Technische Alternative using the C.M.I.

## How to use package

### Json API

```python
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](https://gitlab.com/DeerMaximum/ta-coe) CoE to HTTP server

```python
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()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/DeerMaximum/ta-cmi",
    "name": "ta-cmi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "DeerMaximum",
    "author_email": "2629822-DeerMaximum@users.noreply.gitlab.com",
    "download_url": "https://files.pythonhosted.org/packages/36/1f/5029533b4af2872dcce14151da93b978e7e14e9b82a0c9e612f873148166/ta-cmi-3.2.0.tar.gz",
    "platform": null,
    "description": "# TA-CMI\nA Python wrapper to read out  sensors from Technische Alternative using the C.M.I.\n\n## How to use package\n\n### Json API\n\n```python\nimport asyncio\n\nfrom ta_cmi import CMI, Languages, ApiError, RateLimitError, InvalidCredentialsError, InvalidDeviceError, ChannelType\n\n\nasync def main():\n    try:\n        cmi = CMI(\"http://192.168.1.101\", \"admin\", \"admin\")\n\n        devices = await cmi.get_devices()\n\n        device = devices[0]\n\n        # Set type automatically\n        await device.fetch_type()\n\n        # Set type manually\n        device.set_device_type(\"UVR16x2\")\n\n        await device.update()\n\n        print(str(device))\n\n        inputChannels = device.get_channels(ChannelType.INPUT)\n        outputChannels = device.get_channels(ChannelType.OUTPUT)\n        analogLogging = device.get_channels(ChannelType.ANALOG_LOGGING)\n\n        for i in inputChannels:\n            ch = inputChannels.get(i)\n            print(str(ch))\n\n        for o in outputChannels:\n            ch = outputChannels.get(o)\n            print(f\"{str(ch)} - {ch.get_unit(Languages.DE)}\")\n\n        for al in analogLogging:\n            ch = analogLogging.get(al)\n            print(f\"{str(ch)} - {ch.get_unit(Languages.DE)}\")\n\n    except (ApiError, RateLimitError, InvalidCredentialsError, InvalidDeviceError) as error:\n        print(f\"Error: {error}\")\n\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\nloop.close()\n```\n\n## Supported data types\n\n| 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 |\n|-------------|:------:|:-------:|:---------:|:----------------------:|:-------------------:|:-------------------:|:------------------:|:-------------------------------:|:---------------------:|:----------------------:|:-----:|:------:|:---:|:--------------:|:---------------:|\n| UVR1611     |   \u2714    |    \u2714    |     \u274c     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u2714           |           \u2714            |   \u274c   |   \u274c    |  \u274c  |       \u274c        |        \u274c        |\n| UVR16x2     |   \u2714    |    \u2714    |     \u2714     |           \u2714            |          \u2714          |          \u2714          |         \u2714          |                \u274c                |           \u274c           |           \u274c            |   \u274c   |   \u274c    |  \u274c  |       \u2714        |        \u2714        |\n| RSM610      |   \u2714    |    \u2714    |     \u2714     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u274c           |           \u274c            |   \u2714   |   \u274c    |  \u274c  |       \u274c        |        \u274c        |\n| CAN-I/O45   |   \u2714    |    \u2714    |     \u2714     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u274c           |           \u274c            |   \u274c   |   \u274c    |  \u274c  |       \u274c        |        \u274c        |\n| CAN-EZ2     |   \u2714    |    \u2714    |     \u274c     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u2714                |           \u274c           |           \u274c            |   \u274c   |   \u274c    |  \u274c  |       \u274c        |        \u274c        |\n| CAN-MTx2    |   \u2714    |    \u2714    |     \u274c     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u274c           |           \u274c            |   \u274c   |   \u274c    |  \u274c  |       \u274c        |        \u274c        |\n| CAN-BC2     |   \u274c    |    \u274c    |     \u274c     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u274c           |           \u274c            |   \u2714   |   \u2714    |  \u2714  |       \u274c        |        \u274c        |\n| UVR65       |   \u2714    |    \u2714    |     \u274c     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u274c           |           \u274c            |   \u274c   |   \u274c    |  \u274c  |       \u274c        |        \u274c        |\n| CAN-EZ3     |   \u274c    |    \u274c    |     \u2714     |           \u2714            |          \u2714          |          \u2714          |         \u2714          |                \u2714                |           \u274c           |           \u274c            |   \u274c   |   \u2714    |  \u274c  |       \u2714        |        \u2714        |\n| UVR610      |   \u2714    |    \u2714    |     \u2714     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u274c           |           \u274c            |   \u2714   |   \u274c    |  \u274c  |       \u2714        |        \u2714        |\n| UVR67       |   \u2714    |    \u2714    |     \u274c     |           \u274c            |          \u274c          |          \u274c          |         \u274c          |                \u274c                |           \u274c           |           \u274c            |   \u274c   |   \u274c    |  \u274c  |       \u274c        |        \u274c        |\n\n> **Note**\n> 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.\n\n### CoE Server\n\nData can be retrieved using [this](https://gitlab.com/DeerMaximum/ta-coe) CoE to HTTP server\n\n```python\nimport asyncio\n\nfrom ta_cmi import (\n    ApiError,\n    ChannelMode,\n    CoE,\n    InvalidCredentialsError,\n    InvalidDeviceError,\n    Languages,\n    RateLimitError,\n)\n\n\nasync def main():\n    try:\n        coe = CoE(\"http://192.168.2.201:9000\")\n        \n        can_id = 42\n\n        await coe.update(can_id)\n\n        analog_channels = coe.get_channels(can_id, ChannelMode.ANALOG)\n        digital_channels = coe.get_channels(can_id, ChannelMode.DIGITAL)\n\n        for i in analog_channels:\n            ch = analog_channels.get(i)\n            print(str(ch))\n\n        for o in digital_channels:\n            ch = digital_channels.get(o)\n            print(f\"{str(ch)} - {ch.get_unit(Languages.DE)}\")\n\n    except (ApiError, RateLimitError, InvalidCredentialsError, InvalidDeviceError) as error:\n        print(f\"Error: {error}\")\n\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\nloop.close()\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 DeerMaximum  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A Python wrapper to read out  sensors from Technische Alternative using the C.M.I.",
    "version": "3.2.0",
    "project_urls": {
        "Homepage": "https://gitlab.com/DeerMaximum/ta-cmi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e5dab8ef9283b50693b08240bd413c4ce3e85a57cfa6990fc2e9dca0f75ec9b9",
                "md5": "bde2ed9dc88895af49c2db1cd1767242",
                "sha256": "59d2d8ee09553f5d5ea58eb7d6f6c68881933a3e5722199f3cd915559b4e5e39"
            },
            "downloads": -1,
            "filename": "ta_cmi-3.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bde2ed9dc88895af49c2db1cd1767242",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13480,
            "upload_time": "2024-01-15T17:55:27",
            "upload_time_iso_8601": "2024-01-15T17:55:27.660148Z",
            "url": "https://files.pythonhosted.org/packages/e5/da/b8ef9283b50693b08240bd413c4ce3e85a57cfa6990fc2e9dca0f75ec9b9/ta_cmi-3.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "361f5029533b4af2872dcce14151da93b978e7e14e9b82a0c9e612f873148166",
                "md5": "61c33bb7f764d89f65e61b9823210b7c",
                "sha256": "9276fc84cbe456da2103a2f8ddd1f368ac9c3944c38500270eae8e92edf4ccd4"
            },
            "downloads": -1,
            "filename": "ta-cmi-3.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "61c33bb7f764d89f65e61b9823210b7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11345,
            "upload_time": "2024-01-15T17:55:28",
            "upload_time_iso_8601": "2024-01-15T17:55:28.872757Z",
            "url": "https://files.pythonhosted.org/packages/36/1f/5029533b4af2872dcce14151da93b978e7e14e9b82a0c9e612f873148166/ta-cmi-3.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-15 17:55:28",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "DeerMaximum",
    "gitlab_project": "ta-cmi",
    "lcname": "ta-cmi"
}
        
Elapsed time: 0.19315s