pyhubitat
A python library for interacting with the Hubitat API
Highlights
This package is new and rapidly developing. It currently exposes only the Hubitat "Maker API" which is limited to the functionality of the devices, not the hub. The official Maker API docs can be found here. Endpoints exposed include:
- Get All Devices (/devices)
- Get All Devices with Full Details (/devices/all)
- Get Device Info (/devices/[device ID])
- Get Device Event History (/device/[device ID]/events)
- Get Device Commands (/device/[device ID]/commands)
- Get Device Capabilities (/device/[device ID]/capabilities)
- Send Device Command (/device/[device ID]/[Command]/[Secondary Value])
Installation
pip install pyhubitat
Usage
Initialization
from pyhubitat import MakerAPI
import pprint
HUB_TOKEN = os.environ['HUBITAT_TOKEN']
HUB_URL_EXAMPLE = 'https://192.168.1.39/apps/api/24' # Follow the generic format of 'https://[hub-ip-address-or-hostname]/apps/api/[app-id]'
ph = MakerAPI(HUB_TOKEN, HUB_URL_EXAMPLE)
Get Devices
devices = ph.list_devices()
pprint.pprint(devices)
Send Command
response1 = ph.send_command(5, "on")
response2 = ph.send_command(6, "setLevel", 50)
Note about TLS/SSL
The Hubitat hub uses a self-signed root certificate for https and I see no reasonable way to add your own. Despite this, it is still recommended that you enable login auth on the hub and use the https API url since your API token is sent with every request.
Metadata
Release files for pyhubitat 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyhubitat-0.0.3.tar.gz | 15.2 kB | Without provenance | Details for pyhubitat-0.0.3.tar.gz |
Release files / pyhubitat-0.0.3.tar.gz
| Download URL | pyhubitat-0.0.3.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff401aaf6bc5a215d43f1cbd6138c79ff6e217f865e710d32524c4230aebe849
|
|
BLAKE2b-256 checksum How to use checksums |
174ce9ef613aa465050ec856d2dbc2a5f9c48428c356ec463ce0991b4dce7ba0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
|
Security for pyhubitat 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.