A typed Node.js client for the Heatzy (Gizwits) API, providing access to Heatzy pilot-wire modules and connected radiators — Pilote (V1/V2/V4), Glow, Onyx, Shine and Pro.
raw triplet, V2/V4 derogations, Glow's split temperature registers (incl. Onyx and Shine), and Pro's measures, open-window detection and presence mode — behind one facade family.ValidationError instead of a deep undefined crash.supportsV2 / supportsGlow / supportsPro narrowing).sideEffects: false.read:packages scopeThis package is published to GitHub Packages, not the public npm registry.
Configure your project so npm fetches the @olivierzal scope from GitHub:
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
@olivierzal:registry=https://npm.pkg.github.com
NODE_AUTH_TOKEN must be a GitHub personal access token with the read:packages scope (export it in your shell or set it in your CI environment). Then:
npm install @olivierzal/heatzy-api
import { FacadeManager, HeatzyAPI, supportsGlow } from '@olivierzal/heatzy-api'
const api = await HeatzyAPI.create({
username: 'user@example.com',
password: 'password',
})
const manager = new FacadeManager(api)
// Interact with a device through its facade
for (const device of api.registry.getDevices()) {
const facade = manager.get(device)
console.log(facade.name, facade.mode, facade.isOn)
if (supportsGlow(facade)) {
console.log(facade.currentTemperature, facade.comfortTemperature)
}
}
The client keeps its session alive without caller involvement:
settingManager (a simple get/set string store) to persist the token and credentials across restarts; without one, everything stays in memory and a new instance signs in from scratch.
The SettingManager receives the user token and the account password as plain strings. You are responsible for backing it with secure storage (encrypted settings store, OS keychain, …) — do not write it to a world-readable file. The SDK redacts credentials and tokens from its own log output.
const settings = new Map<string, string>()
const api = await HeatzyAPI.create({
settingManager: {
get: (key) => settings.get(key) ?? null,
set: (key, value) => settings.set(key, value),
},
})
The request pipeline applies two policies, outermost first:
POST) are never retried automatically: a write that may have landed server-side must not be silently duplicated. Each retry is observable through the onRequestRetry lifecycle event.Full API reference at https://olivierzal.github.io/heatzy-api/.
See CONTRIBUTING.md.
For vulnerability reports, see SECURITY.md.
See CHANGELOG.md.
This API is not endorsed, verified or approved by Heatzy or Gizwits. Heatzy cannot be held liable for any claims or damages that may occur when using this client to control Heatzy devices.
MIT © Olivier Zalmanski