neohubapi


Nameneohubapi JSON
Version 3.1 PyPI version JSON
download
home_pagehttps://gitlab.com/neohubapi/neohubapi/
SummaryAsync library to communicate with Heatmiser NeoHub 2 API.
upload_time2025-07-25 20:29:39
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/8b/16/af8642c21fe276938b4fa7f7264f358ae12b41c9a1f7a3a49dd51b431e37/neohubapi-3.1.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": "3.1",
    "project_urls": {
        "Homepage": "https://gitlab.com/neohubapi/neohubapi/"
    },
    "split_keywords": [
        "neohub",
        " heatmiser"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "de7e751670828af8dea6c750e5bba8861c6611faba794552a58efbb01f177c7d",
                "md5": "1a80269d850a9fe1173d33e7b68512e8",
                "sha256": "61ec8791c0490495e4c784b578b90f47a319f99717d749883a6f676853c8a5f7"
            },
            "downloads": -1,
            "filename": "neohubapi-3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1a80269d850a9fe1173d33e7b68512e8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21832,
            "upload_time": "2025-07-25T20:29:38",
            "upload_time_iso_8601": "2025-07-25T20:29:38.363593Z",
            "url": "https://files.pythonhosted.org/packages/de/7e/751670828af8dea6c750e5bba8861c6611faba794552a58efbb01f177c7d/neohubapi-3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8b16af8642c21fe276938b4fa7f7264f358ae12b41c9a1f7a3a49dd51b431e37",
                "md5": "baf0c9f68b14c14c111baa9a875e66b6",
                "sha256": "e547166b108b7219993f56b1becdc74bd049c16a07ed5f58eaa799f4ea42e87c"
            },
            "downloads": -1,
            "filename": "neohubapi-3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "baf0c9f68b14c14c111baa9a875e66b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 34547,
            "upload_time": "2025-07-25T20:29:39",
            "upload_time_iso_8601": "2025-07-25T20:29:39.510289Z",
            "url": "https://files.pythonhosted.org/packages/8b/16/af8642c21fe276938b4fa7f7264f358ae12b41c9a1f7a3a49dd51b431e37/neohubapi-3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 20:29:39",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "neohubapi",
    "gitlab_project": "neohubapi",
    "lcname": "neohubapi"
}
        
Elapsed time: 0.63256s