Skip to main content

Python client library and CLI for the IMI Heatmiser NeoHub API

Project description

heatmiser-neohub

CI Pages PyPI License Docker

Python client library and command-line interface for the IMI Heatmiser NeoHub API (WebSocket/WSS control interface on port 4243, plus UDP hubseek discovery on port 19790).

Stability (1.0)

The public API is the symbols exported from heatmiser_neohub (client, models, discovery helpers, errors) and the CLI commands discover, live-data, system, and cmd. This release does not promise typed wrappers for every NeoHub command, WebSocket auto-reconnect, or raising on hub application-error payloads (those remain returned response data).

BuyMeACoffee

See docs/reference/neohub-api-rev-3.02.md for the full protocol reference this library implements.

Related links

Documentation

Published docs (GitHub Pages): https://hypercat-net.github.io/heatmiser-neohub/

Source markdown lives under docs/guide/ (product docs) and docs/reference/neohub-api-rev-3.02.md (protocol).

Build the site locally:

pip install "markdown>=3.10" "PyYAML>=6.0.3"
python scripts/build_docs_site.py -o site
open site/index.html

GitHub Pages is published by .github/workflows/pages.yaml on pushes to main.

Installation

Install from PyPI:

pip install heatmiser-neohub

For local development, install in editable mode with the dev extras:

pip install -e ".[dev]"

Docker

A slim multi-arch image (linux/amd64, linux/arm64) is published to Docker Hub as hypercat42/heatmiser-neohub. The image is built from this repository’s source (not installed from PyPI) so each tag matches the git commit that produced it.

# Discovery uses UDP broadcast. Containers are isolated from the LAN by default,
# so on Linux use host networking for `discover` (and for auto-discover when
# NEOHUB_HOST is unset).
docker run --rm --network host hypercat42/heatmiser-neohub discover

docker run --rm -e NEOHUB_HOST -e NEOHUB_TOKEN hypercat42/heatmiser-neohub live-data
# or: docker run --rm --env-file .env hypercat42/heatmiser-neohub live-data

Configuration

Copy .env.example to .env and set your hub details:

cp .env.example .env

The neohub CLI loads .env automatically (real environment variables still win). You can also pass flags or export variables yourself.

Variable Flag Description Default
NEOHUB_HOST --host Hostname or IP of the hub. If unset, auto-discovers when exactly one hub is on the LAN. (auto)
NEOHUB_TOKEN --token API token configured on the hub (required for hub commands)
NEOHUB_PORT --port WSS port. If unset, defaults to 4243. 4243
# With .env in the working directory
neohub live-data

# Or export / Docker --env-file
export NEOHUB_HOST=192.168.0.19
export NEOHUB_TOKEN=your-api-token
docker run --rm --env-file .env hypercat42/heatmiser-neohub live-data

CLI usage

The package installs a neohub console script:

# Discover NeoHubs on the local network
neohub discover

# Fetch live zone/device data
neohub live-data

# Fetch hub system settings
neohub system

# Send an arbitrary JSON command
neohub cmd '{"GET_SYSTEM":0}'

# Version / logging
neohub --version
neohub -v live-data
neohub --debug cmd '{"FIRMWARE":0}'

Global options: --version/-V, --verbose/-v, --debug (also NEOHUB_VERBOSE / NEOHUB_DEBUG). Each command also accepts --host, --token, and --port, which override the corresponding environment variables.

Library example

import asyncio

from heatmiser_neohub import NeoHubClient


async def main() -> None:
    async with NeoHubClient(host="192.168.0.19", token="your-api-token") as client:
        live_data = await client.get_live_data()
        for device in live_data.devices:
            print(device.zone_name, device.actual_temp, device.set_temp)


asyncio.run(main())

Discovery

NeoHubs can be located on the local network without knowing their IP address:

from heatmiser_neohub.discover import discover_hubs

for hub in discover_hubs():
    print(hub.ip, hub.device_id)

Development

pip install -e ".[dev]"
pytest   # includes coverage; fail_under is configured in pyproject.toml

See CONTRIBUTING.md. This project is released under the MIT License.

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

heatmiser_neohub-1.0.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heatmiser_neohub-1.0.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file heatmiser_neohub-1.0.0.tar.gz.

File metadata

  • Download URL: heatmiser_neohub-1.0.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for heatmiser_neohub-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3b65a52350d91612264dfc474535f0acaf70e48a4ef53b856f373e266a8040bc
MD5 42b124d4301222d1bfc55594f5b47ec7
BLAKE2b-256 97da10088770ec0fadd3ce049a41b0fd2ad57212aa4d170a1bb2c3b62e31706b

See more details on using hashes here.

Provenance

The following attestation bundles were made for heatmiser_neohub-1.0.0.tar.gz:

Publisher: pypi.yaml on hypercat-net/heatmiser-neohub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file heatmiser_neohub-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for heatmiser_neohub-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dea314ecac7d294dc4973299a50ec00907c99a3bab1f039d7827b79dab2d7fff
MD5 9fcc9eaebdbaafdc49e15dfe655b3ac2
BLAKE2b-256 8f04a4bb21c4d18c89130c29a59ef714c050343143a10ac80639bf604afafd1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for heatmiser_neohub-1.0.0-py3-none-any.whl:

Publisher: pypi.yaml on hypercat-net/heatmiser-neohub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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