Skip to content
home-automation logo

Home Automation

home-automation

Integrate smart homes with Home Assistant, HomeKit, Google Home, Matter.

SKILL.md

Full skill instructions

home-automation

Purpose

This skill integrates smart home systems using Home Assistant, HomeKit, Google Home, and Matter protocols, allowing the AI to control IoT devices programmatically for automation tasks.

When to Use

Use this skill for automating home environments, such as controlling lights, thermostats, or security systems via IoT platforms. Apply it in scenarios like smart home apps, voice assistant integrations, or custom scripts for daily routines (e.g., turning off lights at bedtime).

Key Capabilities

  • Connect to Home Assistant via REST API for device state management.
  • Integrate with HomeKit using the HAP protocol for Apple ecosystem devices.
  • Use Google Home APIs for controlling compatible smart devices.
  • Handle Matter devices through bridge APIs for cross-platform compatibility.
  • Specifics: Home Assistant API endpoint for states is GET /​api/​states; HomeKit requires Bonjour discovery; Google Home uses OAuth 2.0 with scopes like https://www.googleapis.com/​auth/​homeautomation; Matter involves IP-based commissioning.

Usage Patterns

To use this skill, first initialize it with authentication. Import via skill.use('home-automation'), then call methods like skill.connect(service, key). For sequential tasks, chain calls: connect, query state, execute action. Always handle async operations with promises or callbacks. Config format: JSON objects, e.g., {"service": "home-assistant", "api_url": "http://localhost:8123"}.

Common Commands/​API

  • CLI: Run openclaw home-automation connect --service home-assistant --api-url http://localhost:8123 --key $HOME_ASSISTANT_API_KEY to establish a connection.
  • API: Use POST /​api/​services for Home Assistant actions; example endpoint for Google Home: GET https://homegraph.googleapis.com/​v1/​devices.
  • Code snippets:
    skill.use('home-automation')
    skill.connect('home-assistant', { apiUrl: 'http://localhost:8123', key: process.env.HOME_ASSISTANT_API_KEY })
    
    const state = await skill.call('getState', { entity: 'light.living_room' })
    console.log(state)
    
    skill.execute('turnOn', { device: 'light.kitchen', service: 'homekit' })
    
    Use env vars for keys: $HOME_ASSISTANT_API_KEY for Home Assistant, $GOOGLE_HOME_TOKEN for Google Home.

Integration Notes

Authenticate using env vars (e.g., $HOME_ASSISTANT_API_KEY) before operations. For HomeKit, ensure devices are paired via the Home app; use HAP-NodeJS library for custom integrations. Google Home requires OAuth flow—redirect to https://accounts.google.com/​o/​oauth2/​v2/​auth. Matter integration needs a compatible bridge; config format: YAML like matter: { bridge_ip: '192.168.1.100', port: 5540 }. Avoid mixing protocols in one call; use wrappers for error-free transitions between services.

Error Handling

Check for HTTP errors (e.g., 401 Unauthorized) by wrapping calls in try-catch blocks. For authentication failures, retry with refreshed tokens. Common errors: API rate limits (e.g., Home Assistant returns 429); handle with exponential backoff. Code snippet:

try {
  await skill.call('getState', { entity: 'light.living_room' })
} catch (error) {
  if (error.code === 401) console.error('Reauthenticate with $HOME_ASSISTANT_API_KEY')
  else throw error
}

Log detailed responses and use skill-specific error codes for debugging.

Concrete Usage Examples

  1. Automate lights based on time: Use skill.connect('home-assistant', { key: process.env.HOME_ASSISTANT_API_KEY }), then skill.execute('turnOff', { entity: 'light.all' }) in a scheduled script to turn off all lights at 11 PM.
  2. Integrate with Google Home for temperature control: Call skill.use('home-automation').connect('google-home', { token: process.env.GOOGLE_HOME_TOKEN }), followed by skill.call('setThermostat', { deviceId: 'thermostat.living_room', temperature: 72 }) to adjust the thermostat.

Graph Relationships

  • Cluster: Connected to 'iot' cluster for broader IoT integrations.
  • Tags: Links to skills with 'iot' and 'home' tags, such as device-control or smart-security skills.
  • Relationships: This skill depends on authentication services; it integrates with external APIs like Home Assistant's REST endpoints and Google Home's OAuth flows.

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View