Home and media: Home Assistant, MQTT, Plex and Jellyfin
Home Assistant and MQTT solve the same problem at different levels. Home Assistant gives you named entities and a permission model; MQTT gives you the raw topic bus underneath it. If Home Assistant already runs in your house, integrate there and treat MQTT as the fallback for devices it does not support. Plex and Jellyfin are a separate concern β a media catalogue the agent can query.
Home Assistant AI Integration
/** 'It's getting slightly chilly, maybe warm up the living room?' β executed contextually via your local Home Assistant instance. */
Local-First Privacy & Architecture
OpenClaw interfaces with Home Assistant via the Long-Lived Access Token (LLAT) over your local network. Unlike cloud-based assistants, your voice/text intent is processed locally or via encrypted VPC tunnels. We employ a 'Privacy-First' metadata layer that strips personal identifiers from device names before processing, ensuring your floor plan remains private while maintaining 100% control.
βοΈ Smart Home Workflow
OpenClaw maps natural language to HA services (light.turn_on, climate.set_temperature).
Real-time polling of entity states to prevent redundant commands (e.g., skip turning on already active lights).
Execute complex scripts that bridge Zigbee, Z-Wave, and Wi-Fi devices in a single atomic action.
AI-driven logic for solar curtailment or shifting heavy loads (EV charging) to off-peak hours.
βοΈ Step 1: Secure Token Generation
# π‘ Pro Tip: Name your token 'OpenClaw-Prod' to easily audit AI-driven actions in HA logs.
Navigate to your User Profile in the bottom left of the HA dashboard.
Scroll to the bottom, click 'Create Token', and copy the 200+ character string.
βοΈ Step 2: OpenClaw Configuration
π Extended Ecosystem
mqtt-integration
// Deep IoT hardware integration
smart-home-control
// Advanced automation patterns
AI for IoT: MQTT Pub/Sub
/** Enable OpenClaw to listen to thousands of sensory data streams and flip physical switches in the real world using the lightweight MQTT protocol. */
Sentient Logic for Hardware
Instead of writing fragile, hardcoded rules in Node-RED or Home Assistant, OpenClaw provides a direct Bridge to your MQTT broker. By pushing high-frequency telemetry states to the LLM and granting publish rights, it becomes a sentient logic engine. It doesn't just 'run a script'; it infers intent based on sensor contextβlike dimming lights when a lux sensor drops and a person is detected, without explicit IF/THEN blocks.
1. Broker Setup (Mosquitto/EMQX)
We assume you have a broker running locally. For optimal performance, ensure your broker is accessible on the same VPC or subnet as OpenClaw.
2. The MCP-to-MQTT Bridge
OpenClaw uses a universal bridge that translates MQTT messages into MCP resources. You don't need to write Python boilerplate; just declare your broker credentials in your configuration.
3. IoT Workflow: Sense & Act
Broadcasting your entire sensor tree can overwhelm context windows. We recommend using specific 'Exposed Topics' to keep the agent focused on relevant telemetry.
- βmqtt_subscribe(topic): Read real-time payloads from any subscribed path.
- βmqtt_publish(topic, payload): Execute physical actions by sending commands to actuators.
4. Practical Automation Examples
π‘οΈ Safety & Edge Intelligence
CRITICAL: Language models can hallucinate. Never grant mqtt_publish access to life-critical infrastructure or high-heat appliances without physical, hard-wired failsafes. Use specific Topic ACLs (Access Control Lists) in your Mosquitto configuration to restrict OpenClaw's reach to non-critical devices.
Media Server Copilot: Plex & Jellyfin
Connect OpenClaw to your self-hosted media libraries. Ask for movie recommendations, check what's playing, or trigger downloads via natural language.
The Smart Home DJ
Instead of manually scrolling through hundreds of gigabytes of media on your NAS, you can hook OpenClaw up to your media stack REST APIs. Chat on Telegram or WhatsApp: "Did we finish watching Shogun yet? If not, cast the next episode to the Living Room."
1. Prerequisites
- βA running instance of Plex Media Server or Jellyfin.
- βYour Server's IP address (e.g., 192.168.1.100).
- βAn API Key or Authentication Token.
2. Fetching your Tokens
3. Installing the Media MCP Skill
The community has built an excellent bridge script that unifies both Plex and Jellyfin polling into standard MCP tool calls.
4. What Can It Do?
π‘ Pro Tip: For the ultimate setup, combine this skill with the mcp-arr-stack plugin. This allows the AI to realize a movie isn't on your Plex yet, and automatically send a request ticket to Radarr/Sonarr to fetch it for you!