Entities
The entity registry is where friendly names, entity ids, and visibility live. These services let Claude fix the light.shelly_1pm_9a4c2f mess at scale: rename in bulk, assign sane entity ids, disable noisy diagnostics, hide what dashboards shouldn’t show, and sweep out registry entries whose integration is long gone. Since 2.11 they also change what a device shows as — a contact sensor as a door, a smart plug as a fan or a light, a sensor’s decimals and unit.
change_entity_id does not rewrite automations, scripts, or dashboards that reference the old id. Run find_orphaned_references afterwards to catch anything left pointing at the old name — Claude does this automatically when you ask it to rename things.
Rename entity
brain.rename_entity
Set the friendly name override of one or more entities.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Entities to rename. |
name |
text | yes | The new friendly name. |
service: brain.rename_entitydata: entity_id: - light.shelly_1pm_abc123 name: Kitchen Ceiling🗣️ “Rename light.shelly_1pm_abc123 to ‘Kitchen Ceiling’.”
Change entity ID
brain.change_entity_id
Change an entity’s ID (e.g. light.shelly_abc123 to light.kitchen_ceiling). Automations and dashboards referencing the old ID must be updated separately.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity | yes | The current entity ID. |
new_entity_id |
text | yes | The new entity ID, same domain. |
service: brain.change_entity_iddata: entity_id: light.shelly_1pm_abc123 new_entity_id: light.kitchen_ceiling🗣️ “Give that Shelly a sane entity id: light.kitchen_ceiling.”
Enable entity
brain.enable_entity
Enable one or more disabled entities. Takes effect after the owning integration reloads.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Entities to enable. |
service: brain.enable_entitydata: entity_id: - sensor.zigbee_router_lqi🗣️ “Re-enable the LQI diagnostic sensor.”
Disable entity
brain.disable_entity
Disable one or more entities. They stop updating and are removed from the UI.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Entities to disable. |
service: brain.disable_entitydata: entity_id: - sensor.noisy_diagnostic🗣️ “Disable that diagnostic sensor that spams the recorder.”
Hide entity
brain.hide_entity
Hide one or more entities from auto-generated dashboards and voice assistants. They keep working.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Entities to hide. |
service: brain.hide_entitydata: entity_id: - switch.washing_machine_child_lock🗣️ “Hide the child-lock switch from dashboards but keep it working.”
Unhide entity
brain.unhide_entity
Unhide one or more hidden entities.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Entities to unhide. |
service: brain.unhide_entitydata: entity_id: - switch.washing_machine_child_lock🗣️ “Show the child-lock switch again.”
Set entity aliases
brain.set_entity_aliases
Replace an entity’s voice-assistant aliases — the alternative names Assist listens for.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity | yes | The entity to update. |
aliases |
text (list) | yes | The full new list of aliases. |
service: brain.set_entity_aliasesdata: entity_id: light.office_desk_lamp aliases: ["the beacon", "desk light"]🗣️ “We call the office lamp ‘the beacon’ — make voice understand that.”
Set entity icon
brain.set_entity_icon
Set an icon override on one or more entities. Omit the icon to clear the override and return to the default.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Entities to update. |
icon |
icon | no | The icon to set. Omit to clear the override. |
service: brain.set_entity_icondata: entity_id: - switch.bedroom_fan icon: mdi:ceiling-fan🗣️ “That fan shows as a generic switch — give it a fan icon.”
Delete orphaned entities
brain.delete_orphaned_entities
Remove registry entries for entities whose integration no longer provides them (state shows as ‘restored’). Runs as a dry run by default and returns the list of affected entities as response data. Optionally scoped to specific entities: each one is re-verified as orphaned, and anything still alive is skipped and reported, never deleted.
| Field | Type | Required | Description |
|---|---|---|---|
dry_run |
boolean | no | When on (default), only report what would be removed. |
entity_id |
entity (list) | no | Restrict the cleanup to these entities. Each is re-verified as orphaned; anything still provided by an integration is skipped and reported in skipped_not_orphaned. Omit to target every orphan. |
# Report only — nothing is deletedservice: brain.delete_orphaned_entitiesresponse_variable: orphans
# Delete only the ones you reviewed; live entities are skipped, never deletedservice: brain.delete_orphaned_entitiesdata: dry_run: false entity_id: - sensor.old_hub_battery - sensor.old_hub_signal🗣️ “Are there any dead entities left over from integrations I removed? Clean them up.”
What a device shows as
New in brAIn 2.11. Every entity in Home Assistant has a Show as setting in its own settings dialog; these four services change it, so you can ask in the chat or the terminal — “show the back door sensor as a door”, “show the fan plug as a fan”, “show the outdoor temperature in °F with one decimal” — and an automation can call them too.
| Service | What it changes | Undo |
|---|---|---|
brain.set_device_class |
The Show as type of a binary sensor, cover, switch, valve and a few more | device_class left empty |
brain.show_switch_as |
A switch shown as a light, fan, lock, cover, siren or valve | brain.stop_showing_switch_as |
brain.stop_showing_switch_as |
Removes that helper, so the switch is a switch again | — |
brain.set_sensor_display |
A sensor’s decimal places and, where it converts, its unit | the field set to null |
The rules that hold for all four:
- Admin-only, and checked like any other change. From the chat and the terminal they go through protected entities and the action gate. A voice agent at the Voice assistant level cannot use them, and neither can scheduled cards or any other unattended run.
- Protected holds across a switch and its stand-in. A switch shown as something else counts as protected if either the switch or the entity standing in for it is on your protected list — showing it as another type, or going back, is refused. While you have a protected list, brAIn also refuses when it cannot read which entity stands in for which.
- Checked against your Home Assistant. A type or unit is checked against what your Home Assistant offers, and a wrong one is refused with the list of what it would take.
- A sensor’s or a number’s device class is never changed. It decides the unit and the long-term statistics, and Home Assistant’s own settings do not offer it either. Change its unit or precision with
set_sensor_displayinstead.
A fan cannot become a light — but the plug it runs off can
Only a switch can be shown as another kind of device. A ceiling fan that arrives from an integration as a fan entity cannot be turned into a light, and brAIn says so. If the fan or lamp runs off a smart plug, show the plug’s switch as what you want with brain.show_switch_as — that is Home Assistant’s own Change device type of a switch helper.
Set device class
brain.set_device_class
Change what kind of device an entity is shown as — a binary sensor as a door, window, garage door, motion, moisture or smoke sensor; a cover as a garage door, blind, shutter, curtain or gate; a switch as an outlet. Returns, per entity, the device class now in effect, the override stored, and the integration’s original.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Entities to change: binary_sensor, button, cover, event, humidifier, media_player, switch, update or valve. |
device_class |
text | no | What to show it as, e.g. door, window, moisture, garage, outlet. Leave empty to give back the integration’s own. |
confirm_safety |
boolean | no | Needed to take a smoke, gas, carbon monoxide or leak sensor out of that class. Default off. |
# A contact sensor on the back door, shown as a doorservice: brain.set_device_classdata: entity_id: - binary_sensor.back_door_contact device_class: doorresponse_variable: result
# Back to what the integration reportsservice: brain.set_device_classdata: entity_id: - binary_sensor.back_door_contact🗣️ “The back door sensor shows as ‘opening’ — show it as a door.”
Smoke, gas, carbon monoxide and leak sensors keep their type unless you say yes. brAIn’s safety lane — a critical card sent straight away, through quiet hours — goes by that type, so showing a smoke detector as a door would quietly stop its alerts. brAIn asks you first, and the service refuses the change without confirm_safety: true. Making a sensor one of those types goes through, and the answer says that its alerts now go through quiet hours.
A template binary sensor made in Home Assistant’s UI keeps the type set in its helper. Change it in Settings → Devices & services → Helpers → the helper → Template options. brAIn will not add an override there, because Home Assistant hides that setting for those sensors and an override would mask every later change; it can still clear one that is already there. A template sensor written in YAML takes an override as usual.
Show switch as
brain.show_switch_as
Show a switch — a smart plug running a fan or a lamp — as a light, fan, lock, cover, siren or valve, through Home Assistant’s own Change device type of a switch helper (switch_as_x). The new entity takes the switch’s place in dashboards and voice; the original switch is hidden and keeps working. A switch already shown as something else is moved to the new type. Returns the new entity’s id.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity | yes | The switch to show as something else, or the entity it is already shown as. |
target_domain |
select | yes | cover, fan, light, lock, siren or valve — checked against what your Home Assistant offers. |
invert |
boolean | no | Invert the state (cover, lock and valve only; Home Assistant 2024.2 or newer). |
# The plug the bedroom fan runs off, shown as a fanservice: brain.show_switch_asdata: entity_id: switch.bedroom_fan_plug target_domain: fanresponse_variable: shown # shown.entity_id is the new fan entity
# A plug running a floor lamp, shown as a lightservice: brain.show_switch_asdata: entity_id: switch.lounge_lamp_plug target_domain: light🗣️ “The lounge lamp is on a smart plug — make it show up as a light.”
Stop showing switch as
brain.stop_showing_switch_as
Undo show_switch_as: remove the helper so the switch shows as a switch again and is no longer hidden. Takes the switch or the entity it is shown as. The answer lists the automations, scripts and scenes that used the entity going away — run it with dry_run: true first to see that list without changing anything.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity | yes | The switch, or the light/fan/lock/cover/siren/valve it is shown as. |
dry_run |
boolean | no | When on, only report what would change. Default off. |
# See what would break firstservice: brain.stop_showing_switch_asdata: entity_id: fan.bedroom_fan_plug dry_run: trueresponse_variable: preview🗣️ “Stop showing the bedroom plug as a fan — but tell me what uses it first.”
Set sensor display
brain.set_sensor_display
Change how a sensor is shown: its display precision (decimal places) and, where Home Assistant can convert it, its unit. Only the fields you name change; null puts back the integration’s own. A unit is checked against the units Home Assistant can convert that sensor to — it converts only sensors whose device class has a converter (temperature, energy, power, pressure, …), and the refusal lists the units it can.
| Field | Type | Required | Description |
|---|---|---|---|
entity_id |
entity (list) | yes | Sensors to change. |
display_precision |
number | no | Decimal places to show, 0 to 6. |
unit_of_measurement |
text | no | The unit to show it in, e.g. °F or kWh. |
# Outdoor temperature in °F, one decimalservice: brain.set_sensor_displaydata: entity_id: - sensor.outdoor_temperature unit_of_measurement: "°F" display_precision: 1
# Solar power in kW instead of Wservice: brain.set_sensor_displaydata: entity_id: - sensor.solar_power unit_of_measurement: kW🗣️ “Show the solar output in kilowatts with two decimals.”