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

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.2.tar.gz (10.3 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.2-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: heatmiser_neohub-0.1.2.tar.gz
  • Upload date:
  • Size: 10.3 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.2.tar.gz
Algorithm Hash digest
SHA256 b36fc40ae6f404459267d0b77f0a7a5adfb12a13f47a6f2dbf1f29cf95cfee15
MD5 3c03a989d0e466558f73ccffd9a686b6
BLAKE2b-256 4af790e22ac65e51ea694aa82991fa65612dbde7a6ce60fa628ac4aca752b10d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for heatmiser_neohub-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 89b6dbb0cb12c97c54c2baa518f1a637a8ae8ad21b7c17480dae90da7229ee93
MD5 e15f9a9ee3c70516a3879bd8db14d375
BLAKE2b-256 51b1d633a224385e7b2c9f83e1485acb53e6c4ad1ad09cf60487ff23621e608c

See more details on using hashes here.

Provenance

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