Call Service
ha_call_serviceExecute Home Assistant services to control entities and trigger automations. Specify domain, service, and entity ID for targeted actions.
Instructions
Execute Home Assistant services to control entities and trigger automations.
This is the universal tool for controlling all Home Assistant entities. Services follow the pattern domain.service (e.g., light.turn_on, climate.set_temperature).
Basic Usage:
# Turn on a light
ha_call_service("light", "turn_on", entity_id="light.living_room")
# Set temperature with parameters
ha_call_service("climate", "set_temperature",
entity_id="climate.thermostat", data={"temperature": 22})
# Trigger automation
ha_call_service("automation", "trigger", entity_id="automation.morning_routine")
# Universal controls work with any entity
ha_call_service("homeassistant", "toggle", entity_id="switch.porch_light")Key behavior:
wait (default True): wait for the entity state to change before returning. Only applies to state-changing services on a single entity.
Result compaction (default ON):
resultis trimmed to the targeted entity's record (drops parent-group propagation) and stripped ofcontext/last_*metadata and heavy attribute lists (effect_list,hue_scenes). Escape hatches:verbose=Truefor the raw HA response, orresult_fields/result_attribute_keysfor explicit per-record projection (mirrorsha_get_state).
For detailed service documentation, use ha_get_skill_guide.
Common patterns: Use ha_get_state() to check current values before making changes. Use ha_search() to find correct entity IDs.
WebSocket command escape hatch (advanced):
A few Home Assistant operations are WebSocket-only commands, not
registered services — most notably dismissing a Repairs issue. Pass
ws_command (instead of domain/service) to send one, with its
parameters in data:
# Dismiss a repair (get domain/issue_id from ha_get_overview repairs
# or ha_get_system_health include="repairs")
ha_call_service(ws_command="repairs/ignore_issue",
data={"domain": "sun", "issue_id": "abc", "ignore": True})Only one-shot request/response commands are supported; streaming/two-phase and service-invoking commands are rejected, and the other service parameters (entity_id, return_response, etc.) don't apply.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| wait | No | ||
| domain | No | ||
| service | No | ||
| verbose | No | Return HA's raw service response unchanged (default: False). Use as an escape hatch when you need the full propagation chain or raw attribute payload (debug / inspection). WARNING: brings back token-bloat for nested-group targets — prefer result_fields / result_attribute_keys for targeted control. | |
| entity_id | No | ||
| ws_command | No | Advanced escape hatch: send a raw one-shot Home Assistant WebSocket command that is NOT a registered service (e.g. 'repairs/ignore_issue' to dismiss a Repairs issue). When set, omit domain/service and the other service params; put the command's parameters in data. Streaming/two-phase and service-invoking commands (call_service, execute_script) are rejected. | |
| result_fields | No | Project each record in 'result' to only these top-level keys (e.g. ['entity_id', 'state']). Mirrors ha_get_state's fields=. Setting this DISABLES default compaction — no entity-id filter, no metadata strip — and applies the explicit projection instead. | |
| return_response | No | ||
| result_attribute_keys | No | Project each record's 'attributes' dict to only these keys (e.g. ['brightness', 'rgb_color']). Mirrors ha_get_state's attribute_keys=. Setting this DISABLES default compaction. Requires 'attributes' to be present in result_fields (or result_fields=None). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||