@orellbuehler/homeassistant-mcp 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -6
- package/dist/server.js +1 -1
- package/dist/tools/registry.js +32 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,15 +120,19 @@ available immediately. Verify with `claude mcp list` (should show `homeassistant
|
|
|
120
120
|
|
|
121
121
|
**Registries** (WebSocket)
|
|
122
122
|
|
|
123
|
-
| Tool | Description
|
|
124
|
-
| ------------------------ |
|
|
125
|
-
| `list_registry_entities` | ALL registered entities, incl. disabled/unavailable (area, device, status).
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
123
|
+
| Tool | Description |
|
|
124
|
+
| ------------------------ | ---------------------------------------------------------------------------------------- |
|
|
125
|
+
| `list_registry_entities` | ALL registered entities, incl. disabled/unavailable (area, device, status). |
|
|
126
|
+
| `rename_entity` | Set an entity's registry `name` and/or `new_entity_id` (config edit, no device control). |
|
|
127
|
+
| `list_devices` | Devices (id, name, manufacturer, model, area). |
|
|
128
|
+
| `list_areas` | Areas (area_id, name, floor). |
|
|
129
|
+
| `list_labels` | Labels (label_id, name, color, icon). |
|
|
129
130
|
|
|
130
131
|
`list_entities` (REST) shows entities that currently have state; `list_registry_entities`
|
|
131
132
|
(WebSocket) shows everything registered, including disabled entities, with area/device grouping.
|
|
133
|
+
`rename_entity` writes the registry via `config/entity_registry/update` (requires an admin token):
|
|
134
|
+
`name` overrides the friendly name (null reverts to the integration's `original_name`) and
|
|
135
|
+
`new_entity_id` renames the entity_id within the same domain.
|
|
132
136
|
|
|
133
137
|
**Energy dashboard** (WebSocket)
|
|
134
138
|
|
package/dist/server.js
CHANGED
|
@@ -9,7 +9,7 @@ import { registerRegistryTools } from "./tools/registry.js";
|
|
|
9
9
|
import { registerEnergyTools } from "./tools/energy.js";
|
|
10
10
|
import { registerTraceTools } from "./tools/trace.js";
|
|
11
11
|
export function createServer(client, wsClient) {
|
|
12
|
-
const server = new McpServer({ name: "homeassistant-mcp", version: "0.
|
|
12
|
+
const server = new McpServer({ name: "homeassistant-mcp", version: "0.4.0" });
|
|
13
13
|
registerEntityTools(server, client);
|
|
14
14
|
registerServiceTools(server, client);
|
|
15
15
|
registerSystemTools(server, client);
|
package/dist/tools/registry.js
CHANGED
|
@@ -31,6 +31,38 @@ export function registerRegistryTools(server, ws) {
|
|
|
31
31
|
return err(e);
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
+
server.tool("rename_entity", "Rename an entity in the entity registry via the WebSocket API (config/entity_registry/update). Set 'name' to override the friendly name (pass null to revert to the integration's original_name) and/or 'new_entity_id' to change the entity_id itself (must keep the same domain). At least one of name or new_entity_id is required. This edits registry config only — it does not control any device. Returns the updated entity_entry.", {
|
|
35
|
+
entity_id: z
|
|
36
|
+
.string()
|
|
37
|
+
.describe("Current entity_id to rename, e.g. 'cover.storen_wohnzimmer_links'"),
|
|
38
|
+
name: z
|
|
39
|
+
.string()
|
|
40
|
+
.nullable()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("New friendly name; null reverts to the integration's original_name"),
|
|
43
|
+
new_entity_id: z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("New entity_id; must keep the same domain, e.g. 'cover.wohnzimmer_links'"),
|
|
47
|
+
}, async ({ entity_id, name, new_entity_id }) => {
|
|
48
|
+
try {
|
|
49
|
+
if (name === undefined && new_entity_id === undefined) {
|
|
50
|
+
throw new Error("Provide at least one of 'name' or 'new_entity_id' to rename the entity");
|
|
51
|
+
}
|
|
52
|
+
if (new_entity_id !== undefined && domainOf(new_entity_id) !== domainOf(entity_id)) {
|
|
53
|
+
throw new Error(`new_entity_id must stay in the '${domainOf(entity_id)}' domain (got '${new_entity_id}')`);
|
|
54
|
+
}
|
|
55
|
+
const payload = { entity_id };
|
|
56
|
+
if (name !== undefined)
|
|
57
|
+
payload.name = name;
|
|
58
|
+
if (new_entity_id !== undefined)
|
|
59
|
+
payload.new_entity_id = new_entity_id;
|
|
60
|
+
return ok(await ws.command("config/entity_registry/update", payload));
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
return err(e);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
34
66
|
server.tool("list_devices", "List devices from the device registry via the WebSocket API (id, name, manufacturer, model, area_id). Useful for grouping entities by physical device when writing automations.", {}, async () => {
|
|
35
67
|
try {
|
|
36
68
|
const list = (await ws.command("config/device_registry/list"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orellbuehler/homeassistant-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Model Context Protocol server for Home Assistant: introspect entities, services, events, registries, render templates and validate configuration to help AI agents author HA configs and automations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|