Remove device from config entry
devices_remove_deviceRemoves a stale device from Home Assistant only after confirming it belongs to the given config entry, so outdated devices can be cleaned up without affecting other integrations.
Instructions
Remove a device from Home Assistant after checking it belongs to the given config entry.
Reads the device registry and refuses unless the device belongs to
config_entry_id, then sends WS config/device_registry/remove
(HA 2026.x); on an HA without that command it sends the older
config/device_registry/remove_config_entry. The integration must
support device removal (HA asks it first), otherwise HA refuses.
Use when: removing a stale device an integration no longer provides.
Not for: renaming, moving or disabling it — use devices_update_device.
Returns: {"removed": true, "device_id", "config_entry_id", "command"}.
Errors: device_not_found, config_entry_not_in_device (no removal
sent), ws_error with Home Assistant's code/message (e.g. the
integration rejected the removal).
Limits: config_entry_id is required as a safety check even though
HA 2026.x removes the device as a whole.
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": {
"device_id": "<device_id>",
"config_entry_id": "<config_entry_id>"
},
"name": "devices_remove_device"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes | Device registry ID to remove; obtain it from devices_list_devices. | |
| config_entry_id | Yes | Config entry ID the device is attached to; the device is detached only from this entry. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||