Package Information
Available Nodes
Documentation generatingβ¦
Documentation
n8n Kodi Node
A powerful and intelligent n8n node for interacting with Kodi media centers via JSON-RPC API. This node automatically discovers available methods and provides a user-friendly interface for executing Kodi commands.
β¨ Features
π Automatic Method Discovery
- Smart Introspection: Automatically discovers all available Kodi methods via JSON-RPC introspection
- Method Parsing: Intelligently parses complex Kodi API structures to extract actual methods
- Real-time Updates: Always shows the latest methods available on your Kodi instance
- No Hardcoding: Adapts to any Kodi version or configuration automatically
π― Three Operation Modes
- Discover Methods: Automatically find all available Kodi methods and their descriptions
- Execute Method: Run any discovered method with dynamic parameter generation
- Raw Request: Send custom JSON-RPC requests for advanced users
π§ Dynamic Parameter Generation
- Smart Parameter Detection: Automatically identifies method parameters and return types
- User-Friendly Interface: Select parameters from dropdowns instead of manual entry
- Parameter Descriptions: Shows detailed information about each parameter
- Default Values: Pre-configured with sensible defaults (e.g.,
ID: n8n)
π¨ Enhanced User Experience
- Method Filtering: Easy method selection with full descriptions
- Parameter Validation: Built-in parameter type checking and validation
- Debug Information: Real-time debugging and method information display
- Error Handling: Comprehensive error messages and fallback options
π Prerequisites
- n8n: Version 1.0 or higher
- Kodi: Any version with JSON-RPC enabled
- Network Access: n8n must be able to reach your Kodi instance
π Installation
Option 1: npm (Recommended)
npm install n8n-nodes-kodi
Option 2: Manual Installation
- Clone this repository
- Run
npm install - Run
npm run build - Copy the
distfolder to your n8n custom nodes directory
βοΈ Configuration
1. Kodi Credentials
Create a new credential type with:
- Host: Your Kodi IP address or hostname
- Port: Kodi HTTP port (default: 8080)
- Username: HTTP username (if enabled)
- Password: HTTP password (if enabled)
2. Node Setup
- Add the Kodi node to your workflow
- Select your Kodi credentials
- Choose the operation mode
- Configure method and parameters
π Usage
Operation 1: Discover Methods
Use this to see all available methods on your Kodi instance:
- Automatically discovers methods via
JSONRPC.Introspect - Shows method names, descriptions, and parameter information
- Updates in real-time based on your Kodi configuration
Operation 2: Execute Method
Execute any discovered method with dynamic parameters:
- Select Method: Choose from the discovered methods
- Configure Parameters: Use the dynamic parameter interface
- Add Parameters: Click "Add Parameter" to see available options
- Set Values: Enter parameter values as needed
- Execute: Run the method and see results
Operation 3: Raw Request
For advanced users who need custom JSON-RPC requests:
- Send any valid JSON-RPC request
- Useful for testing or custom implementations
- Full control over request format and parameters
π Dynamic Parameter System
The node automatically generates parameter options based on discovered method information:
- Parameter Names: Select from available parameters for the chosen method
- Parameter Types: See parameter types and descriptions
- Default Values: Sensible defaults are provided where possible
- Validation: Built-in parameter validation and error checking
π Common Use Cases
Media Library Management
- Scan video/audio libraries
- Get media information
- Update library metadata
Playback Control
- Play/pause/stop media
- Control volume and seeking
- Get player status
System Management
- Get system information
- Control power states
- Manage addons
File Operations
- Browse file systems
- Get file information
- Navigate media directories
π οΈ Development
Building the Node
# Install dependencies
npm install
# Build the node
npm run build
# Run linting
npm run lint
# Run tests
npm test
Project Structure
βββ nodes/
β βββ Kodi/
β βββ Kodi.node.ts # Main node implementation
β βββ Kodi.credentials.ts # Credential definitions
β βββ Kodi.svg # Node icon
βββ credentials/
β βββ KodiApi.credentials.ts
βββ package.json
βββ README.md
Key Components
- Method Discovery: Intelligent parsing of Kodi JSON-RPC introspection
- Parameter Generation: Dynamic parameter creation based on method definitions
- Error Handling: Comprehensive error handling with custom error types
- Type Safety: Full TypeScript implementation with proper type definitions
π§ Technical Details
JSON-RPC Introspection
The node uses Kodi's built-in JSONRPC.Introspect method to:
- Discover all available API methods
- Extract method parameters and return types
- Parse complex nested API structures
- Handle different Kodi versions automatically
Method Parsing Algorithm
- Primary Parsing: Extract methods from standard introspection paths
- Fallback Parsing: Use recursive search for complex structures
- Parameter Extraction: Parse parameter definitions and types
- Method Consolidation: Combine related method information
Error Handling
- Custom Error Types:
KodiErrorfor Kodi-specific errors - Graceful Fallbacks: Continue operation even if some features fail
- User Feedback: Clear error messages and debugging information
- Retry Logic: Automatic retry for transient failures
π Changelog
Version 0.1.31-dev (Current)
- β¨ NEW: Automatic method discovery via JSON-RPC introspection
- β¨ NEW: Dynamic parameter generation and validation
- β¨ NEW: Three operation modes (Discover, Execute, Raw)
- β¨ NEW: Smart method parsing and parameter extraction
- β¨ NEW: Enhanced user interface with parameter dropdowns
- β¨ NEW: Debug information and real-time method details
- π§ IMPROVED: Complete refactor from declarative to programmatic node
- π§ IMPROVED: Enhanced error handling and user feedback
- π§ IMPROVED: Better parameter validation and type checking
- π FIXED: Method discovery depth and parameter extraction
- π FIXED: UI rendering issues and field initialization
Version 0.1.20-dev
- Initial development version
- Basic JSON-RPC functionality
- Hardcoded method implementations
π€ Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
Development Guidelines
- Follow the existing code style
- Add proper TypeScript types
- Include error handling
- Update documentation
- Run tests and linting
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Credits
- Original Development: Community contributors
- AI Assistance: Claude Sonnet 4 (Anthropic)
- n8n Platform: n8n team for the excellent automation platform
- Kodi Community: For the comprehensive JSON-RPC API documentation
π Support
- Issues: Use GitHub Issues for bug reports and feature requests
- Documentation: Check the n8n documentation for general help
- Community: Join the n8n community for discussions
Note: This is a development version (0.1.31-dev). For production use, please wait for a stable release or test thoroughly in your environment.