Skip to content

Repository files navigation

Hubitat Rules Machine MCP Server

A Model Context Protocol (MCP) server for intelligent Hubitat Rules Machine automation assistance. This server provides AI-powered tools to help analyze, manage, and create Rules Machine automations.

Features

🔧 Tools

  • Rule Executor: Control existing rules (run/stop/pause/resume) via Rules Machine API
  • Rule Template Generator: Create detailed templates and step-by-step instructions for manual rule creation
  • Device Finder: Discover and analyze devices with their capabilities
  • Rule Analyzer: Analyze existing rules for optimization and improvement opportunities
  • Hub Integration: Manage hub modes, HSM status, and variables

📚 Resources

  • Device Capabilities: Comprehensive reference of Hubitat device capabilities and commands
  • Automation Patterns: Library of common automation patterns and templates
  • Best Practices: Guidelines for effective Rules Machine automation

💬 Prompts

  • Rule Guidance: Interactive guidance for creating Rules Machine automations
  • Troubleshooting: Help debug and resolve automation issues
  • Best Practices: Comprehensive automation best practices guidance

Quick Start

Prerequisites

  • Node.js 18+
  • TypeScript 5.0+
  • Hubitat Hub with Rules Machine
  • Hubitat Maker API access token

Installation

  1. Clone and install:
git clone <repository-url>
cd hubitat-rules-mcp
npm install
  1. Build the project:
npm run build
  1. Start the server:
npm start

Development Mode

npm run dev

Configuration

The MCP server requires your Hubitat hub IP address and Maker API access token for API operations. These are provided as parameters when using the tools.

Getting Your Maker API Token

  1. In Hubitat admin interface, go to AppsAdd Built-In App
  2. Select Maker API
  3. Select the devices you want to control
  4. Note the access token from the app page

Tool Usage Examples

Execute Rule Control

{
  "tool": "execute_rule",
  "arguments": {
    "action": "run",
    "rule_ids": ["123"],
    "hubitat_ip": "192.168.1.100",
    "access_token": "your-token-here"
  }
}

Generate Rule Template

{
  "tool": "generate_template",
  "arguments": {
    "automation_goal": "Turn on lights when motion detected at night",
    "complexity": "intermediate",
    "devices": ["Motion Sensor", "Living Room Lights"]
  }
}

Find Devices

{
  "tool": "find_devices",
  "arguments": {
    "hubitat_ip": "192.168.1.100",
    "access_token": "your-token-here",
    "filter": {
      "capability": "motionSensor"
    }
  }
}

Important Limitations

⚠️ Rules Machine does NOT provide APIs for creating or modifying rules. This MCP server works WITH Rules Machine's existing capabilities:

What it CAN do:

  • Control existing rules (run/stop/pause/resume)
  • Manage hub variables and settings
  • Provide expert guidance for manual rule creation
  • Analyze existing rules for optimization
  • Generate detailed templates and instructions

What it CANNOT do:

  • Automatically create rules (not supported by Rules Machine API)
  • Modify existing rule logic (security limitation)
  • Export rule configurations (limited API access)

Architecture

The server provides intelligent assistance for Rules Machine automation through:

  1. API Integration: Direct control of supported Rules Machine functions
  2. Expert Knowledge: Comprehensive automation guidance and best practices
  3. Template Generation: Detailed instructions for manual rule implementation
  4. Analysis Tools: Rule optimization and improvement recommendations

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

AGPL-3.0

Support

For issues and questions:

  • Check the troubleshooting resources in the MCP server
  • Review the best practices guidance
  • Open an issue on GitHub

Made with ❤️ for intelligent home automation

Bringing AI assistance to Hubitat Rules Machine - working within platform capabilities to enhance your automation experience.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages