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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file neohubapi-2.2.tar.gz
.
File metadata
- Download URL: neohubapi-2.2.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ca6eb4dd2227b7c4b7d66c026a65bf96de511a41799601e092ffbbb4833137 |
|
MD5 | 37d2e0384d2d60df5da09749c08217c7 |
|
BLAKE2b-256 | d8bae081fab828b9d4aa3686d8e1551450ef4e488f502f8e6f0e92f010f6a5a5 |
File details
Details for the file neohubapi-2.2-py3-none-any.whl
.
File metadata
- Download URL: neohubapi-2.2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db82fe9414dcd46bc5696494103541d50f6191f296aea60ed6a0c5cb702e965 |
|
MD5 | 5e640b2a7e83ea1b2192c003aebdc6a5 |
|
BLAKE2b-256 | 63991f87474505c795dd512372e1e66e6bf7f76ac66865216bb2fac17f840049 |