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).

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 (none)
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

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-0.1.3.tar.gz (11.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-0.1.3-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: heatmiser_neohub-0.1.3.tar.gz
  • Upload date:
  • Size: 11.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-0.1.3.tar.gz
Algorithm Hash digest
SHA256 61454d5644b159dc656a7047c4033c53b88203ad418930403147bfdf1206da03
MD5 b0d9d4f5f9c2cf529b66a53b1417033a
BLAKE2b-256 e2a4f390ba77df3376a86762679cac3338fa2c9c4ae66d4c884d7ece66daac9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for heatmiser_neohub-0.1.3.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-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for heatmiser_neohub-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 221316ed986a66da5d6b42b2c84dc7c8012b0d8e521fbddb9d8677109e2f9e9c
MD5 8492f1e8468d3d6c67fc122a7813fa79
BLAKE2b-256 661c991f61b0d380daa7002a20ecfa916e1eda6c3a4e8952673c5a26a1f110c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for heatmiser_neohub-0.1.3-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