Skip to main content
Glama
Home Assistant MCP Server

Home Assistant MCP Server

Official

Set Entity

ha_set_entity
DestructiveIdempotent

Modify Home Assistant entity registry metadata—area, name, icon, device class, labels, aliases, voice exposure, enabled state, or entity ID—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(entity_id="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.

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_set_entity"
  }
}

Input 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

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 flag this as a destructive, idempotent write, but the description adds substantial behavior beyond that: renaming does not propagate to automations, scripts, templates, or dashboards; history is preserved (HA 2022.4+) but entities without unique IDs or disabled by their integration cannot be renamed; enabled=False removes the entity from the state machine and requires a reload; device_class changes apply instantly; options are sent as separate per-domain registry updates. These are non-obvious operational consequences an agent could not infer from the annotations or schema.

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?

Headers (BULK OPERATIONS, ENTITY ID RENAME, ENABLED/DISABLED WARNING, EXAMPLES) make it skimmable and the critical rename warning is front-loaded in caps. Some content is redundant, especially the Claude Desktop timeout workaround paragraph, which is client-specific operational advice that inflates length without helping tool selection or invocation.

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?

With 17 parameters, destructive semantics, and a rename capability, the description covers the risky paths thoroughly: bulk restrictions, rename caveats, the enabled/disabled trap, and correct alternatives for automations and scripts. An output schema exists, so return-value explanation is correctly omitted.

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 genuine cross-parameter semantics the schema does not express: which parameters are invalid in bulk mode, the fact that new_device_name combines with new_entity_id in one call, the note that use_device_name is not combinable with name, and the mapping of device_class to the UI's 'Show As'. It stops short of fully systematizing these constraints, so it is not a 5.

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 enumerates the modifiable fields, including area, name, icon, device class, options, enabled state, aliases, labels, exposure, and entity_id rename. This clearly separates it from ha_set_device, ha_get_entity, and ha_remove_entity, which operate on different resources.

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 routes the agent elsewhere when needed: use ha_search()/ha_get_device() to find entity IDs, ha_config_get_label() for label IDs, and ha_config_set_automation(entity_id=..., enabled=False) instead of enabled=False on automations. It also draws the bulk-vs-single boundary (only labels, expose_to, categories work on lists) and notes ha_set_device(name='') for clearing a device name, so the agent knows both when to use and when not to use this tool.

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