iobroker.miner

中文文档
1.2.0发布于 2026/11/04GPL-3.0-onlyCommonJS构建来源已验证

Interact with different crypto miner apis

原始使用文档
文档目录19 节
  1. miner adapter for ioBroker
  2. Roadmap
  3. Usage
  4. Braiins OS miner types
  5. Avalon web login without the app
  6. Object model
  7. Groups (channels)
  8. Entities (optional subtrees)
  9. Examples
  10. Enable / disable a miner
  11. Example tree
  12. Changelog
  13. 1.2.0 (2026-11-03)
  14. 1.1.0 (2026-07-12)
  15. 1.0.4 (2026-04-07)
  16. 1.0.3 (2026-04-07)
  17. 1.0.2 (2026-04-07)
  18. Credits
  19. License

Logo

ioBroker.miner

NPM version Downloads Number of Installations Current version in stable repository

NPM

Tests: Test and Release Coverage Status

miner adapter for ioBroker

Interact with different crypto miner apis

Roadmap

  • v0.1: device management, trm implementation
  • more miners support: bos+, xmrig, avalon, ...?
  • implement more features (controls + info from devices)
  • pools support
  • device discover
  • sentry
  • more: see Todo.md / issues

Usage

When adding a new device inside the instance settings (or inside the Admin DeviceManager Tab) you should get a dialog like this:

AddDevice.png

The options should be pretty self-explanatory. All of them also have tooltips with more details. If anything is still unclear feel free to ask in an issue, discussion or the forum.

Braiins OS miner types

There are two Braiins miner implementations because Braiins changed the API stack across firmware generations:

  • bos: use this for official Braiins OS firmware >= 23.03, typically Antminer S19 series and newer. This implementation uses the Braiins OS Public API (PAPI) over gRPC.
  • bosMiner: use this for legacy Braiins OS firmware < 23.03, typically pre-S19 devices such as Antminer S9 and S17 series. This keeps using the older CGMiner-compatible API.

bosMiner also supports the control.powerTarget state. Legacy Braiins OS does not expose this through the CGMiner-compatible API, so the adapter uses an SSH workaround: it logs in to the miner, updates power_target in the [autotuning] section and timestamp in the [format] section of /etc/bosminer.toml, stores a backup at /etc/bosminer.toml.iobroker-power-target.bak, stops bosminer, writes the config, and starts bosminer again. Configure valid SSH credentials for bosMiner devices; the default username is root with no password.

Warning: changing control.powerTarget on old bosMiner devices requires a full bosminer stop/start cycle. Do not change this value frequently; use it for deliberate target changes, not for rapid automation loops.

If you are unsure which one to choose, check the firmware generation/device family first:

  • S19/S21/T19 and newer Braiins OS images are listed in the current firmware download flow and should normally use bos.
  • S17 images are published as v 23.01 and S9 images as v 22.08.1 on the Braiins download page, so those legacy generations should use bosMiner.

References:

Avalon web login without the app

The web interface of Avalon Nano 3 / 3S miners has no password form: it shows a QR code that has to be scanned with the Avalon Family app. The adapter can approve that login instead:

  1. Enter the miner's web password in the device settings (web password). It is the password set for the miner in the Avalon Family app.
  2. Open the miner's IP address in the browser, so the login page with the QR code shows.
  3. Click "Approve web login" on the device in the device manager. The browser is logged in within 5 seconds.

This does the same as scanning the QR code: the adapter sends the miner the qr_auth command the app sends, signed with the web password.

Firmware checks for BOS use the last reported control-board type and installed version, including while the device is offline or disabled. A BOS device must have reported its identity at least once. Avalon update checks currently cover the exact Nano 3 model only: the app's nano3 feed has no verified Nano 3S compatibility, so Nano 3S update status remains unknown.

Object model

All objects are created under:

miner.<instance>.miner.<minerId>

<minerId> is the stable ID from the device configuration (settings.id). This allows multiple miner processes on the same host.

Groups (channels)

  • info: identity/config/firmware/connection meta
  • stats: live performance metrics (hashrate, shares, power, temps, ...)
  • control: writable controls (start/stop, reboot, ...)
  • raw: raw API payloads (expert)

Entities (optional subtrees)

Some miners expose sub-entities. If available, they are placed below the miner:

  • pools.<index>...
  • hardware.gpus.<index>...
  • hardware.hashboards.<index>...

Examples

  • miner.0.miner.<minerId>.enabled
  • miner.0.miner.<minerId>.control.running
  • miner.0.miner.<minerId>.stats.totalHashrate
  • miner.0.miner.<minerId>.hardware.gpus.0.stats.temp
  • miner.0.miner.<minerId>.raw.stats

Enable / disable a miner

Each miner device has a writable top-level enabled state:

miner.<instance>.miner.<minerId>.enabled

Set this state to false to disable the miner in the adapter at runtime. Disabled miners are unloaded and no polling/control handling is active for them. Set it back to true to initialize the miner again without restarting the adapter.

This is different from control.running: enabled controls whether the adapter manages the miner at all, while control.running asks a supported miner to start or stop mining.

Example tree

This is just an overview / idea / plan. Not all of them are implemented yet, but it should give you an idea of the intended structure and naming. The actual implementation may differ in some details, but the general structure should be similar to this.

