Home Assistant
v0.1.4Read your Home Assistant's states, areas and history, and run its actions, approving locks first.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
call_action Run an action
Run a Home Assistant action (formerly a service call): light.turn_on, climate.set_temperature, media_player.volume_set, script.turn_on. Answers once it has run, with the states that changed. An action in a domain the user approves call by call (lock, alarm_control_panel, cover, valve unless configured otherwise), aimed at an entity of one, or a homeassistant action aimed wider than named entities, is refused here with needs_confirmation: use call_action_confirmed. An action Home Assistant runs only for administrators (every reload, homeassistant.restart and the like) is refused with needs_admi…
| Parameter | Type | Description |
|---|---|---|
domain * | string | The action's domain: light, switch, climate, lock, script, homeassistant, ... |
service * | string | The action within the domain: turn_on, set_temperature, unlock, ... (list_actions lists them). |
data | object | The action's fields, as list_actions shows them: {"brightness_pct": 40}, {"temperature": 21.5}. Not the target. |
return_response | boolean | Ask for the data the action answers with (a weather forecast, a calendar's events); only for actions list_actions marks with response. |
target | object | What the action acts on. Several kinds may be combined; an action that takes no target (homeassistant.reload_all, a script) leaves it out. |
call_action_confirmed Run an action, with the user's approval
The same as call_action, for any action, and the user approves every call before it runs: the way to lock or unlock a door, arm or disarm an alarm, open or close a cover or a valve. Only when the user asked for that action. Acts outside the computer: the client asks the user to approve each call.
| Parameter | Type | Description |
|---|---|---|
domain * | string | The action's domain: light, switch, climate, lock, script, homeassistant, ... |
service * | string | The action within the domain: turn_on, set_temperature, unlock, ... (list_actions lists them). |
data | object | The action's fields, as list_actions shows them: {"brightness_pct": 40}, {"temperature": 21.5}. Not the target. |
return_response | boolean | Ask for the data the action answers with (a weather forecast, a calendar's events); only for actions list_actions marks with response. |
target | object | What the action acts on. Several kinds may be combined; an action that takes no target (homeassistant.reload_all, a script) leaves it out. |
get_states Get states
The current state of one or more entities, with their attributes (a light's brightness, a thermostat's target, a sensor's unit) and when the state last changed. An id Home Assistant does not know is listed under not_found; when none is known, the call fails with suggestions.
| Parameter | Type | Description |
|---|---|---|
entity_ids * | array | The entity ids, like light.kitchen (list_entities finds them). |
attributes | boolean | Include each entity's attributes. |
health Health
Whether this server works with its Home Assistant: the version, whether it is RUNNING, its time zone (history and logbook times carry an offset), whether the WebSocket API signs in too, whose token it holds and whether that user is an administrator (if not, the tools that need one are listed), and how many entities each domain has. ok: false comes with the problem. A Home Assistant that does not answer at all (switched off, restarting, no route from here) is not a failure: it is reported as reachable: false, with what the network said. Call it first, and whenever a call fails with unreachable…
history State history
How entities' states changed over a window, from the recorder: for each entity its changes oldest first (the first is the state when the window opened), the newest limit of them. Default the last 24 hours; at most 31 days, and only as far back as the recorder keeps (10 days unless configured otherwise).
| Parameter | Type | Description |
|---|---|---|
entity_ids * | array | The entities, like sensor.living_room_temperature. |
attributes | boolean | Include each change's attributes too (much larger). |
end | string | Where it ends; default now, with its offset: 2026-03-01T18:00:00+02:00 or 2026-03-01T16:00:00Z. health gives the instance's time zone. |
hours | integer | Instead of start: this many hours before end (default 24). |
limit | integer | At most this many changes per entity, the newest (1-1000). |
start | string | Where the window starts; default the last `hours` before end, with its offset: 2026-03-01T18:00:00+02:00 or 2026-03-01T16:00:00Z. health gives the instance's time zone. |
list_actions List actions
The actions (formerly services) Home Assistant offers. Without a domain, every domain with its action names; with one, each action's description, whether it takes a target, whether it answers with data, and its fields (type, options, an example). Domains whose actions the user approves call by call (lock, alarm_control_panel, cover, valve unless configured otherwise) are marked confirm, and actions only an administrator's token may run are marked needs_admin when this token's user is not one.
| Parameter | Type | Description |
|---|---|---|
domain | string | Only this domain's actions, with their fields. |
list_areas List areas
Every area (or one), with its floor, its devices and the entities in it: an entity's own area, else its device's, as Home Assistant's area pages show them. Disabled devices and entities are left out. Also counts what has no area. Its ids are what call_action takes as area_id and device_id.
| Parameter | Type | Description |
|---|---|---|
area | string | Only this area, by its name or id. |
entities | boolean | List each area's entity ids, not only how many there are. |
list_entities List entities
Find entities: one row each with entity_id, name, state, unit and area, in entity id order. Filter by domain (light, sensor, climate, ...), by area (its name or id), and by words that must all appear in the id, the name or the area. Use it to find the entity_id other tools take; get_states reads an entity's attributes.
| Parameter | Type | Description |
|---|---|---|
area | string | Only entities in this area, by its name or id (list_areas lists them). |
domain | string | Only entities of this domain, like light or sensor. |
limit | integer | At most this many rows (1-1000). |
search | string | Words that must all appear in the entity id, its name or its area, ignoring case. |
logbook Logbook
What happened over a window, as Home Assistant's logbook tells it: states that changed, automations and scripts that ran, and what caused each (a user, an action, an automation) where it knows. Oldest first, the newest limit of them. Optionally for one entity.
| Parameter | Type | Description |
|---|---|---|
end | string | Where it ends; default now, with its offset: 2026-03-01T18:00:00+02:00 or 2026-03-01T16:00:00Z. health gives the instance's time zone. |
entity_id | string | Only this entity's entries. |
hours | integer | Instead of start: this many hours before end (default 24). |
limit | integer | At most this many entries, the newest (1-1000). |
start | string | Where the window starts; default the last `hours` before end, with its offset: 2026-03-01T18:00:00+02:00 or 2026-03-01T16:00:00Z. health gives the instance's time zone. |
render_template Render a template
Render a Home Assistant template (Jinja) with its own states and helpers, for what no other tool answers in one call: "{{ states.light | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}", "{{ area_entities('kitchen') }}", "{{ now() }}". Rendering changes nothing. Home Assistant renders templates only for administrators: with another user's token this answers needs_admin without asking Home Assistant (health says which it is).
| Parameter | Type | Description |
|---|---|---|
template * | string | The template text. |
variables | object | Variables the template can use by name. |