Call a service (control a device)
ha_call_serviceCall a Home Assistant service in a given domain to control devices, run scripts, trigger automations, or change entity states via the REST API.
Instructions
Control Home Assistant: run a service in a domain. POST /api/services/{domain}/{service}. Args: domain (e.g. "light"), service (e.g. "turn_on"), data (service payload — usually {"entity_id": "..."}); extra keys go in data, e.g. {"entity_id":"light.study","brightness_pct":40}. Common: light.turn_on/turn_off/toggle, switch.toggle, cover.open_cover/close_cover/set_cover_position, climate.set_temperature/set_hvac_mode, media_player.media_play_pause/volume_set, fan.turn_on, lock.lock/unlock, vacuum.start, script.turn_on, automation.trigger, scene.turn_on, notify.send_message, homeassistant.turn_off (whole domain or entity). Returns: the states that changed while the service ran, plus the service response when the service supports it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Service data, usually including "entity_id" | |
| domain | Yes | Service domain, e.g. "light" | |
| service | Yes | Service name, e.g. "turn_on" | |
| returnResponse | No | Ask the service to return response data, if it supports it |