homebridge-brother-printer

中文文档
0.2.2发布于 2026/11/04MITCommonJS

Brother laser and inkjet printers in HomeKit: printing state, problem alerts and toner or ink levels, read locally over SNMP.

原始使用文档
文档目录10 节
  1. Requirements
  2. Installation
  3. Configuration
  4. What the Home app shows
  5. Levels and low alerts
  6. Going offline
  7. Checking what your printer reports
  8. Troubleshooting
  9. How it works
  10. License

homebridge-brother-printer

npm license

Shows a Brother laser or inkjet printer in HomeKit: whether it's printing, whether it needs attention, and how much toner or ink is left. Everything is read locally over SNMP, with no cloud or Brother account.

Generic AirPrint/IPP plugins can't show real toner levels on many Brother printers, because the standard Printer MIB only reports "some remaining". Brother's own SNMP records carry the actual percentages shown on the printer's web page, and this plugin reads those.

Each printer gets these sensors:

  • Printer (occupancy sensor): Detected while a job prints. Use it in automations.
  • Printer Problem (contact sensor): Open on a jam, open cover, empty tray or other error. Turn on notifications for it in the Home app.
  • Toner / Ink (battery level on the Printer accessory): the toner or ink %, with Home's native low-battery alert at or below your threshold. On color printers it shows the lowest color, so the alert fires when any color runs low.
  • Toner / ink tiles (optional humidity sensors): the level as a number on its own tile, one per color on color printers.

While the printer can't be reached, all of them show No Response.

