Files
Tetra-AI-HA-Integration/custom_components/openclaw/services.yaml
T
BMO (OpenClaw) fa0af8da60 feat: add configurable agent ID support
Allow users to configure which OpenClaw agent the integration communicates
with, instead of always defaulting to the implicit 'main' agent.

Changes:
- const.py: add CONF_AGENT_ID, DEFAULT_AGENT_ID='main', ATTR_AGENT_ID
- api.py: accept agent_id in constructor; _headers() now includes the
  x-openclaw-agent-id header on every request; async_send_message and
  async_stream_message accept an optional per-call agent_id override
- config_flow.py: expose agent_id as a text field in both the manual
  setup step and the options flow (Settings → Integrations → Configure)
- __init__.py: read agent_id from options/data and pass it to the API
  client; add optional agent_id field to the send_message service schema
  so automations can address a specific agent per-call
- services.yaml: document the new agent_id field on send_message
- strings.json / translations/en.json: add UI labels for the new option

The gateway routing header x-openclaw-agent-id is always sent; when
agent_id is 'main' (the default) the gateway behaviour is unchanged.
A per-call override on send_message takes precedence over the config.

Implemented with assistance from an AI coding agent (BMO) with human
review. Bot-assisted contribution reviewed by a human before submission.
2026-02-26 13:50:07 -06:00

97 lines
2.5 KiB
YAML

send_message:
name: Send Message
description: Send a text message to OpenClaw and get a response.
fields:
message:
name: Message
description: The message text to send to OpenClaw.
required: true
example: "What's the weather like today?"
selector:
text:
multiline: true
session_id:
name: Session ID
description: Optional conversation session ID. Messages with the same session ID share context.
required: false
example: "my-automation-session"
selector:
text:
attachments:
name: Attachments
description: Optional list of file paths to attach to the message.
required: false
selector:
text:
multiline: true
agent_id:
name: Agent ID
description: >
Optional OpenClaw agent ID to route this message to. Overrides the
agent ID configured in the integration options. Defaults to "main".
required: false
example: "main"
selector:
text:
clear_history:
name: Clear History
description: Clear the conversation history for a session.
fields:
session_id:
name: Session ID
description: Session ID to clear. If omitted, clears the default session.
required: false
selector:
text:
invoke_tool:
name: Invoke Tool
description: Invoke a single OpenClaw Gateway tool via /tools/invoke.
fields:
tool:
name: Tool
description: Tool name to invoke.
required: true
example: "sessions_list"
selector:
text:
action:
name: Action
description: Optional action string passed to the tool endpoint.
required: false
example: "json"
selector:
text:
args:
name: Args
description: Tool-specific args object.
required: false
selector:
object:
session_key:
name: Session Key
description: Optional target OpenClaw session key.
required: false
example: "main"
selector:
text:
dry_run:
name: Dry Run
description: Optional dry-run flag (reserved by gateway).
required: false
selector:
boolean:
message_channel:
name: Message Channel
description: Optional channel hint header (e.g. slack, telegram).
required: false
selector:
text:
account_id:
name: Account ID
description: Optional account hint header for multi-account routing.
required: false
selector:
text: