@apocaliss92/noderademacher

中文文档
0.1.0发布于 2026/07/04MITTypeScriptESM + CJS近 30 天下载 2027

Node.js/TypeScript client for Rademacher HomePilot / Start2Smart hubs over the local network (REST + SSDP discovery)

原始使用文档
文档目录11 节
  1. Install
  2. Quick start
  3. Discovery
  4. Devices — the gateway included, with all info
  5. Supported devices
  6. How it works
  7. Two gotchas worth knowing (handled for you)
  8. Diagnostics dumper
  9. Error types
  10. Credits & scope
  11. License

noderademacher

Node.js / TypeScript client for Rademacher HomePilot / Start2Smart hubs over the local network (no cloud).

Spiritual successor to pyrademacher — same local REST API, TypeScript-native. If you can control a device in the HomePilot app, you can control it with this library. Covers/blinds, switches/plugs, dimmable actuators, Zigbee lights, thermostats/radiator valves, sensors and wall controllers.

Node only, local only. Talks HTTP to the hub on your LAN. No Rademacher cloud account is used or required.


Install

npm i @apocaliss92/noderademacher

Requires Node 20 or later.


Quick start

import { Rademacher, CoverDevice } from '@apocaliss92/noderademacher';

// Point at your hub (host or IP). Add `password` if the hub is protected.
const hub = new Rademacher({ host: '192.168.1.50' });

// 1. Connect (auto-resolves the api-version base path, logs in if protected)
await hub.connect();

// 2. List devices registered to the hub
const devices = await hub.listDevices();

// 3. Create a typed handle (fetches its initial state)
const cover = (await hub.createDevice(devices[0])) as CoverDevice;

// 4. React to polled state changes
cover.on('stateChanged', ({ changed }) => console.log('changed:', changed));

// 5. Control it
await cover.open();
await cover.setPosition(60); // 0 = closed, 100 = open

// 6. Re-poll whenever you like (HomePilot has no realtime push)
await cover.refresh();

Discovery

HomePilot has no broadcast/mDNS discovery (Rademacher's own integration finds it via DHCP MAC-OUI). So noderademacher discovers hubs by HTTP-probing the LAN — it confirms each host via the hub's identity endpoint:

import { Rademacher } from '@apocaliss92/noderademacher';

// Sweep every local /24 (bounded concurrency), or pass { subnet: '192.168.1' } / { hosts: [...] }
const hubs = await Rademacher.discover();
// → [{ host, model: 'HomePilot' | 'Start2Smart', name, firmware?, uid?, basePath, passwordProtected }]

for (const found of hubs) {
  const hub = new Rademacher({ host: found.host, basePath: found.basePath });
  await hub.connect();
}

Rademacher.discover({ subnet, hosts, concurrency, timeoutMs }) — narrow the sweep for speed. The Rademacher MAC OUIs (B0:1F:81, 38:FD:FE) are exported as RADEMACHER_MAC_PREFIXES if you want to pre-filter an ARP scan.


Devices — the gateway included, with all info

listDevices() / getDevices() return the hub/gateway itself as a separate device (a HubDevice, did = -1, category hub) first, then every physical device. Pass { includeHub: false } to omit it.

const devices = await hub.getDevices(); // typed handles, gateway first, each already polled
for (const dev of devices) {
  console.log(dev.name, dev.category, dev.describe());
}

describe() returns everything retrievable about a device: identity, battery, every capability (with value + min/max/step) and the latest statuses / readings. The HubDevice exposes firmware, hardware/software platform, DuoFern-stick version, node name, MAC, LED status and the firmware-update status.

Supported devices

ClassDEVICE_TYPE_LOCHighlights
CoverDevice2, 8open / close / stop, setPosition, setTilt, ventilation
SwitchDevice1turnOn / turnOff / setOn, isOn
ActuatorDevice4dimmable: setBrightness, brightness, isOn
LightDevice70–76actuator + setRgb, setColorTemperature
ThermostatDevice5setTargetTemperature, currentTemperature, boost
SensorDevice3temperature, wind, brightness, rain, contact, motion, smoke
WallControllerDevice10channel key-press timestamps
UnknownDevice—raw state + passthrough commands

Feature detection is by capability-name presence (device.hasCapability(...)), exactly like the reference library — never by product code.


How it works

  1. Connect — probes http://<host>/… to resolve the api-version base path ('' v1 / /hp v2) and detect password protection; logs in via a two-stage salted SHA-256 challenge when a password is set (cookie session).
  2. Devices — listDevices() reads /devices (full capability lists → feature detection + category).
  3. State — createDevice() / refresh() read /v4/devices/{did} (statusesMap + readings).
  4. Commands — every control is PUT /devices/{did} with { name, value? }.

HomePilot's local API has no realtime push, so state is refreshed by polling (device.refresh()).

Two gotchas worth knowing (handled for you)

  • Cover position is inverted on the wire (HomePilot 0 = open). This library exposes the HA-style position (100 = open) and inverts on both read and write.
  • Thermostat temperatures are deci-°C in state (/10) but plain °C in the write command — the model converts both ways.

Diagnostics dumper

import { createDumper } from '@apocaliss92/noderademacher';
const snap = createDumper(cover).dump();
// { did, category: 'cover', model, name: 'Ki*****', capabilities: [...], state: { statuses, readings } }

redact: true (default) masks the friendly name so dumps can be shared safely.


Error types

ClassThrown when
RademacherErrorBase class
RademacherAuthErrorLogin / re-auth failure
RademacherApiErrorNon-2xx HTTP or a non-zero hub error_code (.status)
RademacherTransportErrorNetwork error reaching the hub

Credits & scope

Reverse-engineered from pyrademacher (the library behind the peribeir Home Assistant Rademacher integration). See docs/rademacher-homepilot-api-spec.md for the full protocol notes this port is built from. Not affiliated with or endorsed by Rademacher.

License

MIT — see LICENSE.

版本与发布记录

@apocaliss92/noderademacher 共发布 1 个版本,首次发布于 2026/07/04;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.1.0latest2026/07/044 个月前

关于 @apocaliss92/noderademacher 的常见问题

@apocaliss92/noderademacher 是什么?

Node.js/TypeScript client for Rademacher HomePilot / Start2Smart hubs over the local network (REST + SSDP discovery)

如何安装 @apocaliss92/noderademacher?

在项目目录运行 npm install @apocaliss92/noderademacher,或使用 pnpm add / yarn add / bun add。

@apocaliss92/noderademacher 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@apocaliss92/noderademacher 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@apocaliss92/noderademacher 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@apocaliss92/noderademacher 可以商用吗?

@apocaliss92/noderademacher 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@apocaliss92/noderademacher 的下载量有多少?

根据 npm 官方下载统计,@apocaliss92/noderademacher 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,027 次,日均约 68 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apocaliss92/noderademacher 还在维护吗?

最新版本 0.1.0 发布于 2026/07/04(4 个月前);至今共发布 1 个版本,其中过去 12 个月发布了 1 个;首次发布于 2026/07/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。