neohubapi


Nameneohubapi JSON
Version 2.8 PyPI version JSON
download
home_pagehttps://gitlab.com/neohubapi/neohubapi/
SummaryAsync library to communicate with Heatmiser NeoHub 2 API.
upload_time2025-02-25 00:58:24
maintainerNone
docs_urlNone
authorAndrius Štikonas
requires_pythonNone
licenseNone
keywords neohub heatmiser
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
    SPDX-FileCopyrightText: 2020 Andrius Štikonas <andrius@stikonas.eu>
    SPDX-License-Identifier: CC-BY-4.0
-->

# NeoHubAPI

This is a simple python wrapper around Heatmiser's Neohub API. Up-to-date
documentation for the API can be obtained from the [Heatmiser Developer
Portal](https://dev.heatmiser.com). You will need to sign up for a free account.

The primary purpose of this module is to help with [Home
Assistant](https://www.home-assistant.io) integration but it can also be used as
a standalone library for other projects.

## Connection methods

The API provides two connection methods. The so-called "legacy" method is by way of an unencrypted connection to port 4242 of the Neohub. The newer method uses an encrypted websocket on port 4243, but only works on a second generation hub (look for the sticker on the back).

To use the websocket connection, you need to obtain a token from the Heatmiser Neo app. Go to `Settings > API > +` in the app and create one.

On newer hubs, the legacy connection may be disabled by default. If you want to use it, go to `Settings > API` in the app, and enable it from there.

## Usage example

```python
import asyncio
import neohubapi.neohub as neohub


async def run():
    # Legacy connection
    hub = neohub.NeoHub()
    # Or, for a websocket connection:
    # hub = neohub.Neohub(port=4243, token='xxx-xxxxxxx')
    system = await hub.get_system()
    hub_data = await hub.get_devices_data()
    devices = hub_data['neo_devices']
    for device in devices:
        print(f"Temperature in zone {device.name}: {device.temperature}")
        await device.identify()


asyncio.run(run())
```

## neohub_cli.py

This package includes a CLI for performing common tasks.

```
$ neohub_cli.py help  # Shows all commands
$ neohub_cli.py help set_time  # Displays help for the set_time function
$ neohub_cli.py --hub_ip=myneohub set_time "2021-01-31 15:43:00"  # Specify times like this
$ neohub_cli.py --hub_ip=myneohub set_lock 1234 "Living Room"  # Name NeoStats like this.
$ neohub_cli.py --hub_ip=myneohub --hub_token=XXX get_system  # Get system variables with websocket connection
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/neohubapi/neohubapi/",
    "name": "neohubapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "neohub, heatmiser",
    "author": "Andrius \u0160tikonas",
    "author_email": "andrius@stikonas.eu",
    "download_url": "https://files.pythonhosted.org/packages/49/4f/b5ca185458a781efae4a27ad72711af931e8cf5dfacfd48a036c8e49b7cf/neohubapi-2.8.tar.gz",
    "platform": null,
    "description": "<!--\n    SPDX-FileCopyrightText: 2020 Andrius \u0160tikonas <andrius@stikonas.eu>\n    SPDX-License-Identifier: CC-BY-4.0\n-->\n\n# NeoHubAPI\n\nThis is a simple python wrapper around Heatmiser's Neohub API. Up-to-date\ndocumentation for the API can be obtained from the [Heatmiser Developer\nPortal](https://dev.heatmiser.com). You will need to sign up for a free account.\n\nThe primary purpose of this module is to help with [Home\nAssistant](https://www.home-assistant.io) integration but it can also be used as\na standalone library for other projects.\n\n## Connection methods\n\nThe API provides two connection methods. The so-called \"legacy\" method is by way of an unencrypted connection to port 4242 of the Neohub. The newer method uses an encrypted websocket on port 4243, but only works on a second generation hub (look for the sticker on the back).\n\nTo use the websocket connection, you need to obtain a token from the Heatmiser Neo app. Go to `Settings > API > +` in the app and create one.\n\nOn newer hubs, the legacy connection may be disabled by default. If you want to use it, go to `Settings > API` in the app, and enable it from there.\n\n## Usage example\n\n```python\nimport asyncio\nimport neohubapi.neohub as neohub\n\n\nasync def run():\n    # Legacy connection\n    hub = neohub.NeoHub()\n    # Or, for a websocket connection:\n    # hub = neohub.Neohub(port=4243, token='xxx-xxxxxxx')\n    system = await hub.get_system()\n    hub_data = await hub.get_devices_data()\n    devices = hub_data['neo_devices']\n    for device in devices:\n        print(f\"Temperature in zone {device.name}: {device.temperature}\")\n        await device.identify()\n\n\nasyncio.run(run())\n```\n\n## neohub_cli.py\n\nThis package includes a CLI for performing common tasks.\n\n```\n$ neohub_cli.py help  # Shows all commands\n$ neohub_cli.py help set_time  # Displays help for the set_time function\n$ neohub_cli.py --hub_ip=myneohub set_time \"2021-01-31 15:43:00\"  # Specify times like this\n$ neohub_cli.py --hub_ip=myneohub set_lock 1234 \"Living Room\"  # Name NeoStats like this.\n$ neohub_cli.py --hub_ip=myneohub --hub_token=XXX get_system  # Get system variables with websocket connection\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Async library to communicate with Heatmiser NeoHub 2 API.",
    "version": "2.8",
    "project_urls": {
        "Homepage": "https://gitlab.com/neohubapi/neohubapi/"
    },
    "split_keywords": [
        "neohub",
        " heatmiser"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "184e2e2ad39773bbe199b28df176f3c800db39e0cfe2b74c44b03299197a2b21",
                "md5": "45589f824cb9a6399a16c0c50c4dcfc1",
                "sha256": "3dc494cd8d412e8dc56643e1576c783608062587ad9f72158570622d52dfa214"
            },
            "downloads": -1,
            "filename": "neohubapi-2.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45589f824cb9a6399a16c0c50c4dcfc1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 19297,
            "upload_time": "2025-02-25T00:58:22",
            "upload_time_iso_8601": "2025-02-25T00:58:22.921005Z",
            "url": "https://files.pythonhosted.org/packages/18/4e/2e2ad39773bbe199b28df176f3c800db39e0cfe2b74c44b03299197a2b21/neohubapi-2.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "494fb5ca185458a781efae4a27ad72711af931e8cf5dfacfd48a036c8e49b7cf",
                "md5": "713c41c3129abdea9cc2ce1835a41907",
                "sha256": "f48243d925c8314aa9adb0c5d0dce95120daf75edf578119279b832eb14f4c57"
            },
            "downloads": -1,
            "filename": "neohubapi-2.8.tar.gz",
            "has_sig": false,
            "md5_digest": "713c41c3129abdea9cc2ce1835a41907",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 32257,
            "upload_time": "2025-02-25T00:58:24",
            "upload_time_iso_8601": "2025-02-25T00:58:24.120796Z",
            "url": "https://files.pythonhosted.org/packages/49/4f/b5ca185458a781efae4a27ad72711af931e8cf5dfacfd48a036c8e49b7cf/neohubapi-2.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-25 00:58:24",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "neohubapi",
    "gitlab_project": "neohubapi",
    "lcname": "neohubapi"
}
        
Elapsed time: 1.29982s