A backend module for interpreting and executing Pocketix V1 automation scripts — designed for smart devices and IoT integrations.
Pocketix Node is an interpret for the Pocketix v1 ecosystem. It allows programs written in the Pocketix V1 visual programming language to be evaluated, interpreted, and transformed into actionable commands for downstream smart devices.
The module provides interfaces and abstract classes to connect automation logic with real-world device layers, without directly triggering hardware actions — making it ideal for simulation, testing, and safe validation.
✅ Evaluates Pocketix V1 programs into commands and device state updates
✅ Does not directly interact with hardware — supports dry-run simulations
✅ Plug-in architecture via interfaces: define your own commander and reference system
✅ Easily extendable for custom gateways, validation logic, or IoT orchestration
To get started, implement your own classes for the following:
ICommander: Handles dispatching commands to smart devicesIReferenceManager: Manages reference resolution and state trackingReferencedValue: Extend this abstract class to define reference behavior
Then run the program using:
const runner = new ProgramRunner()
.setCommander(commander)
.setReferenceManager(referenceManager)
.parseProgram(program);
const {commands, toUpdate} = await runner.run();commandscontains the actions to be sent to the devicestoUpdatecontains the device states or parameters that changed as a result of the evaluation
The runner does not send commands or apply changes itself — this is left to your implementation. This allows for full control over validation, batching, and decision logic before executing device actions.
✅ Use it for:
- Safe program simulations (dry-runs)
- Validation of automations
- Command previewing or auditing
Unit tests are located in the /tests directory.
To run the test suite:
npm run test- 🔗 vpl-for-things — WIP version of new editor built in Lit compatible with Pocketix v2 language
- 🔗 pocketix-react — React-based scripting editor for the same ecosystem
- 🔗 pocketixng — Angular-based scripting editor for the same ecosystem
- 🔗 Pocketix Node Core — A simple environment for basic IoT management
We welcome contributions! To get involved:
- Fork the repo and create a new branch for your feature/fix
- Follow our code style (checked via ESLint in
.eslintrc.json) - Test your changes to ensure everything works smoothly
- Submit a pull request with a clear summary of your work
This project is licensed under the MIT License.
See the LICENSE file for more information.