miner.0
  miner
    <minerId>                        (device)
      enabled                        (boolean)  enable/disable adapter handling for this miner
      info                           (channel)
        minerType                    (string)   e.g. xmRig / teamRedMiner / bosMiner
        host                         (string)
        version                      (string)   (maps to feature: version)
        online                        (boolean)  derived from lastSeen
        lastSeen                     (number)   unix ms
      stats                          (channel)
        totalHashrate                (number)   H/s (maps to feature: totalHashrate)
        power                        (number)   W
        dynamicPowerTarget           (number)   W, current dynamic target reported by miner
        efficiency                   (number)   H/W
        acceptedShares               (number)
        rejectedShares               (number)
      control                        (channel)  (writable states only here, top-level)
        running                      (boolean)  start/stop (maps to feature: running)
        reboot                       (boolean)  "button"
        profile                      (string)   performance profile (e.g. low/medium/high)
        powerTarget                  (number)   W, configured target to write to miner
      pools                          (channel)
        0                            (channel)
          info
            url                      (string)
            user                     (string)
          stats
            status                   (string)
            acceptedShares           (number)
            rejectedShares           (number)
        1 ...
      hardware                       (channel)
        gpus                         (channel)
          0                          (channel)
            info
              name                   (string)
            stats
              hashrate               (number)
              temp                   (number)   °C
              fanRpm                 (number)
              power                  (number)
          1 ...
        hashboards                   (channel)  (ASICs)
          0
            stats
              hashrate               (number)
              temp                   (number)
      raw                            (channel)
        stats                        (object/string) raw miner payload (maps to feature: rawStats)

Changelog

1.2.0 (2026-11-03)

  • (claude) NEW: Check miners for available firmware/software updates once a day and show them in the device manager: new states info.latestVersion and info.updateAvailable (Braiins OS, XMRig, TeamRedMiner, IceRiver OC firmware, Avalon Nano 3), plus the auto-upgrade status for Braiins OS. Can be turned off in the instance settings; a "check for updates" action checks right away (#195)
  • (claude) FIXED: info.online now switches to false after 3 failed polls in a row and back to true on the next successful one; a poll that hangs counts as failed after its poll interval, but at least 30 seconds, and requests to Braiins OS (gRPC) and XMRig / IceRiver (HTTP) are now cancelled after that time instead of staying open (#222)
  • (claude) NEW: Avalon Nano 3 / 3S: log a browser in to the miner's web interface without the Avalon Family app. Enter the miner's web password in the device settings, open the miner's login page, and use the new "Approve web login" device action (#182)
  • (claude) NEW: Avalon: WiFi signal strength as info.rssi (dBm), also shown in the device manager. It comes with the existing poll request, so it costs no extra round-trip; miners on a wired connection or with firmware that doesn't report it simply leave it empty (#178)
  • (claude) NEW: Power target in the device manager (Braiins OS bos and bosMiner): set it right on the device card; the value is only sent with "Set" or Enter, not on every keystroke. For bos, control.powerTarget now shows the miner's configured target (also when it was changed elsewhere), and values outside the range the miner accepts are rejected before they reach it (#176)
  • (claude) ENHANCED: An unreachable miner is no longer polled at the full rate: the time between polls doubles with every failed poll, up to 5 minutes and slightly randomized, and returns to the poll interval on the next successful poll (#175)
  • (claude) FIXED: The instance stayed yellow ("Connected to device or service": no) although its miners were reachable: info.connection now lists the reachable miners (comma-separated, like the sonoff adapter does), so the instance is green while at least one enabled miner is reachable and the admin shows which ones (#231)
  • (SimonFischer04) Dependency updates

1.1.0 (2026-07-12)

  • (copilot) Adapter requires node.js >= 22 now
  • (SimonFischer04) NEW: Added a new bos miner type for newer Braiins OS firmware using the Braiins Public API
  • (SimonFischer04) ENHANCED: Extended legacy bosMiner devices with writable control.powerTarget support for deliberate power target changes
  • (SimonFischer04) NEW: Added top-level enabled state to dynamically enable or disable miner handling at runtime
  • (SimonFischer04) FIXED: Removed example configuration (option1, option2) from native section and code (fixes #126 / E5040)

1.0.4 (2026-04-07)

  • (SimonFischer04) fix repo url in package-json

1.0.3 (2026-04-07)

  • (SimonFischer04) increase admin requirement to fix DM (does not work at all with current stable 7.7.22)

1.0.2 (2026-04-07)

  • (SimonFischer04) CI/CD: Migrated deploy workflow from NPM classic tokens to Trusted Publishing (OIDC) (fixes #80)
  • (SimonFischer04) cleanup readme

Older changelogs can be found there

Credits

  • the logo was created using ChatGPT

License

Copyright (c) 2026 SimonFischer04 [email protected]

This project is licensed under the GNU General Public License v3.0 - see LICENSE for details.

版本与发布记录

iobroker.miner 共发布 6 个版本,首次发布于 2026/04/07;过去 12 个月发布了 6 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.2.0latest2026/11/041 天前
1.1.02026/07/133 个月前
1.0.42026/04/076 个月前
1.0.32026/04/076 个月前
1.0.22026/04/076 个月前
1.0.12026/04/076 个月前

关于 iobroker.miner 的常见问题

iobroker.miner 是什么?

Interact with different crypto miner apis

如何安装 iobroker.miner?

在项目目录运行 npm install iobroker.miner,或使用 pnpm add / yarn add / bun add。

iobroker.miner 支持 TypeScript 吗?

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

iobroker.miner 支持 ESM 还是 CommonJS?

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

iobroker.miner 需要什么版本的 Node.js?

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

iobroker.miner 可以商用吗?

iobroker.miner 使用 GPL-3.0-only 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

iobroker.miner 还在维护吗?

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