homebridge-ir-patio-heater

中文文档
1.1.4发布于 2026/11/04MITCommonJS零依赖

Remote-only patio heaters, driven through a Tuya IR blaster, in HomeKit: an on/off tile, a power-level slider and an Out of Sync button.

原始使用文档
文档目录9 节
  1. Requirements
  2. Installation
  3. Configuration
  4. How the heater is driven
  5. Getting back in sync
  6. Optional smart plug (recommended for unattended use)
  7. Why requests aren't retried
  8. Response time
  9. Tuya account

homebridge-ir-patio-heater

npm license

Shows remote-only patio heaters, controlled through a Tuya IR blaster, as three HomeKit tiles per heater:

  • Heater (switch): the only tile that turns the heater on. On = Power, wait, last level. Off = Power.
  • Level (fan slider, 500 W / 1000 W / 1500 W): changes the level while heating. Off or slider to zero does the same as Heater off. It never turns the heater on: picking a level while off just remembers it for next time.
  • Out of Sync (button): flips what HomeKit shows (On ↔ Off) without sending anything.

Rename tiles with levelName / syncName, or hide Out of Sync with showSyncButton: false.

Requirements

  • Homebridge 1.6 or later (including 2.x), Node.js 18.20 or later.
  • A Tuya (Smart Life) universal IR blaster with the heater's remote learned or added in the app.
  • A Tuya IoT Platform cloud project linked to your app account, with IoT Core and IR Control Hub Open Service authorized. If you already use a Tuya Homebridge plugin, reuse its project.

Installation

Search for IR Patio Heater in the Homebridge UI's Plugins tab, or run:

npm install -g homebridge-ir-patio-heater

Configuration

Configure it in the Homebridge UI, or add a platform to config.json:

{
  "platform": "PatioHeater",
  "name": "Patio Heaters",
  "accessId": "<Access ID of your Tuya cloud project>",
  "accessKey": "<Access Secret>",
  "endpoint": "https://openapi.tuyaus.com",
  "heaters": [
    {
      "name": "Left Heater",
      "blasterId": "<IR blaster device ID>",
      "remoteId": "<IR remote device ID>",
      "powerKey": "power",
      "levelKeys": ["500W", "1000W", "1500W"]
    }
  ]
}
  • blasterId / remoteId: in the Tuya IoT Platform, Cloud → your project → Devices. The remote you added under the blaster is a device of its own. The Tuya app also shows both under Device → ✎ → Device Information → Virtual ID.
  • powerKey / levelKeys: the button names as the remote shows them in the Tuya app (matched case-insensitively). If a name doesn't match, the log lists the available ones.
  • endpoint: the data center of your app account (Americas, Europe, India or China).

Every other option has a sensible default and is explained in the settings screen and below.

How the heater is driven

These heaters have three real states: Off, Standby (power on, not heating) and Heating at a level. The remote's Power button toggles between Off and on; a level button starts or changes heating, but only when the heater has power.

HomeKit showsYou doIR presses
OffHeater onPower → wait keyDelayMs → level ×2
OnMove Level sliderlevel ×2
OnHeater off, Level off, or slider to 0Power
OffMove Level sliderlevel ×2 (remembered for next on)
OffAny off, or Level tapped onnothing

Level presses are sent twice (levelRepeat, default 2) because the heater ignores a repeated level, so a missed IR press gets a second chance. Power is a toggle and is always sent once. If a heater is slow to wake up or far from its blaster, raise its keyDelayMs (e.g. 2500).

Requests that arrive together (the Home app often sends on + level at once) are combined into one sequence. If a press fails, HomeKit is rolled back to what actually happened.

Getting back in sync

IR is one-way and Power is a toggle, so HomeKit can only be wrong by being inverted. Look at the heater, then:

Heater tile showsHeater itselfDo
OnDark, no lightTap Out of Sync → tile shows Off
OffLight onTap Out of Sync → tile shows On, then turn off normally if you want
OnLight on, not heatingMove the Level slider (the level press was missed)

Don't fix it by toggling the Heater tile: every tap sends another Power, so it stays inverted.

For the same reason, autoOffMinutes only works with a smart plug, and you should not add "turn off when everyone leaves" automations without one.

Set plugId to a Tuya smart plug (outdoor, 15 A). Then off = plug off, which is always correct because the heater doesn't remember its state after a power cut. On = plug on, wait plugPowerUpDelayMs, Power, level. The plug is polled, so turning it off anywhere marks the heater off. With a plug, auto-off and away automations are safe.

Why requests aren't retried

Reading from Tuya is retried on network errors. Pressing a key is not: a request that timed out may still have reached the blaster, and a second Power press would switch the heater back. A failed press is reported in the log and HomeKit is rolled back to what is known to have happened.

Response time

Each log line shows where the time went, e.g. On at 1500W (power 640ms, 1500W 590ms; total 2410ms after HomeKit request). The per-press times are Tuya's cloud accepting the command; the blaster then fires the IR, usually within a second. Turning on also includes keyDelayMs (default 1000) between Power and the level, which the heater needs to wake up. The plugin itself adds only debounceMs (default 150) to combine on + level requests, and renews its Tuya token in the background.

Tuya account

Uses the Access ID / Access Secret of your Tuya cloud project with a project-level token. It never signs in with your app account, so it can share a project with a Tuya Homebridge plugin without logging that plugin out. The cloud project needs the IR Control Hub Open Service API authorized (the Tuya plugin already uses it for your remotes).

版本与发布记录

homebridge-ir-patio-heater 共发布 6 个版本,首次发布于 2026/11/03;过去 12 个月发布了 6 个版本。

版本发布日期距今
1.1.4latest2026/11/04今天
1.1.32026/11/04今天
1.1.22026/11/04今天
1.1.12026/11/04今天
1.1.02026/11/03今天
0.0.0-stage2026/11/03今天

关于 homebridge-ir-patio-heater 的常见问题

homebridge-ir-patio-heater 是什么?

在HomeKit中,只有远程遥控的露台加热器,通过Tuya IR发射器驱动:一个开/关瓷砖,一个功率水平滑块和一个不同步按钮。

如何安装 homebridge-ir-patio-heater?

在项目目录运行 npm install homebridge-ir-patio-heater,或使用 pnpm add / yarn add / bun add。

homebridge-ir-patio-heater 支持 TypeScript 吗?

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

homebridge-ir-patio-heater 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

homebridge-ir-patio-heater 需要什么版本的 Node.js?

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

homebridge-ir-patio-heater 可以商用吗?

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

homebridge-ir-patio-heater 还在维护吗?

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