Skip to main content
Glama
homeassistant-ai

Home Assistant MCP Server

Official

Set Entity

ha_set_entity
DestructiveIdempotent

Update Home Assistant entity registry properties—area, name, icon, device class, labels, visibility, voice exposure, or entity/device names—in one call.

Instructions

Update entity properties in the entity registry.

Allows modifying entity metadata such as area assignment, display name, icon, "Show As" device class override, per-domain registry options, enabled/disabled state, visibility, aliases, labels, voice assistant exposure, and entity_id rename in a single call.

BULK OPERATIONS: When entity_id is a list, only labels, expose_to, and categories parameters are supported. Other parameters (area_id, name, use_device_name, icon, device_class, options, enabled, hidden, aliases, use_entity_name_alias, new_entity_id, new_device_name) require single entity.

SHOW AS / DEVICE CLASS: a device_class change applies instantly, no reload needed.

REGISTRY OPTIONS: multi-domain options are sent as separate registry updates because HA's WS schema requires options_domain + options to be paired one domain at a time.

ENTITY ID RENAME: Voice exposure settings are preserved automatically.

WARNING: Renaming an entity_id does NOT update references in automations, scripts, templates, or dashboards. All consumers of the old entity_id must be updated manually — HA does not propagate the rename automatically.

Rename limitations:

  • Entity history is preserved (HA 2022.4+)

  • Entities without unique IDs cannot be renamed

  • Entities disabled by their integration cannot be renamed

DEVICE RENAME: new_device_name can be combined with new_entity_id to rename both in one call. The device is looked up automatically.

Use ha_search() or ha_get_device() to find entity IDs. Use ha_config_get_label() to find available label IDs.

EXAMPLES:

  • Assign to area: ha_set_entity("sensor.temp", area_id="living_room")

  • Set Show As: ha_set_entity("binary_sensor.zone_10", device_class="window")

  • Set sensor precision: ha_set_entity("sensor.power", options={"sensor": {"display_precision": 2}})

  • Rename entity and device: ha_set_entity("light.old", new_entity_id="light.new", new_device_name="New Lamp")

  • Add labels to multiple: ha_set_entity(["light.a", "light.b"], labels=["new"], label_operation="add")

  • Expose to Alexa: ha_set_entity("light.lamp", expose_to={"cloud.alexa": True})

ENABLED/DISABLED WARNING: A disabled entity will NOT appear in state queries, dashboards, or automations until re-enabled AND the integration is reloaded. This is NOT the same as "turning off" an entity.

For automations and scripts, enabled=False is blocked. For automations, use ha_config_set_automation(identifier="automation.xxx", enabled=False) (or enabled=True to re-enable). For scripts, ha_config_set_script(script_id="script.xxx", run="stop") only stops a currently running execution; it does not disable the script. Home Assistant has no script runtime enable/disable service.

