How iobroker/iobroker.text2command works
text2command is an ioBroker adapter that turns incoming natural-language commands into configured rule actions, smart-device control, or informational answers. Its principal flow starts with text submitted through an ioBroker state or message, matches rules, dispatches a command handler, and returns a response. The repository also includes an admin interface for configuring rules and settings. Relationships are limited to calls and references shown in excerpts or explicitly documented in the README; unsampled command-handler details are represented as a subsystem rather than inferred pipelines.
Main entry points: main.ts Adapter entry · simpleAnswers.ts Answer generation · devicesControl.ts Device control · Layout.jsx Rule management
Components 19
Adapter runtime
- Adapter entry
src/main.ts - Rule types
src/lib/types.ts
Command domain
- Rule matching
src/lib/langModel.ts - Command handlers
src/main.ts - Device control
src/lib/devicesControl.ts - Simple commands
src/lib/simpleControl.ts - Answer generation
src/lib/simpleAnswers.ts - Value formatting
src/lib/formatProvider.ts - Function names
src/lib/functions.ts - Room names
src/lib/rooms.ts
Admin configuration
- Admin application
src-admin/src/App.tsx - Rule management
src-admin/src/components/Layout.jsx - Rule navigation
src-admin/src/components/Drawer.jsx - Rule display
src-admin/src/components/Rule.jsx - Rule editor
src-admin/src/components/RuleEditor.jsx - Rule creation
src-admin/src/components/CreateRuleDialog.jsx - Settings dialog
src-admin/src/components/SettingsDialog.jsx
Other components
- Text client
- ioBroker
Connections 20
- Text client → Adapter entry: submits text
README.md - Adapter entry → ioBroker: reads enums
src/main.ts - Adapter entry → Rule matching: matches rules
src/main.ts - Adapter entry → Command handlers: dispatches commands
src/main.ts - Command handlers → Device control: controls devices
src/main.ts - Command handlers → Simple commands: runs commands
src/main.ts - Adapter entry → Answer generation: reports errors
src/main.ts - Device control → Room names: uses room terms
src/lib/devicesControl.ts - Device control → Function names: uses function terms
src/lib/devicesControl.ts - Device control → Answer generation: generates replies
src/lib/devicesControl.ts - Simple commands → Answer generation: generates replies
src/lib/simpleControl.ts - Simple commands → Value formatting: formats values
src/lib/simpleControl.ts - Answer generation → Function names: uses function names
src/lib/simpleAnswers.ts - Answer generation → Room names: uses room names
src/lib/simpleAnswers.ts - Admin application → Rule management: renders layout
src-admin/src/App.tsx - Rule management → Rule navigation: renders drawer
src-admin/src/components/Layout.jsx - Rule management → Rule editor: uses editor
src-admin/src/components/Layout.jsx - Rule management → Rule creation: uses creation dialog
src-admin/src/components/Layout.jsx - Rule navigation → Rule display: renders rules
src-admin/src/components/Drawer.jsx - Rule navigation → Settings dialog: opens settings
src-admin/src/components/Drawer.jsx