@camstack/addon-provider-esphome

中文文档
0.1.17发布于 2026/11/08MITESM + CJS近 30 天下载 3062

ESPHome device-provider addon for CamStack: one broker per board, spoken over the native API (Noise) with esphome-client

原始使用文档
文档目录9 节
  1. What it does
  2. Mapping
  3. Behaviour
  4. Where to find the key
  5. Known limits
  6. Requirements
  7. What it provides
  8. Requirements
  9. Documentation

@camstack/addon-provider-esphome

ESPHome device-provider addon for CamStack. It speaks the board's native API (Noise-encrypted or plain) with esphome-client and turns a board into one container device with a child per entity.

What it does

  • ESPHome (provider-esphome): one integration holding several boards (each: host, port 6053, encryption key, optional legacy password), a LAN scan that proposes boards, and adoption of a connected board.
    • Node placement: hub-only.
    • Capabilities: device-provider, device-adoption.

Mapping

A board is one container device. Its entities become children:

ESPHome entityCamStack child
switchswitch
lightswitch + brightness (colour is not mapped yet)
covercover (open, close, stop, position)
buttonbutton
number, selectcontrol
eventevent emitter (a replayed state never fires)
sensornumeric sensor, converted to the base unit of its quantity
text sensorenum sensor
binary sensorcontact (door, window, opening, garage door), flood (moisture), smoke, motion (motion, occupancy, presence), otherwise binary
power, energy, voltage, current, apparent power, power factor sensorsone power-meter child

Entities the board marks diagnostic or disabled by default, and its status binary sensor, are not adopted.

Behaviour

  • Live state arrives by subscription; there is no polling.
  • A lost connection is retried with a bounded backoff (1 s doubling to 60 s, with jitter). A key or password the board refuses is not retried: the board shows auth-failed until the operator edits it.
  • An unreachable board is offline, never zero: its children keep the last reading and the container goes offline.
  • The encryption key and the legacy password are keychain secrets. They are never returned by a read, never logged, and a save that leaves the field empty keeps the stored value.
  • The addon only reads state and sends the commands an operator triggers on an adopted device. It never guesses or tries keys.

Where to find the key

In the board's ESPHome YAML under api: encryption: key:. In the ESPHome dashboard open the device and choose Edit; in Home Assistant it is stored in the ESPHome integration entry for that device. Paste it into the board row's "Encryption key" field.

Known limits

  • Light colour and colour temperature are not mapped.
  • Entities of an ESPHome sub-device (firmware 2025.7 and later) are not separated from the board's own.
  • Firmware older than 2024.4 is untested.
  • A board allows only a few simultaneous API clients (ESP8266 especially); Home Assistant holds one of them.
  • Two controllers can write the same relay; CamStack follows the state the board reports.

Requirements

  • Peer packages already on the node: @camstack/types, zod.
  • A CamStack hub. This addon does not run on an agent.

Package @camstack/addon-provider-esphome on npm.

What it provides

  • ESPHome (provider-esphome): Connect to an ESPHome board over its native API and adopt its switches, lights, covers, buttons, sensors, numbers and selects. Category: providers.
    • Capabilities: device-provider, device-adoption.

Requirements

  • Placement: hub-only.
  • A CamStack hub. An agent is used only where the placement above allows it.

Documentation

See CHANGELOG.md for what changed in each version.

版本与发布记录

@camstack/addon-provider-esphome 共发布 18 个版本,首次发布于 2026/10/27;过去 12 个月发布了 18 个版本。

版本发布日期距今
0.1.17latest2026/11/08今天
0.1.162026/11/072 天前
0.1.152026/11/072 天前
0.1.142026/11/063 天前
0.1.132026/11/063 天前
0.1.122026/11/054 天前

关于 @camstack/addon-provider-esphome 的常见问题

@camstack/addon-provider-esphome 是什么?

ESPHome device-provider addon for CamStack: one broker per board, spoken over the native API (Noise) with esphome-client

如何安装 @camstack/addon-provider-esphome?

在项目目录运行 npm install @camstack/addon-provider-esphome,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(^4.3.6)、@camstack/types(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@camstack/addon-provider-esphome 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/camstack__addon-provider-esphome 是否存在。

@camstack/addon-provider-esphome 支持 ESM 还是 CommonJS?

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

@camstack/addon-provider-esphome 可以商用吗?

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

@camstack/addon-provider-esphome 的下载量有多少?

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

@camstack/addon-provider-esphome 还在维护吗?

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