JSPM

  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q70755F
  • License MIT

A node to control Kodi with automatic JSON-RPC method discovery (dev version)

Package Exports

  • n8n-nodes-kodi
  • n8n-nodes-kodi/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (n8n-nodes-kodi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

n8n Kodi Node

A powerful and intelligent n8n node for controlling Kodi media centers via JSON-RPC API with automatic method discovery.

🚀 Features

Automatic Method Discovery

  • Dynamic API Adaptation: Automatically discovers all available JSON-RPC methods from your Kodi instance
  • No Hardcoded Methods: Adapts to any Kodi version or configuration automatically
  • Real-time Method List: Always up-to-date with your Kodi instance's capabilities

🔍 Smart Method Parsing

  • Clean Method Names: Extracts proper method names (e.g., VideoLibrary.Scan) instead of raw introspection data
  • Parameter Information: Automatically captures and displays method parameters and return types
  • Intelligent Grouping: Combines related .params and .returns data into coherent method definitions

🎯 Three Operation Modes

  1. Discover Methods: Automatically find all available Kodi methods
  2. Execute Method: Run any discovered method with custom parameters
  3. Raw JSON-RPC: Send custom JSON-RPC requests for advanced users

🛠 Enhanced User Experience

  • Dynamic Method Selection: Dropdown populated with discovered methods
  • Parameter Guidance: See what parameters each method expects
  • Return Type Info: Understand what each method returns
  • JSON Parameter Input: Flexible parameter specification

📋 Prerequisites

  • n8n (self-hosted or cloud)
  • Kodi media center with JSON-RPC enabled
  • Network access to your Kodi instance

🚀 Installation

npm install n8n-nodes-kodi

Option 2: Manual Installation

  1. Clone this repository
  2. Install dependencies: npm install
  3. Build the project: npm run build
  4. Copy the dist folder to your n8n custom nodes directory

⚙️ Configuration

1. Add Kodi Credentials

In n8n, go to CredentialsAdd CredentialKodi API:

  • Host: Your Kodi device IP address (e.g., 192.168.1.100)
  • Port: Kodi HTTP port (default: 8080)
  • Username: HTTP username (if configured)
  • Password: HTTP password (if configured)

2. Enable JSON-RPC in Kodi

  1. Go to SettingsServicesControl
  2. Enable Allow remote control via HTTP
  3. Set Port (default: 8080)
  4. Optionally set Username and Password

📖 Usage

🔍 Discover Methods Operation

Use this to see all available methods on your Kodi instance:

{
  "success": true,
  "methods": [
    {
      "name": "VideoLibrary.Scan",
      "description": "Method: VideoLibrary.Scan",
      "hasParameters": true,
      "hasReturns": true
    },
    {
      "name": "Player.GetActivePlayers",
      "description": "Method: Player.GetActivePlayers",
      "hasParameters": false,
      "hasReturns": true
    }
  ],
  "total": 2
}

Execute Method Operation

Run any discovered method with custom parameters:

  1. Select Method: Choose from the dynamically populated dropdown
  2. Set Parameters: Use the JSON parameter input (if the method accepts parameters)
  3. Show Parameter Info: Toggle to see what parameters the method expects

Example: Execute VideoLibrary.Scan with parameters:

{
  "showdialogs": true,
  "directory": "movies"
}

🔧 Raw JSON-RPC Operation

For advanced users who want full control:

{
  "jsonrpc": "2.0",
  "method": "VideoLibrary.Scan",
  "params": {
    "showdialogs": true
  },
  "id": 1
}

🎯 Common Use Cases

📺 Media Library Management

  • Scan video/audio libraries
  • Get movie/show information
  • Export media data

🎮 Player Control

  • Play/pause media
  • Navigate playlists
  • Control volume and playback

🖥 System Operations

  • Get system information
  • Control power states
  • Manage add-ons

📱 Remote Control

  • Send navigation commands
  • Execute actions
  • Show notifications

🔧 Development

Building from Source

# Install dependencies
npm install

# Build the project
npm run build

# Run linter
npm run lint

# Run tests (if available)
npm test

Project Structure

nodes/Kodi/
├── Kodi.node.ts          # Main node implementation
├── Kodi.svg              # Node icon
├── interface.ts           # Type definitions
└── kodi.ts               # Generated Kodi API types

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Guidelines

  • Follow TypeScript best practices
  • Maintain n8n coding standards
  • Add tests for new features
  • Update documentation as needed

📝 Changelog

v0.1.25-dev

  • NEW: Automatic method discovery with clean method names
  • NEW: Parameter and return type information parsing
  • NEW: Enhanced user interface with method details
  • 🔧 FIXED: Method name parsing (removed .params/.returns suffixes)
  • 🎨 IMPROVED: Better error handling and user feedback

v0.1.20-dev

  • 🔄 REFACTORED: Converted from declarative to programmatic node
  • 🎯 ENHANCED: Dynamic method discovery via JSON-RPC introspection
  • 🛠 IMPROVED: Better error handling and TypeScript support

🙏 Credits

Original Development

  • n8n Community: Base node framework and infrastructure

Major Enhancements & Rewrite

  • Claude Sonnet 4 (Anthropic): Complete refactoring from declarative to programmatic node, implementation of automatic method discovery, intelligent method parsing, parameter information extraction, and enhanced user experience features.

Contributors

  • pm: Project maintainer and requirements specification
  • Claude Sonnet 4: AI assistant for implementation and enhancement

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

Getting Help

  • Issues: Report bugs or request features via GitHub Issues
  • Discussions: Join the conversation in GitHub Discussions
  • n8n Community: Get help from the broader n8n community

Known Issues

  • Some Kodi versions may have different introspection data structures
  • Parameter validation is currently basic (JSON format only)
  • Complex nested parameters may require manual JSON construction

🌟 Star History

If you find this node useful, please consider giving it a star! It helps with visibility and encourages further development.


Made with ❤️ for the n8n and Kodi communities