Requirements

  • A Brother printer with SNMP. Tested on a real MFC-L2750DW, and against SNMP captures from these models (from the brother library, which Home Assistant's Brother integration uses):

    KindModelsWhat's read
    Mono laserMFC-L2750DW, HL-L2340DW, DCP-L2540DN, DCP-7070DW, DCP-1618WToner, drum
    Color laserDCP-L3550CDW, DCP-9020CDWToner per color, drums, belt, fuser, paper feed kit
    InkjetMFC-J680DW, MFC-J5110DW, DCP-J132W, DCP-T735DW, MFC-5490CNInk per color, ink waste box
    Older / ink tankHL-2270DW, HL-5350DN, MFC-T910DWStatus, problems, page count; these don't report levels

    Other Brother models generally use the same records. Reports, with the probe output below, are welcome.

  • SNMP turned on in the printer's web page: Network → Protocol → SNMP (v1/v2c, read-only is enough). The default community is public.

  • A fixed address for the printer: reserve its IP in your router, or use its mDNS hostname (for example brn3c2af4919dfc.local).

  • Homebridge 1.6 or later (including 2.x), Node.js 18, 20, 22 or 24.

Installation

Search for Brother Printer in the Homebridge UI's Plugins tab, or run:

npm install -g homebridge-brother-printer

Running it as a child bridge is recommended.

Configuration

Set it up in the plugin's settings screen, or in config.json:

{
  "platform": "BrotherPrinter",
  "printers": [
    {
      "name": "Printer",
      "host": "10.0.4.150"
    }
  ]
}
OptionDefaultDescription
namePrinterAccessory name. Must be unique per printer.
hostPrinter IP address or hostname. Printers without one are ignored.
communitypublicSNMP community string.
port161SNMP port.
snmpVersionautoauto tries v2c, then v1. Set 1 for older printers that only answer v1.
pollInterval60Seconds between polls (10–3600).
lowTonerThreshold10Toner or ink % at or below which Home shows it as low (any color, on color printers).
faultSensortrueAdd the Printer Problem contact sensor.
tonerTilefalseAdd humidity sensors showing the toner or ink %, one per color on color printers. They also count in Home's climate summary.
showDrumfalseAdd drum life as a second battery. See below.
lowDrumThreshold10Drum and parts % (belt, fuser, laser unit, paper feed kit, ink waste box) at or below which a warning is logged, and the drum battery shows low.
offlineAfter3Failed polls in a row before the printer shows No Response.
debugfalseLog every poll at info level.

What the Home app shows

HomeKit has no printer accessory type, so the plugin uses the closest sensors and Home words them its own way:

  • The printing sensor reads Detected / Not Detected.
  • Low toner or ink is announced as "battery is low". For a clearer message, add a Home automation on that trigger that sends your own notification.
  • Home shows only one battery per accessory. With showDrum on, it may show the drum instead of the toner, which is why the drum is off by default. It's still read, and the plugin logs a warning when it nears end of life. Apps like Eve show both.
  • The page count is a custom characteristic, visible in Eve, Controller and the Homebridge UI, not in Apple Home.

Levels and low alerts

Brother printers report two readings per supply: a coarse one (the number on the printer's web page and display) and a finer one. The battery and tiles show the coarse one, so they match the printer. A supply counts as low when either reading is at or below lowTonerThreshold, or when the printer itself flags low toner, so a cartridge that shows 10% but is really at 2% still raises the alert.

Printers without level reporting (some older models and ink tank printers) get no battery; status, problems and the page count still work.

Going offline

The time before a printer shows No Response is about offlineAfter × (pollInterval + 10 s), where 10 s is the SNMP timeout. With the defaults that's about 3.5 minutes; pollInterval: 30 with offlineAfter: 1 brings it to about 40 s. With offlineAfter: 1, a single lost packet can make it flash No Response for one poll.

Brother lasers normally still answer SNMP in Sleep and Deep Sleep.

Checking what your printer reports

The package includes a command that prints what the plugin reads:

npx -p homebridge-brother-printer brother-printer-probe 10.0.4.150

Compare tonerPercent with Remaining Life on the printer's web page. If it doesn't match, or values are null, please open an issue with the probe output and your printer model.

Troubleshooting

  • "Can't reach … Request timed out": SNMP is off on the printer, the address is wrong, or a firewall blocks UDP port 161. Test from the Homebridge machine with snmpget -v2c -c public <printer-ip> 1.3.6.1.2.1.1.1.0 (from the snmp package).
  • Status text in another language: the plugin reads the printer's character set, so the log shows the display text as the printer shows it. Problems and printing are detected from language-neutral status codes, with English display text as a fallback.
  • Old printer never connects: set snmpVersion to 1.
  • Toner shows 0% with a full cartridge: some non-genuine cartridges aren't recognised by the printer, which then reports no level.

How it works

Brother printers expose maintenance data as packed records in their private MIB (1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.8, .5.10 and .5.11). Each record is a one-byte code, 0x01, a length byte and a big-endian value; older models use a two-byte current/max form. The main codes:

CodeMeaning
0x81–0x84Black, cyan, magenta, yellow toner or ink, % (coarse)
0x6f–0x72, 0xa1–0xa4The same, finer reading
0x41, 0x80, 0x79–0x7bDrum life (mono; black, cyan, magenta, yellow)
0x69–0x6d, 0x85Belt, fuser, laser unit, paper feed kits, ink waste box
next care 0x82, 0xa4–0xa7Drum pages remaining
counter 0x00Total pages printed

Printing and problem state come from the standard Host Resources MIB (hrPrinterStatus, hrPrinterDetectedErrorState), with the display text as a fallback.

The record codes follow the brother Python library by Maciej Bieniek (Apache-2.0), and the tests use SNMP captures from its test suite.

License

MIT

版本与发布记录

homebridge-brother-printer 共发布 5 个版本,首次发布于 2026/11/03;过去 12 个月发布了 5 个版本。

版本发布日期距今
0.2.2latest2026/11/04今天
0.2.12026/11/04今天
0.2.02026/11/04今天
0.1.42026/11/03今天
0.0.0-stage2026/11/03今天

关于 homebridge-brother-printer 的常见问题

homebridge-brother-printer 是什么?

HomeKit中的兄弟激光和喷墨打印机:打印状态,问题警报和碳粉或墨水水平,通过SNMP本地读取。

如何安装 homebridge-brother-printer?

在项目目录运行 npm install homebridge-brother-printer,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 brother-printer-probe,可以用 npx brother-printer-probe 直接运行。

homebridge-brother-printer 支持 TypeScript 吗?

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

homebridge-brother-printer 支持 ESM 还是 CommonJS?

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

homebridge-brother-printer 需要什么版本的 Node.js?

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

homebridge-brother-printer 可以商用吗?

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

homebridge-brother-printer 还在维护吗?

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