# Home Assistant Configuration for OpenClaw Integration # Add these sections to your configuration.yaml # ─── Shell Command Integration ──────────────────────────────────────────────── # This allows HA to call OpenClaw via shell commands shell_command: # Send a message to OpenClaw and get response openclaw_chat: '/Users/aodhan/gitea/homeai/homeai-agent/skills/home-assistant/openclaw-bridge.sh "{{ message }}"' # ─── REST Command (Alternative) ─────────────────────────────────────────────── # If OpenClaw exposes an HTTP API in the future rest_command: openclaw_chat: url: "http://localhost:8080/api/agent/message" method: POST headers: Authorization: "Bearer {{ token }}" content_type: "application/json" payload: '{"message": "{{ message }}", "agent": "main"}' # ─── Command Line Sensor ────────────────────────────────────────────────────── # Execute OpenClaw and return the response as a sensor command_line: - sensor: name: "OpenClaw Response" unique_id: openclaw_response command: "/Users/aodhan/gitea/homeai/homeai-agent/skills/home-assistant/openclaw-bridge.sh '{{ states(\"input_text.openclaw_query\") }}'" value_template: "{{ value_json.response }}" scan_interval: 86400 # Only update when triggered # ─── Input Text for Query ───────────────────────────────────────────────────── input_text: openclaw_query: name: OpenClaw Query initial: "" max: 255 # ─── Conversation Agent Integration ──────────────────────────────────────────── # Custom conversation agent using OpenClaw # This requires the custom conversation agent below # ─── Intent Script ───────────────────────────────────────────────────────────── intent_script: # Handle conversation intents OpenClawConversation: speech: text: "{{ response }}" action: - service: shell_command.openclaw_chat data: message: "{{ text }}" response_variable: openclaw_result - set: response: "{{ openclaw_result }}" # ─── Automation: Voice Pipeline with OpenClaw ───────────────────────────────── automation: - alias: "Voice Command via OpenClaw" trigger: - platform: conversation command: - "ask jarvis *" action: - service: shell_command.openclaw_chat data: message: "{{ trigger.slots.command }}" response_variable: openclaw_response - service: tts.speak data: media_player_entity_id: media_player.living_room_speaker message: "{{ openclaw_response }}" # ─── Wyoming Protocol Configuration ─────────────────────────────────────────── # Configure in HA UI: # 1. Settings → Integrations → Add Integration → Wyoming Protocol # 2. Add STT: host=10.0.0.199, port=10300 # 3. Add TTS: host=10.0.0.199, port=10301 # 4. Add Satellite: host=10.0.0.199, port=10700 # ─── Voice Assistant Pipeline ───────────────────────────────────────────────── # Configure in HA UI: # 1. Settings → Voice Assistants → Add Pipeline # 2. Name: "HomeAI with OpenClaw" # 3. Speech-to-Text: Wyoming (localhost:10300) # 4. Conversation Agent: Use the automation above OR Home Assistant # 5. Text-to-Speech: Wyoming (localhost:10301) # ─── Custom Conversation Agent (Advanced) ───────────────────────────────────── # Create a custom component in custom_components/openclaw_conversation/ # See: custom_components/openclaw_conversation/__init__.py