Registry / ai-ml / iobroker.hannah

iobroker.hannah

JSON →
library0.13.0jsnpmunverified

Bidirectional gRPC bridge between ioBroker and the Hannah voice assistant (v0.13.0, released 2025-06-05). Replaces the prior MQTT-based integration, solving retained-message and wildcard-subscription problems. Streams device states, presence, and text commands in real time; supports device discovery via ioBroker enums, extra state prefixes, notifications, and Blockly blocks. Requires ioBroker js-controller ≥ 5.0, Node.js ≥ 22, and a running Hannah Core instance on the default gRPC port 50051. Releases are irregular but frequent (7 versions in 2 months).

npm install iobroker.hannah
INSTALL
IMPORT
SIG · IOBROKER.HANNAH
I
iobroker.hannah
ai-mljavascriptv0.13.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

utils
✓ const utils = require('@iobroker/adapter-core');
✗ import utils from '@iobroker/adapter-core';
ioBroker adapters are CommonJS-only; ESM is not supported.
Adapter
✓ const { Adapter } = require('@iobroker/adapter-core');
✗ const Adapter = require('@iobroker/adapter-core');
Adapter is a named export, not the default.
createAdapter
✓ const createAdapter = require('@iobroker/adapter-core').Adapter;
✗ const adapter = createAdapter();
createAdapter is a factory; call it directly in adapter.js.

Shows minimal ioBroker adapter setup with gRPC connection and state handling.

const utils = require('@iobroker/adapter-core'); const grpc = require('@grpc/grpc-js'); const protoLoader = require('@grpc/proto-loader'); const PROTO_PATH = __dirname + '/lib/hannah.proto'; const packageDefinition = protoLoader.loadSync(PROTO_PATH, { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true, }); const hannahProto = grpc.loadPackageDefinition(packageDefinition).hannah; class HannahAdapter extends utils.Adapter { constructor(options) { super({ ...options, name: 'hannah', }); this.on('ready', this.onReady.bind(this)); this.on('stateChange', this.onStateChange.bind(this)); this.on('unload', this.onUnload.bind(this)); } async onReady() { const host = this.config.host || '127.0.0.1'; const port = this.config.port || 50051; const client = new hannahProto.AgentConnect(`${host}:${port}`, grpc.credentials.createInsecure()); const stream = client.connect(); stream.on('data', (msg) => { if (msg.command === 'setState') { this.setState(msg.id, msg.val, true); } }); stream.on('error', (err) => console.error('gRPC error:', err)); this.subscribeStates('*'); this.setState('info.connection', true, true); } onStateChange(id, state) { if (state && !state.ack) { // forward to Hannah } } onUnload(callback) { callback(); } } if (require.main !== module) { module.exports = (options) => new HannahAdapter(options); } else { new HannahAdapter(); }
Debug
Known issues
breakingNode.js >= 22 required; the adapter uses modern JS features and @grpc/grpc-js versions that drop older Node.js support.
fix
Upgrade Node.js to version 22 or later.
affects: >=0.1.0
breakingAdapter no longer uses MQTT; previous MQTT-based integration is incompatible. Users must migrate to gRPC.
fix
Install and configure a Hannah Core instance with gRPC enabled (port 50051).
affects: >=0.1.0
gotchaExtra state prefixes must be exact ioBroker state ID prefixes; trailing wildcards (*) are automatically appended by the adapter, do not include them in the config.
fix
Remove any trailing asterisks from extra state prefixes in adapter configuration.
affects: >=0.1.0
gotchaThe adapter sets info.connection to true on gRPC stream open, not after the initial snapshot is sent. Hannah may receive state data slightly after connection is reported.
fix
If you use info.connection as a trigger, add a small delay or wait for a confirm message from Hannah.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module '@grpc/grpc-js'
Missing native gRPC dependency; npm install did not install all packages.
fix
Run 'npm install @grpc/grpc-js' in the adapter directory or reinstall the adapter from ioBroker admin.
Error: 14 UNAVAILABLE: failed to connect to all addresses
Hannah Core is not running or gRPC port is blocked/firewalled.
fix
Ensure Hannah Core is running and accessible on the configured host:port. Check firewall rules and verify the port (default 50051).
Upgrade
Version history
0.13.0latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredgRPC client for bidirectional stream to Hannah Core
@iobroker/adapter-corerequiredioBroker adapter framework
Agent activity
14 hits · last 30 days
node
12
Amazon
1
Resources
iobroker.hannah — npm install iobroker.hannah · libregistry