Skip to main content

AI-Driven Smart Home Automation

Overview

OpenClaw manages a comprehensive smart home environment through deep integration with Home Assistant. This is not a collection of simple automations, it is an AI-orchestrated system that reasons about energy costs, sleep patterns, security events, and device health to make autonomous decisions.

Energy Management

Free Electricity Arbitrage (11 AM – 2 PM Daily)

The household electricity plan includes a free power window from 11:00 AM to 2:00 PM daily. OpenClaw exploits this with a coordinated set of cron jobs:

  • 11:00 AM, AC switches to DRY mode at 18°C (maximum dehumidification), pool pump turns on (~988W), dishwasher activated if loaded
  • 12:00 PM, Roborock vacuum runs full house clean (weekdays)
  • 2:00 PM, Pool pump off, AC off, free window ends

This scheduling concentrates ~2.5 kWh of heavy loads into the free window daily, saving approximately $15-20/month.

Smart Fan Switch (Hourly)

An hourly efficiency check monitors the AC compressor:

  • If room temperature is below the set point → switch to fan-only mode (compressor off, ~50W vs ~1.5kW)
  • If room temperature rises above set point + 1°C → switch back to cooling mode

This prevents the common pattern of an AC compressor cycling continuously when the room is already cool, a significant energy waste, especially overnight.

Device Power Tracking

Key devices are monitored via Tapo smart plugs:

  • Pool pump (switch.smart_plug), ~988W active, 38.7 kWh/month
  • Heat pump dryer (sensor.washing_machine_current_consumption), ~400-470W active
  • Entertainment hub (switch.smart_wi_fi_plug), ~51W standby via Matter/Tapo P110M

Sleep Optimisation

3-Phase Sleep AC Schedule

A data driven AC schedule targets a recurring 3 AM wake pattern identified via Welltory sleep data:

PhaseTimeModeTempPurpose
Phase 110:30 PMCool24°CInitial sleep onset, comfortable, not too cold
Phase 22:00 AMDry20°CDeep sleep maintenance, prevents the 3 AM cortisol wake
Phase 35:00 AMCool23°CPre-wake warming, supports natural circadian rise

The hypothesis: the 3 AM wake correlates with room temperature/humidity shifts. The DRY mode at 2 AM removes humidity spikes that can trigger light sleep transitions. This is being validated over 3-5 nights using Welltory recharge scores and tossing counts.

Security & Vision

AI Vision Sentry (Hourly)

OpenClaw performs hourly computer vision sweeps of all exterior cameras:

  • Cameras: Driveway, Entrance, Garden, Trampoline
  • Detection: People, vehicles, animals, anomalies (open gates, packages)
  • Filtering: Known vehicles (owner's Mazda CX5 and Jeep Wrangler, neighbour vehicles) are suppressed
  • Night mode: Extended driveway sweeps from 10 PM to 6 AM with person detection focus
  • Alerts: Only fires Telegram notifications for genuine events, no "all clear" spam

Camera Snapshots & Logging

Three times daily (7 AM, 1 PM, 7 PM), all cameras are snapshotted via the HA proxy API, analysed for changes, and logged to a persistent camera log. This creates a visual history that can be queried for "what happened in the driveway yesterday."

Kids & Family Automations

JobScheduleAction
Kids Wind-Down7:30 PM Sun–ThuDims kids room lights to 20% warm, TTS "Bedtime in 30 minutes!"
Kids Lights Out8:00 PM Sun–ThuLights off, media stopped, TTS "Goodnight!"
Weekend PlannerFriday 5 PMWeather-aware family activity suggestions for Wollongong

Home Health Monitoring

Home Optimus (Hourly)

A Python-based scoring system evaluates overall home health:

  • Battery levels across all wireless sensors (Aqara, Tapo)
  • Device availability, flags offline entities
  • Energy efficiency, compares current draw to expected baselines
  • Climate system health, AC integration status

Silent mode: Only delivers reports when the score drops below 80 or critical items are detected. No noise when everything is fine.

HA Watchdog (Every 30 min)

Monitors critical Home Assistant entities and attempts self-healing recovery. Ignores legacy Aqara entities that have migrated to Matter, avoiding false alarms from the hub transition.

Nightly Lockdown

At 10:30 PM daily, the goodnight routine secures the house:

  1. All lights off (corridor set to 5% nightlight)
  2. AC set to 24°C cool (Phase 1 of sleep schedule)
  3. Media players stopped
  4. Camera snapshots captured
  5. "House Secured" report delivered to Telegram

Integration Architecture

OpenClaw Agent

Home Assistant API (homeassistant.local:8123)

┌─────────────────────────────────────┐
│ Devices │
│ ─ Panasonic AC (Comfort Cloud) │
│ ─ Tapo Smart Plugs (P110, P110M) │
│ ─ Tapo Cameras (C510W, C520WS) │
│ ─ Aqara Hub M2 (Matter) │
│ ─ Roborock Qrevo MaxV │
│ ─ Various lights and sensors │
└─────────────────────────────────────┘

All HA interactions use the REST API with a long-lived access token. The token is stored securely and read from file at runtime, never embedded in cron job payloads or logged.

Design Philosophy

Smart home automation fails when it requires human attention. If you have to open an app to check if the pool pump is running, the automation is not working. OpenClaw's approach is fully autonomous with exception-based alerting, everything runs silently until something needs human attention.

The energy management is particularly important: most households waste 15-30% of their electricity bill on devices running at the wrong time. By concentrating loads into the free window and preventing AC over-cooling, the system pays for itself in reduced energy costs.

References