Skip to main content

Python client library and CLI for the IMI Heatmiser NeoHub API

Project description

heatmiser-neohub

CI Docs 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/docs.yml on pushes to main.

Installation

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:

# 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}'

Each command also accepts --host, --token, and --port flags, 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.1.tar.gz (10.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.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: heatmiser_neohub-0.1.1.tar.gz
  • Upload date:
  • Size: 10.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.1.tar.gz
Algorithm Hash digest
SHA256 ae2e405160ed6fcafe70e6b5d8f3d2c26556489b869453e28d17537d7f6306a7
MD5 10648f55cd42e7066f36e44e1136e64a
BLAKE2b-256 2c941319d5f1b43c7d1a617765c9a7c34c39a373f53bb5b07d262bb0ef15e8d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for heatmiser_neohub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d180e7a9538ef14b12f7e18b7a3f98dcb23932c22cde6b8c12e795d48e63cf02
MD5 e159733d6e45933dbe7c1d77dfe87353
BLAKE2b-256 fecf0eccbae6b2eb88547c746caf5cfebf5e91606e657d0a78359e482f0f2e52

See more details on using hashes here.

Provenance

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