n8n-nodes-kodi
v0.3.0
Published
A powerful n8n community node for controlling Kodi media center through JSON-RPC API with intelligent method discovery and comprehensive media management capabilities
Maintainers
Readme
n8n Kodi Node
A powerful n8n community node for controlling Kodi media center through JSON-RPC API with intelligent method discovery and comprehensive media management capabilities.
🎯 Features
Dynamic Method Discovery
- Automatic Discovery: Automatically discovers available JSON-RPC methods from your Kodi instance
- JSON-RPC Introspection: Uses Kodi's built-in
JSONRPC.Introspectfor accurate method information - Fallback Methods: Comprehensive fallback to 40+ common Kodi methods if discovery fails
- Smart Caching: Efficient method caching with force refresh options
Three Core Operations
- Execute Method: Run specific Kodi methods with dynamic dropdown selection
- Raw JSON-RPC: Send custom JSON-RPC commands for advanced users
- Discover Methods: Automatically find and categorize available methods
Comprehensive Method Coverage
- Video Library: Scan, clean, query movies, TV shows, episodes, music videos
- Audio Library: Manage audio content, albums, artists, songs
- Player Control: Play, pause, stop, seek, speed control
- System Operations: Shutdown, reboot, hibernate, suspend
- Application Control: Volume, notifications, window management
- File Management: Directory browsing, file details, media sources
- Addon Management: Install, configure, execute addons
- GUI Control: Notifications, window activation, properties
User Experience
- Category Organization: Methods automatically organized by functional category
- "All" Option: View all methods across categories for power users
- Method Descriptions: Human-readable descriptions for each available method
- Error Handling: Comprehensive error handling with clear messages
- Result Processing: Intelligent result formatting for workflow integration
🚀 Installation
n8n Community Nodes
npm install n8n-nodes-kodiManual Installation
- Clone this repository
- Run
npm install - Build with
npm run build - Copy the
distfolder to your n8n custom nodes directory
🔧 Configuration
Credentials Setup
Create a new Kodi credential with:
- Host: Kodi server IP address or hostname
- Port: HTTP port (default: 8080)
- Username: HTTP username (if authentication enabled)
- Password: HTTP password (if authentication enabled)
- Enable Discovery: Toggle for dynamic method discovery
- Discovery Timeout: Timeout for discovery operations
Node Configuration
- Operation: Choose between Execute Method, Raw JSON-RPC, or Discover Methods
- Method Category: Select from discovered categories or "All"
- Method: Choose specific method from the selected category
- Raw JSON-RPC: Custom JSON-RPC payload for advanced operations
- Options: Force discovery refresh and include method information
📖 Usage Examples
Basic Video Library Scan
{
"operation": "execute",
"methodCategory": "VideoLibrary",
"method": "VideoLibrary.Scan"
}Get All Movies
{
"operation": "execute",
"methodCategory": "VideoLibrary",
"method": "VideoLibrary.GetMovies"
}Player Control
{
"operation": "execute",
"methodCategory": "Player",
"method": "Player.PlayPause"
}Custom JSON-RPC
{
"operation": "raw",
"rawPayload": {
"jsonrpc": "2.0",
"method": "Application.SetVolume",
"params": {"volume": 50},
"id": "n8n"
}
}Method Discovery
{
"operation": "discover",
"options": {
"forceDiscovery": true,
"includeMethodInfo": true
}
}🔍 Method Categories
VideoLibrary
VideoLibrary.Scan- Scan for new video contentVideoLibrary.Clean- Clean video libraryVideoLibrary.GetMovies- Retrieve all moviesVideoLibrary.GetTVShows- Get TV show listVideoLibrary.GetEpisodes- Get episode informationVideoLibrary.GetMusicVideos- Retrieve music videos
AudioLibrary
AudioLibrary.Scan- Scan for new audio contentAudioLibrary.GetAlbums- Retrieve album collectionAudioLibrary.GetArtists- Get artist informationAudioLibrary.GetSongs- Retrieve song library
Player Control
Player.GetActivePlayers- Check active playersPlayer.PlayPause- Toggle play/pausePlayer.Stop- Stop playbackPlayer.Seek- Seek to positionPlayer.SetSpeed- Adjust playback speed
System Operations
System.GetProperties- Get system informationSystem.Shutdown- Power off systemSystem.Reboot- Restart systemSystem.Suspend- Suspend system
Application Control
Application.SetVolume- Adjust volumeApplication.Quit- Exit KodiApplication.Notify- Show notifications
🏗️ Architecture
Core Components
- Kodi Node: Main n8n node implementation with dynamic UI
- KodiService: Service layer for JSON-RPC communication
- Method Discovery: Intelligent method detection and categorization
- Error Handling: Comprehensive error management and user feedback
Technical Features
- TypeScript: Full type safety and modern JavaScript features
- Async/Await: Non-blocking operations for better performance
- Error Boundaries: Graceful fallbacks when operations fail
- Memory Management: Efficient caching with cleanup mechanisms
🧪 Testing
Build Verification
npm run build # TypeScript compilation
npm run lint # Code quality checks
npm run test # Run test suite (if available)Workflow Testing
- Create a simple workflow with the Kodi node
- Configure credentials and test connection
- Try different operations and verify results
- Test error scenarios and edge cases
🤝 Contributing
Development Setup
- Fork the repository
- Install dependencies:
npm install - Make your changes
- Run tests:
npm run build && npm run lint - Submit a pull request
Code Standards
- Follow TypeScript best practices
- Maintain comprehensive JSDoc comments
- Ensure all linting rules pass
- Test with multiple Kodi versions
📋 Requirements
- n8n: Version 1.82.0 or higher
- Node.js: Version 20.15 or higher
- Kodi: Version 18+ (Leia) or higher
- Network: HTTP access to Kodi instance
🔒 Security
- Authentication: Supports HTTP Basic Authentication
- Network Security: Works with HTTPS if configured
- Credential Storage: Secure credential management through n8n
- Input Validation: Comprehensive input sanitization and validation
📚 Resources
📄 License
This project is licensed under the MIT License - see the LICENSE.md file for details.
🙏 Acknowledgments
- Kodi Team: For the excellent JSON-RPC API
- n8n Community: For the robust node framework
- Contributors: For feedback, testing, and improvements
Version: 0.3.0
Last Updated: August 2025
Maintainer: Philipp Mundhenk