If a Claude Desktop user gets a 4-minute timeout with no result on this call, read the target back before repeating it, and tell them to wait a few seconds before clicking the manual-approve button, as clicking it too quickly is known to cause hangs in Claude Desktop. This workaround is specific to Claude Desktop.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iconNoIcon for the entity (e.g., 'mdi:thermometer'). Use empty string '' to remove custom icon. A whitespace-only value acts like '', for clients that cannot send an empty string.
nameNoDisplay name for the entity. Use empty string '' to remove custom name and revert to default. A whitespace-only value acts like '', for clients that cannot send an empty string.
hiddenNoTrue to hide the entity from UI, False to show it.
labelsNoList of label IDs for the entity. Behavior depends on label_operation parameter. Use [] with label_operation='set' to clear.
aliasesNoList of voice assistant aliases for the entity (replaces existing aliases). A null entry is the entity's own name (HA's 'use entity name' switch); it is kept automatically unless your list already contains null. To turn that switch off or on, use use_entity_name_alias.
area_idNoArea/room ID to assign the entity to. Use empty string '' to unassign from current area. A whitespace-only value acts like '', for clients that cannot send an empty string.
enabledNoTrue to enable the entity, False to disable it. WARNING: Setting enabled=False is a registry-level disable — it completely removes the entity from the state machine and hides it from the UI. A reload or restart is required to restore it after re-enabling.
optionsNoPer-domain entity registry options (e.g. sensor 'display_precision', weather 'forecast_type'). Pass a dict mapping domain to a sub-dict, e.g. {"sensor": {"display_precision": 2}}. Multiple domains are sent as separate registry updates. For 'Show As' use device_class; for voice-assistant exposure use expose_to, not options.<assistant>.should_expose.
entity_idYesEntity ID or list of entity IDs to update.
expose_toNoControl voice assistant exposure. Pass a dict mapping assistant IDs to booleans. Valid assistants: 'conversation' (Assist), 'cloud.alexa', 'cloud.google_assistant'. Example: {"conversation": true, "cloud.alexa": false}.
categoriesNoCategory assignment as a dict mapping scope to category_id. Example: {"automation": "category_id_here"}. Use null value to clear: {"automation": null}.
device_classNoOverride the entity's display device class — what the HA UI's 'Show As' dropdown writes. Use empty string '' to clear the override and fall back to the integration default. Examples: 'window', 'door', 'motion' for binary_sensor; 'temperature', 'humidity' for sensor. A whitespace-only value acts like '', for clients that cannot send an empty string.
new_entity_idNoNew entity ID to rename to (e.g., 'light.new_name'). Domain must match the original.
label_operationNoHow to apply labels: 'set' replaces all labels, 'add' adds to existing, 'remove' removes specified labels.set
new_device_nameNoNew display name for the associated device. If provided, both entity and device are updated in one operation. Empty or whitespace-only never changes the device name: it is reported under warnings when other fields are given and is an error when it is the only update. To clear the device name use ha_set_device(name='').
use_device_nameNoHA 2026.10's 'Use device name' switch. True names the entity after its device and follows device renames; False restores the integration's default name. Omit to leave it as is; not combinable with name.
use_entity_name_aliasNoHA's 'use entity name' voice-alias switch. True keeps the entity's own name answering in Assist, False turns it off so only the aliases match. Omit to leave it as is. Works with or without aliases.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv8.7.0
    • changedInput schema / properties / area_id / description
      Previous value: -"Area/room ID to assign the entity to. Use empty string '' to unassign from current area."New value: +"Area/room ID to assign the entity to. Use empty string '' to unassign from current area. A whitespace-only value acts like '', for clients that cannot send an empty string."
    • changedInput schema / properties / device_class / description
      Previous value: -"Override the entity's display device class — what the HA UI's 'Show As' dropdown writes. Use empty string '' to clear the override and fall back to the integration default. Examples: 'window', 'door', 'motion' for binary_sensor; 'temperature', 'humidity' for sensor."New value: +"Override the entity's display device class — what the HA UI's 'Show As' dropdown writes. Use empty string '' to clear the override and fall back to the integration default. Examples: 'window', 'door', 'motion' for binary_sensor; 'temperature', 'humidity' for sensor. A whitespace-only value acts like '', for clients that cannot send an empty string."
    • changedInput schema / properties / icon / description
      Previous value: -"Icon for the entity (e.g., 'mdi:thermometer'). Use empty string '' to remove custom icon."New value: +"Icon for the entity (e.g., 'mdi:thermometer'). Use empty string '' to remove custom icon. A whitespace-only value acts like '', for clients that cannot send an empty string."
    • changedInput schema / properties / name / description
      Previous value: -"Display name for the entity. Use empty string '' to remove custom name and revert to default."New value: +"Display name for the entity. Use empty string '' to remove custom name and revert to default. A whitespace-only value acts like '', for clients that cannot send an empty string."
    • changedInput schema / properties / new_device_name / description
      Previous value: -"New display name for the associated device. If provided, both entity and device are updated in one operation."New value: +"New display name for the associated device. If provided, both entity and device are updated in one operation. Empty or whitespace-only never changes the device name: it is reported under warnings when other fields are given and is an error when it is the only update. To clear the device name use ha_set_device(name='')."
    • addedInput schema / properties / use_device_name
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "HA 2026.10's 'Use device name' switch. True names the entity after its device and follows device renames; False restores the integration's default name. Omit to leave it as is; not combinable with name."
      +}
  2. Changed16 schema fields changedv8.6.0
    • changedInput schema / properties / aliases / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / aliases / description
      Previous value: -"List of voice assistant aliases for the entity (replaces existing aliases). Single entity only."New value: +"List of voice assistant aliases for the entity (replaces existing aliases). A null entry is the entity's own name (HA's 'use entity name' switch); it is kept automatically unless your list already contains null. To turn that switch off or on, use use_entity_name_alias."
    • changedInput schema / properties / area_id / description
      Previous value: -"Area/room ID to assign the entity to. Use empty string '' to unassign from current area. Single entity only."New value: +"Area/room ID to assign the entity to. Use empty string '' to unassign from current area."
    • changedInput schema / properties / categories / description
      Previous value: -"Category assignment as a dict mapping scope to category_id. Example: {\"automation\": \"category_id_here\"}. Use null value to clear: {\"automation\": null}. Single entity only."New value: +"Category assignment as a dict mapping scope to category_id. Example: {\"automation\": \"category_id_here\"}. Use null value to clear: {\"automation\": null}."
    • changedInput schema / properties / device_class / description
      Previous value: -"Override the entity's display device class — what the HA UI's 'Show As' dropdown writes. Use empty string '' to clear the override and fall back to the integration default. None (the default) means 'no change' — pass an explicit '' to clear. Single entity only. Examples: 'window', 'door', 'motion' for binary_sensor; 'temperature', 'humidity' for sensor."New value: +"Override the entity's display device class — what the HA UI's 'Show As' dropdown writes. Use empty string '' to clear the override and fall back to the integration default. Examples: 'window', 'door', 'motion' for binary_sensor; 'temperature', 'humidity' for sensor."
    • changedInput schema / properties / enabled / description
      Previous value: -"True to enable the entity, False to disable it. Single entity only. WARNING: Setting enabled=False is a registry-level disable — it completely removes the entity from the state machine and hides it from the UI. A reload or restart is required to restore it after re-enabling. NOT allowed for automation or script entities — use automation.turn_off / script.turn_off via ha_call_service() instead."New value: +"True to enable the entity, False to disable it. WARNING: Setting enabled=False is a registry-level disable — it completely removes the entity from the state machine and hides it from the UI. A reload or restart is required to restore it after re-enabling."
    • changedInput schema / properties / entity_id / description
      Previous value: -"Entity ID or list of entity IDs to update. Bulk operations (list) only support labels, expose_to, and categories parameters."New value: +"Entity ID or list of entity IDs to update."
    • changedInput schema / properties / expose_to / description
      Previous value: -"Control voice assistant exposure. Pass a dict mapping assistant IDs to booleans. Valid assistants: 'conversation' (Assist), 'cloud.alexa', 'cloud.google_assistant'. Example: {\"conversation\": true, \"cloud.alexa\": false}. Supports bulk operations."New value: +"Control voice assistant exposure. Pass a dict mapping assistant IDs to booleans. Valid assistants: 'conversation' (Assist), 'cloud.alexa', 'cloud.google_assistant'. Example: {\"conversation\": true, \"cloud.alexa\": false}."
    • changedInput schema / properties / hidden / description
      Previous value: -"True to hide the entity from UI, False to show it. Single entity only."New value: +"True to hide the entity from UI, False to show it."
    • changedInput schema / properties / icon / description
      Previous value: -"Icon for the entity (e.g., 'mdi:thermometer'). Use empty string '' to remove custom icon. Single entity only."New value: +"Icon for the entity (e.g., 'mdi:thermometer'). Use empty string '' to remove custom icon."
    • changedInput schema / properties / labels / description
      Previous value: -"List of label IDs for the entity. Behavior depends on label_operation parameter. Supports bulk operations."New value: +"List of label IDs for the entity. Behavior depends on label_operation parameter. Use [] with label_operation='set' to clear."
    • changedInput schema / properties / name / description
      Previous value: -"Display name for the entity. Use empty string '' to remove custom name and revert to default. Single entity only."New value: +"Display name for the entity. Use empty string '' to remove custom name and revert to default."
    • changedInput schema / properties / new_device_name / description
      Previous value: -"New display name for the associated device. If provided, both entity and device are updated in one operation. Single entity only."New value: +"New display name for the associated device. If provided, both entity and device are updated in one operation."
    • changedInput schema / properties / new_entity_id / description
      Previous value: -"New entity ID to rename to (e.g., 'light.new_name'). Domain must match the original. Single entity only."New value: +"New entity ID to rename to (e.g., 'light.new_name'). Domain must match the original."
    • changedInput schema / properties / options / description
      Previous value: -"Per-domain entity registry options (e.g. sensor 'display_precision', weather 'forecast_type'). Pass a dict mapping domain to a sub-dict, e.g. {\"sensor\": {\"display_precision\": 2}}. Multiple domains are sent as separate registry updates. For 'Show As' use the dedicated `device_class` parameter — that is what the HA UI Show As dropdown writes. Voice-assistant exposure is stored under `options.<assistant>.should_expose` but must be managed via the dedicated `expose_to` parameter, not this options dict. Single entity only."New value: +"Per-domain entity registry options (e.g. sensor 'display_precision', weather 'forecast_type'). Pass a dict mapping domain to a sub-dict, e.g. {\"sensor\": {\"display_precision\": 2}}. Multiple domains are sent as separate registry updates. For 'Show As' use device_class; for voice-assistant exposure use expose_to, not options.<assistant>.should_expose."
    • addedInput schema / properties / use_entity_name_alias
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "HA's 'use entity name' voice-alias switch. True keeps the entity's own name answering in Assist, False turns it off so only the aliases match. Omit to leave it as is. Works with or without aliases."
      +}
  3. First observedv7.14.2

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and idempotentHint=true, and the description adds substantial non-obvious behavior: renames do not propagate to automations/scripts/templates/dashboards, three distinct rename limitations, that disabled entities vanish from state queries until integration reload, and that enabled=False is blocked for automations/scripts. These are exactly the side effects an agent needs before a destructive mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is long, but the length is justified by 17 parameters and multiple destructive edge cases, and it is cleanly front-loaded with the core purpose followed by headed sections. The Claude Desktop timeout workaround is somewhat tangential and could be trimmed, but nothing else is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity and the presence of an output schema (so return values need not be described), the description covers everything an agent needs: bulk constraints, rename semantics, dependency implications, disable semantics, and tool alternatives. Nothing material is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real value beyond the schema by documenting cross-parameter constraints not expressible in the schema (bulk mode supports only labels/expose_to/categories; options domains are paired one at a time; use_device_name is not combinable with name). The worked examples further clarify how parameters combine.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Update entity properties in the entity registry') and then enumerates the full set of modifiable fields, so the agent knows exactly what this tool covers. It is clearly differentiated from siblings by routing related operations to ha_set_device, ha_config_set_automation, and ha_config_set_script.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use it and when not to: the BULK OPERATIONS section lists which parameters are valid when entity_id is a list, the ENABLED/DISABLED section names the alternative tools for automations and scripts, and it points to ha_search/ha_get_device and ha_config_get_label for lookups. This is about as complete as routing guidance gets.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools