Get Entity State
ha_get_stateRetrieve the current state and attributes of one or more Home Assistant entities, including bulk lookups, to check device status or inspect entity details.
Instructions
Get current status, state, and attributes of one or more entities (lights, switches, sensors, climate, covers, locks, fans, etc.).
Pass a string entity_id for one entity, or a list (max 100, duplicates deduplicated) for several, fetched in parallel. A bulk call returns success=True if at least one state was retrieved; check 'error_count' for failed lookups.
fields= projects the per-entity record keys, NOT the outer bulk
response wrapper: in single-entity mode it filters the returned record;
in bulk mode it filters each record inside states[entity_id] while
outer keys (success, count, states, errors, ...) are always
preserved. attribute_keys= further narrows the attributes sub-dict
and is only applied when "attributes" is in fields= (or
fields=None); otherwise it is a no-op and a warnings list is emitted
at the top level of the result (sibling of data/metadata), outside
the projected record(s), so fields=["state"] still returns a record
with only state.
EXAMPLES:
Single: ha_get_state("light.kitchen")
Multiple: ha_get_state(["light.kitchen", "light.living_room", "sensor.temperature"])
Slim bulk: ha_get_state(["light.kitchen", "sensor.temperature"], fields=["state", "attributes"], attribute_keys=["brightness"])
get current state value single entity check status bulk multiple states which lights
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"entity_id": "<entity_id>"
},
"name": "ha_get_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Return only the specified top-level entity record keys to reduce response size (e.g. ["state", "attributes"]). None = full entity record. Available keys: entity_id, state, attributes, last_changed, last_reported, last_updated, context. | |
| entity_id | Yes | Entity ID or list of entity IDs to retrieve state for (e.g., 'light.kitchen' or ['light.kitchen', 'sensor.temperature']) | |
| attribute_keys | No | Return only the specified keys from each entity's attributes dict (e.g. ["brightness", "color_temp_kelvin"] for lights). None = full attributes. Unknown keys are silently dropped. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||