Chat in the UI

Open Conversations from the sidebar (if available in your HA version) or use the Assist dialog and select your OpenCode agent as the conversation agent.

Voice assistants

In Settings → Voice assistants, create or edit an assistant and set the Conversation agent to your OpenCode agent (e.g. conversation.deepseek_v4_flash).

Home Assistant control

If you enabled Control Home Assistant during setup, the model can call tools to query and control your devices. Example prompts:

"Turn off all lights in the living room"
"What's the temperature in the bedroom?"
"Lock the front door"

Automations

Use the conversation.process service in automations:

automation:
  - alias: "Morning briefing with OpenCode"
    trigger:
      - platform: time
        at: "07:00:00"
    action:
      - service: conversation.process
        data:
          text: "Good morning! What should I know today?"
          agent_id: conversation.deepseek_v4_flash

Attachments

When using the conversation UI or the Assist dialog, you can attach images and PDFs. They are base64-encoded and sent to the model.

AI tasks

AI tasks generate structured data on demand using the ai_task.generate_data service. The task name is passed to the model so it knows what to produce. Example:

action:
  - service: ai_task.generate_data
    data:
      task_name: "Generate a summary"
      entity_id: ai_task.deepseek_v4_flash
      instructions: "Summarize today's events."

Pass a structure to get a JSON response conforming to a schema (e.g. fields with selectors) instead of plain text. You can also attach files:

action:
  - service: ai_task.generate_data
    data:
      task_name: "Extract characters"
      entity_id: ai_task.deepseek_v4_flash
      instructions: "Extract the named characters from the image."
      attachments:
        - media_content_id: media-source://media/doorbell_snapshot.jpg

Example: switch models per automation

action:
  - service: conversation.process
    data:
      agent_id: conversation.glm_5
      text: "Summarize my calendar for today"