Call any Home Assistant action
services_call_serviceCall any Home Assistant service by domain and name over HTTP when no dedicated tool exists. Pass data for fields and targets; returns changed states.
Instructions
Call any Home Assistant action by domain and service name over HTTP.
Posts to /api/services/<domain>/<service> with data as the JSON
body; data holds both fields and targets (entity_id/area_id/
device_id). Effect depends entirely on the domain/service passed.
domain/service must match [A-Za-z0-9_]+ (ADR-0006 D3) or the call
is refused before any request is built. Refuses hassio.addon_stop/
app_stop/addon_stdin/app_stdin against nexus's own add-on
(self_protection.is_own_addon); addon_restart/app_restart stay
allowed. homeassistant.restart/stop, hassio.host_reboot/
host_shutdown/restore_full/restore_partial, update.install and
group.remove additionally require confirm=True (ADR-0006 D2) — a
human-in-the-loop checkpoint, not a security boundary; ignored for
every other service.
Use when: no dedicated tool exists for the action needed.
Not for: an action returning response data (e.g.
weather.get_forecasts) — use ws_call_service, which refuses the
same eight guarded services outright (ADR-0006 D5) instead of
accepting confirm.
Returns: the list of states changed during the call.
Errors: {"error": "invalid_service_name"} for a malformed
domain/service; {"error": "self_addon_hassio_service_blocked", "message": ...} for the blocked hassio.* cases; {"error": "confirmation_required", "message": ..., "action": ...} for a guarded
service called without confirm=True.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Service data: fields plus targets (entity_id/area_id/device_id). Omit for a call that needs no data. | |
| domain | Yes | Service domain to call, e.g. 'light' or 'climate'. | |
| confirm | No | Required True to actually run one of eight guarded services: homeassistant.restart/stop, hassio.host_reboot/host_shutdown/restore_full/restore_partial, update.install, group.remove. False (default) performs no action for those instead and returns a confirmation prompt; ignored for every other service. | |
| service | Yes | Service name within the domain, e.g. 'turn_on' or 'set_temperature'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |