Plugwise MCP Server
Provides control and monitoring of Plugwise smart home devices including thermostats, smart plugs, radiator valves, motion sensors, and energy monitoring gateways through automatic network discovery and real-time device state management.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Plugwise MCP Server what's the temperature in the living room?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Plugwise MCP Server
A TypeScript-based Model Context Protocol (MCP) server for Plugwise smart home integration with automatic network discovery.
β¨ Key Features
π€ AI Agent Mode: Natural language control via built-in AI agent
π‘ JSON-RPC Support: Programmatic API for scripting and automation
π Automatic Network Scanning: Discovers all Plugwise hubs on your network
π Credential Management: Stores hub passwords securely from .env file
π Device Control: Control thermostats, switches, and smart plugs
π‘οΈ Temperature Management: Set temperatures, presets, and schedules
π Energy Monitoring: Read power consumption and sensor data
π Multi-Hub Support: Manage multiple gateways simultaneously
π Real-time Updates: Get current device states and measurements
Related MCP server: Homey MCP Server
π Quick Start
Installation via npm (Recommended)
Install globally to use with any MCP client:
npm install -g plugwise-mcp-serverOr use directly with npx (no installation needed):
npx plugwise-mcp-serverInstallation from Source
git clone https://github.com/Tommertom/plugwise-mcp-server.git
cd plugwise-mcp-server
npm install
npm run buildPrerequisites
Node.js 17 or higher
npm or yarn
Plugwise gateway (Adam, Anna, Smile P1, or Stretch)
Quick Test
Test the installation without real hardware using mock mode:
# Test all read operations
npm run test:read-only -- --mock
# Test protocol features
npm run test:features -- --mockOr with real hardware:
# Set up gateway credentials
echo "PLUGWISE_HOST=192.168.1.100" > .env
echo "PLUGWISE_PASSWORD=your-gateway-password" >> .env
# Run tests
npm run test:read-onlySee Quick Test Guide for more options.
Start the Server
Option 1: Standard MCP Server (15+ specialized tools)
When installed via npm:
plugwise-mcp-serverWhen running from source:
npm startOption 2: AI Agent Mode (Single natural language tool)
# Interactive mode with prompt
npm run agent "List my devices"
npm run agent "Set living room to 21 degrees"
# Interactive with verbose debugging
npm run agent "What's the power usage?" -- -v
# MCP server mode (no arguments)
npm run agent
# JSON-RPC mode (for scripting)
npm run agent -- --jsonrpc
echo '{"jsonrpc":"2.0","method":"execute","params":{"instruction":"List devices"},"id":1}' | npm run agent -- --jsonrpcSee Agent Documentation and JSON-RPC Mode for details.
π Adding the MCP Server to Your Client
The Plugwise MCP server can work with any MCP client that supports standard I/O (stdio) as the transport medium. Choose between:
Standard Mode: 15+ specialized tools for direct device control
Agent Mode: Single
manage_plugwisetool with natural language interface
Claude Desktop
Standard Mode (15+ tools):
{
"mcpServers": {
"plugwise": {
"command": "npx",
"args": ["-y", "plugwise-mcp-server@latest"],
"env": {
"HUB1": "abc12345",
"HUB1IP": "192.168.1.100",
"HUB2": "def67890",
"HUB2IP": "192.168.1.101"
}
}
}
}Agent Mode (natural language):
{
"mcpServers": {
"plugwise-agent": {
"command": "node",
"args": ["/path/to/plugwise/dist/cli/plugwise-agent-cli.js"],
"env": {
"OPENAI_API_KEY": "sk-...",
"PLUGWISE_AGENT_MODEL": "gpt-4o-mini"
}
}
}
}Cline
To configure Cline to use the Plugwise MCP server, edit the cline_mcp_settings.json file. You can open or create this file by clicking the MCP Servers icon at the top of the Cline pane, then clicking the Configure MCP Servers button.
{
"mcpServers": {
"plugwise": {
"command": "npx",
"args": ["-y", "plugwise-mcp-server@latest"],
"disabled": false,
"env": {
"HUB1": "abc12345",
"HUB1IP": "192.168.1.100",
"HUB2": "def67890",
"HUB2IP": "192.168.1.101"
}
}
}
}Cursor
To configure Cursor to use the Plugwise MCP server, edit either the file .cursor/mcp.json (to configure only a specific project) or the file ~/.cursor/mcp.json (to make the MCP server available in all projects):
{
"mcpServers": {
"plugwise": {
"command": "npx",
"args": ["-y", "plugwise-mcp-server@latest"],
"env": {
"HUB1": "abc12345",
"HUB1IP": "192.168.1.100",
"HUB2": "def67890",
"HUB2IP": "192.168.1.101"
}
}
}
}Visual Studio Code Copilot
To configure a single project, edit the .vscode/mcp.json file in your workspace:
{
"servers": {
"plugwise": {
"type": "stdio",
"command": "npx",
"args": ["-y", "plugwise-mcp-server@latest"],
"env": {
"HUB1": "abc12345",
"HUB1IP": "192.168.1.100",
"HUB2": "def67890",
"HUB2IP": "192.168.1.101"
}
}
}
}To make the server available in every project you open, edit your user settings:
{
"mcp": {
"servers": {
"plugwise": {
"type": "stdio",
"command": "npx",
"args": ["-y", "plugwise-mcp-server@latest"],
"env": {
"HUB1": "abc12345",
"HUB1IP": "192.168.1.100",
"HUB2": "def67890",
"HUB2IP": "192.168.1.101"
}
}
}
}
}Windsurf Editor
To configure Windsurf Editor, edit the file ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"plugwise": {
"command": "npx",
"args": ["-y", "plugwise-mcp-server@latest"],
"env": {
"HUB1": "abc12345",
"HUB1IP": "192.168.1.100",
"HUB2": "def67890",
"HUB2IP": "192.168.1.101"
}
}
}
}Environment Variables
The server reads hub passwords from environment variables. You can provide these in two ways:
Option 1: MCP Configuration (Recommended)
Add the env field directly to your MCP client configuration as shown in the examples above.
Option 2: .env File
Create a .env file in your project root or set system-wide environment variables:
# Hub passwords (8-character codes from gateway stickers)
HUB1=abc12345
HUB2=def67890
# Optional: Known IP addresses for faster discovery and auto-loading
HUB1IP=192.168.1.100
HUB2IP=192.168.1.101Security Note: When using the MCP configuration env field, credentials are passed securely to the server process. For enhanced security, consider using .env files which are typically excluded from version control.
Quick Test
# Automatically discover and connect to your hubs
node scripts/workflow-demo.jsπ‘ MCP Tools
Network Discovery
connect
Connect to a Plugwise gateway.
// Connect to specific hub
await mcpClient.callTool('connect', { host: '192.168.1.100' });
// Manual connection
await mcpClient.callTool('connect', {
host: '192.168.1.100',
password: 'abc12345'
});Device Management
get_devices
Get all devices and their current states.
const result = await mcpClient.callTool('get_devices', {});
// Returns all devices, zones, sensors, and their current valuesClimate Control
set_temperature
Set thermostat temperature setpoint.
await mcpClient.callTool('set_temperature', {
location_id: 'zone123',
setpoint: 21.0
});set_preset
Change thermostat preset mode.
await mcpClient.callTool('set_preset', {
location_id: 'zone123',
preset: 'away' // Options: home, away, sleep, vacation
});Device Control
control_switch
Turn switches/plugs on or off.
await mcpClient.callTool('control_switch', {
appliance_id: 'plug123',
state: 'on' // 'on' or 'off'
});Gateway Management
set_gateway_mode: Set gateway mode (home, away, vacation)set_dhw_mode: Set domestic hot water mode (auto, boost, comfort, off)set_regulation_mode: Set heating regulation modedelete_notification: Clear gateway notificationsreboot_gateway: Reboot the gateway (use with caution)
MCP Resources
plugwise://devices: Access current state of all devices as a resource
MCP Prompts
setup_guide: Get comprehensive step-by-step setup instructions
π§ͺ Testing
Comprehensive Read-Only Test Suite
npm run test:allThis runs a complete test of all read-only MCP operations:
β Server health check
β MCP protocol initialization
β Network scanning for hubs
β Gateway connection and info retrieval
β Device state reading
β Resources and prompts
Safe: Only tests read operations, never changes device states.
See Test Documentation for details.
Complete Workflow Demo
node scripts/workflow-demo.jsThis demonstrates:
β Network scanning with .env passwords
β Auto-connection without credentials
β Device discovery and listing
β Multi-hub management
Network Scanning Test
node scripts/test-network-scan.jsFull MCP Test Suite
node scripts/test-mcp-server.jsBash Script for Hub Discovery
./scripts/find-plugwise-hub.shποΈ Supported Devices
Gateways
Adam: Smart home hub with OpenTherm support (thermostat control, floor heating)
Anna: Standalone thermostat gateway
Smile P1: Energy monitoring gateway (electricity, gas, solar)
Stretch: Legacy hub for connecting Circle smart plugs
Connected Devices
Jip: Motion sensor with illuminance detection
Lisa: Radiator valve (requires hub)
Tom/Floor: Floor heating controller
Koen: Radiator valve (requires a Plug as intermediary)
Plug: Smart plug with power monitoring (Zigbee)
Aqara Plug: Third-party Zigbee smart plug
Circle: Legacy Circle/Circle+ plugs (via Stretch only)
π Documentation
Setup Guide - Detailed setup instructions
MCP Server Documentation - Complete API reference
Network Scanning Guide - Network discovery deep dive
Network Scanning Summary - Feature overview
π§ Development
Development Mode
Run with hot-reload:
npm run devBuild
Compile TypeScript to JavaScript:
npm run buildProject Structure
plugwise/
βββ src/mcp/ # TypeScript source
β βββ server.ts # MCP server with tools
β βββ plugwise-client.ts # Plugwise API client
β βββ plugwise-types.ts # Type definitions
βββ build/mcp/ # Compiled JavaScript
βββ docs/ # Documentation
βββ scripts/ # Test scripts
β βββ workflow-demo.js
β βββ test-network-scan.js
β βββ test-mcp-server.js
β βββ find-plugwise-hub.sh
βββ .env # Hub credentials
βββ package.json
βββ tsconfig.jsonπ Security
Password Storage: Store passwords in
.envfile only (never in code)Git Ignore:
.envis in.gitignoreto prevent committing secretsNetwork Security: Plugwise uses HTTP Basic Auth (not HTTPS)
Keep gateways on secure local network
Use VPN for remote access
Consider separate VLAN for IoT devices
API Access: The API has full control over your heating system - restrict access accordingly
π Troubleshooting
No Hubs Found During Scan
Check
.envfile hasHUB1,HUB2, etc. definedVerify passwords are correct (case-sensitive, check gateway sticker)
Ensure gateways are powered on and connected to network
Confirm you're on the same network as the hubs
Try:
ping <gateway_ip>to test connectivity
Connection Errors
Verify IP address is correct
Check firewall isn't blocking port 80
Test with manual connection:
curl http://<ip>/core/domain_objectsEnsure gateway isn't overloaded with requests
π€ Integration Examples
Using with Claude Code
claude mcp add --transport http plugwise-server http://localhost:3000/mcpUsing with VS Code Copilot
Add to .vscode/mcp.json:
{
"mcpServers": {
"plugwise": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}Using MCP Inspector
npx @modelcontextprotocol/inspectorConnect to: http://localhost:3000/mcp
π Example Workflows
Morning Routine
// Connect to hub
await mcpClient.callTool('connect', { host: '192.168.1.100' });
// Set home mode
await mcpClient.callTool('set_preset', {
location_id: 'living_room',
preset: 'home'
});
// Warm up bathroom
await mcpClient.callTool('set_temperature', {
location_id: 'bathroom',
setpoint: 22.0
});Energy Monitoring
const devices = await mcpClient.callTool('get_devices', {});
for (const [id, device] of Object.entries(devices.data)) {
if (device.sensors?.electricity_consumed) {
console.log(`${device.name}: ${device.sensors.electricity_consumed}W`);
}
}Multi-Hub Management
// List all hubs
const hubsList = await mcpClient.callTool('list_hubs', {});
// Get devices from each hub
for (const hub of hubsList.hubs) {
await mcpClient.callTool('connect', { host: hub.ip });
const devices = await mcpClient.callTool('get_devices', {});
console.log(`Hub ${hub.ip}: ${Object.keys(devices.data).length} devices`);
}π Documentation
Migration Guides
Structure Migration Plan - Complete plan for restructuring project
Structure Comparison - Visual comparison of architectures
Migration Checklist - Step-by-step migration checklist
Migration Summary - Quick reference summary
Architecture & Design
Architecture Diagram - System architecture overview
Code Organization - Project structure and conventions
Reorganization Overview - Historical reorganization notes
Implementation Guides
Autoload Hubs - Automatic hub loading implementation
Network Scanning - Network discovery implementation
Temperature Tools - Temperature control features
Sensor & Switch Parsing - Device parsing logic
Quick References
Quick Reference - Common commands and patterns
Autoload Quick Reference - Autoload feature guide
Temperature Tools Quick Reference - Temperature API guide
Testing & Development
Quick Test Guide - Fast start testing guide
Test Scripts Documentation - Comprehensive testing documentation
Test All Script - HTTP-based testing guide
Multi-Hub Testing - Testing with multiple hubs
List Devices Script - Device enumeration guide
Publishing & Setup
Publishing Guide - How to publish to npm
Setup Guide - Initial setup instructions
Publish Checklist - Pre-publish verification
π Credits
Based on the excellent python-plugwise library.
Architectural patterns inspired by sonos-ts-mcp.
π License
MIT License - See LICENSE file for details
π Version
Current version: 1.0.2
β Full MCP protocol support
β Automatic network scanning
β Multi-hub management
β Complete device control
β Comprehensive documentation
β Structure migration planning
Available Tools
16 toolsadd_hubA
Add a new Plugwise hub by providing its name (used as password). Scans the network to find the hub and stores it in the /hubs folder as a JSON file for future use. The hub name is the unique identifier printed on the back of your Plugwise device.
Inputs: hubName (required).
connectA
Connect to a Plugwise gateway (Adam, Anna, Smile P1, or Stretch) and retrieve gateway information. If no host is provided, automatically connects to the first discovered hub. Returns detailed gateway information including model, type, version, hostname, and MAC address.
Inputs: host, password, port, username.
control_switchB
Turn a switch or relay on or off. Works with Plugwise switches, relays, and smart plugs. Use this to control any switchable device in your Plugwise network.
Inputs: appliance_id (required), state (required), model.
delete_notificationA
Delete all gateway notifications. Use this to clear error messages or warnings from the Plugwise gateway.
Inputs: no named parameters.
get_all_temperaturesA
Get current temperatures and setpoints for all thermostats and zones in the system. Returns comprehensive temperature data including measured values, setpoints, control states, and climate modes for every temperature-capable device.
Inputs: no named parameters.
get_devicesA
Retrieve all Plugwise devices and their current states, sensors, and capabilities. Returns comprehensive information for all connected devices including thermostats, switches, sensors, and other appliances. Includes current readings, capabilities, and operational states.
Inputs: no named parameters.
get_temperatureA
Get current room temperature and setpoint for a specific thermostat or zone. Returns both the measured temperature and the target setpoint.
Inputs: device_id (required).
get_temperature_offsetB
Get the temperature offset (calibration) for a thermostat device. The offset is used to calibrate the temperature sensor if it reads incorrectly. Returns the current offset value and its valid range.
Inputs: device_id (required).
list_hubsA
List all registered Plugwise hubs from the /hubs folder and in-memory registry. Returns hub information including name, IP address, model, and firmware version for each discovered hub.
Inputs: no named parameters.
reboot_gatewayA
Reboot the Plugwise gateway. Use with caution as this will temporarily disconnect all devices and interrupt heating/cooling control. The gateway typically takes 1-2 minutes to fully restart.
Inputs: no named parameters.
set_dhw_modeA
Set the domestic hot water (DHW) heating mode for systems with hot water control. Auto mode follows the schedule, boost mode provides immediate hot water heating, comfort mode maintains higher temperature, and off mode disables DHW heating.
Inputs: mode (required).
set_gateway_modeA
Set the gateway mode (home, away, vacation). This is a system-wide setting that affects all zones and presets. Home mode uses normal schedules, away mode uses reduced temperatures, and vacation mode provides minimal heating/cooling.
Inputs: mode (required).
set_presetB
Set the preset mode on a thermostat or zone (e.g., home, away, sleep, vacation). Presets apply predefined temperature settings and behaviors configured in your Plugwise system.
Inputs: location_id (required), preset (required).
set_regulation_modeB
Set the heating regulation mode. Controls the overall heating system behavior. Use "heating" for normal operation, "off" to disable heating, or bleeding modes for system maintenance.
Inputs: mode (required).
set_temperatureA
Set the temperature setpoint on a thermostat or zone. Supports single setpoint for heating/cooling systems, or separate low/high setpoints for heat pump systems. Changes take effect immediately.
Inputs: location_id (required), setpoint, setpoint_low, setpoint_high.
set_temperature_offsetC
Set the temperature offset (calibration) for a thermostat device. This adjusts the measured temperature by a fixed offset.
Inputs: device_id (required), offset (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 16 tools
Most tools have distinct purposes, but some overlap exists between temperature-related tools (e.g., get_all_temperatures and get_temperature, set_temperature and set_preset). The descriptions help clarify differences, but an agent might occasionally misselect between closely related temperature controls.
Tool names follow a consistent verb_noun pattern throughout (e.g., add_hub, connect, control_switch, get_all_temperatures). All tools use snake_case, and verbs are clear and appropriate, making the set predictable and easy to navigate.
With 16 tools, the count is slightly high but reasonable for a home automation server covering hubs, devices, temperatures, and modes. It provides comprehensive control without being overwhelming, though some tools could potentially be consolidated.
The tool set offers complete coverage for Plugwise system management, including hub setup (add_hub, list_hubs), device control (control_switch, get_devices), temperature management (get/set temperatures, offsets), and system modes (gateway, preset, regulation, DHW). No obvious gaps exist for core operations.
Maintenance
Related MCP Connectors
Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
Ask about your IoT sensors, devices, anomalies and automations, switch outputs and log values.
Control your existing Philips lights, Sonos speakers, Roborock vacuums and other supported devices through Port OS cloud. Give ChatGPT, Claude and other MCP-compatible assistants access to the devices you connect. Turn off the living room lights, play music on your speakers, adjust the thermostat, run a vacuum in a room, check a camera snapshot or find a connected tracker. Available actions depend on your linked provider accounts and each deviceβs supported capabilities. Port OS runs in the cloud; no local server is required. You choose the account, device and capability permissions each assistant receives. Device operations require user OAuth; public tool discovery does not grant device access. Port OS is in alpha. Setup: https://portoperatingsystem.com/docs/getting-started/ Support: https://portoperatingsystem.com/contact/
Control your Tesla from your AI assistant - climate, charging, access, and security.
Related MCP Servers
- -licenseNot gradedqualityDmaintenanceEnables control of TP-Link Kasa smart home devices through natural language commands. Supports device control, lighting scenes, room-based organization, and real-time status monitoring for smart plugs and bulbs.-
- FlicenseBqualityNot gradedmaintenanceEnables interaction with Homey smart home devices through natural language, allowing users to control devices, manage zones, and trigger automation flows.64-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Home Assistant smart home devices through natural language. Control devices, manage automations, query entity states, and retrieve historical data across your home automation system.1MIT
- AlicenseAqualityBmaintenanceEnables natural language control of Homey Pro smart home systems, including devices, flows, zones, energy monitoring, weather, alarms, and system management, with 43 tools and troubleshooting prompts.50MIT