Skip to main content

Async library to communicate with Heatmiser NeoHub 2 API.

Project description

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. You will need to sign up for a free account.

The primary purpose of this module is to help with Home Assistant 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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neohubapi-3.0.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

neohubapi-3.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file neohubapi-3.0.tar.gz.

File metadata

  • Download URL: neohubapi-3.0.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for neohubapi-3.0.tar.gz
Algorithm Hash digest
SHA256 03548553babb7e9508c997acd7f6f5c197cdcaae65c8c687ded611807ed57681
MD5 b07c72bfb0320596374b82a0f2002015
BLAKE2b-256 1f8ff746dbf5e8b975a0556aa4b6d649bb397a2a86b9413c7dafba45750df825

See more details on using hashes here.

File details

Details for the file neohubapi-3.0-py3-none-any.whl.

File metadata

  • Download URL: neohubapi-3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for neohubapi-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46461f1aee1661fe4b3ef6d51b27471ee0f45f26b79109e2c1a318271b34c2b1
MD5 532e83707b158040bd263e3bdfcdbee1
BLAKE2b-256 fdc38d24ed0897ae07551a1025d4fb029125ccb9f9e05ac9f7e575206d37213f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page