Entities
Ask brAIn to tidy the entity list: names, entity IDs, visibility, voice aliases, icons, and what each device shows as.
Ask brAIn
Rename all the shelly_1pm_xxxx lights to what they actually are.Give that Shelly a sane entity id: light.kitchen_ceiling.Disable the diagnostic sensor that spams the recorder.Hide the child-lock switch from dashboards but keep it working.We call the office lamp "the beacon". Make voice understand that.The back door sensor shows as "opening". Show it as a door.The lounge lamp is on a smart plug. Make it show up as a light.Are there dead entities left over from integrations I removed? Clean them up.What brAIn can do
Every service is admin-only. Call one from Developer tools → Actions, a script or an automation, or ask brAIn. * marks a required field, and [] marks a field that takes one value or a list.
| Service | What it does | Fields |
|---|---|---|
brain.rename_entity |
Set the friendly name of one or more entities. | entity_id[]*, name* |
brain.change_entity_id |
Change an entity’s ID within the same domain. The response lists the automations, scripts and scenes that still use the old ID. dry_run: true shows that list without renaming. |
entity_id*, new_entity_id*, dry_run |
brain.enable_entity |
Enable disabled entities. Takes effect when their integration reloads. | entity_id[]* |
brain.disable_entity |
Disable entities. They stop updating and leave the UI. | entity_id[]* |
brain.hide_entity |
Hide entities from auto-generated dashboards and voice assistants. They keep working. | entity_id[]* |
brain.unhide_entity |
Show hidden entities again. | entity_id[]* |
brain.set_entity_aliases |
Replace the alternative names Assist listens for. Send the full new list. | entity_id*, aliases[]* |
brain.set_entity_icon |
Set an icon override. Leave icon out to go back to the default. |
entity_id[]*, icon |
brain.delete_orphaned_entities |
Remove registry entries whose integration no longer provides them. Reports only unless you pass dry_run: false. With entity_id, each one is re-checked and anything still alive is skipped and reported. |
dry_run, entity_id[] |
What a device shows as
Every entity has a Show as setting in its settings dialog. These four services change it.
| Service | What it does | Fields |
|---|---|---|
brain.set_device_class |
Change the Show as type of a binary_sensor, button, cover, event, humidifier, media_player, switch, update or valve: a contact sensor as a door, a cover as a garage door, a switch as an outlet. Leave device_class empty to give back the integration’s own. Returns the class now in effect, the override, and the original. |
entity_id[]*, device_class, confirm_safety |
brain.show_switch_as |
Show a switch as a light, fan, lock, cover, siren or valve. The new entity takes its place in dashboards and voice. The original switch is hidden and keeps working. Returns the new entity’s id. invert applies to cover, lock and valve (Home Assistant 2024.2 or newer). |
entity_id*, target_domain*, invert |
brain.stop_showing_switch_as |
Undo show_switch_as, so the switch is a switch again and is no longer hidden. Takes the switch or its stand-in. The answer lists the automations, scripts and scenes that used the entity going away. dry_run: true shows that list first. |
entity_id*, dry_run |
brain.set_sensor_display |
Change a sensor’s decimal places (0 to 6) and, where Home Assistant can convert it, its unit. Only the fields you name change. null puts back the integration’s own. |
entity_id[]*, display_precision, unit_of_measurement |
Rules for all four:
- Only a switch can become another kind of device. A ceiling fan that arrives as a
fanentity cannot be shown as a light. If it runs off a smart plug, show the plug’s switch as what you want. - Smoke, gas, carbon monoxide and leak sensors keep their type unless you say yes. brAIn’s safety alerts go by that type, so showing a smoke detector as a door would stop them. brAIn asks you first, and the service refuses without
confirm_safety: true. Making a sensor one of those types goes through, and the answer says its alerts now go through quiet hours. - A sensor’s or a number’s device class never changes. It decides the unit and the long-term statistics. Use
set_sensor_displayfor its unit and precision. - Types and units are checked against your Home Assistant. A wrong one is refused with the list of what it would take. Units convert only for sensors whose device class has a converter, such as temperature, energy, power and pressure.
- Protected entities hold across the pair. A switch shown as something else is protected if either the switch or its stand-in is on your protected list. While you have a protected list, brAIn also refuses when it cannot read which entity stands in for which.
- A template binary sensor made in the UI keeps the type set in its helper. Change it under Settings → Devices & services → Helpers → the helper → Template options. brAIn can clear an existing override there but will not add one. A template sensor written in YAML takes an override as usual.
- Asked for, never unattended. From the chat and the terminal these go through protected entities and the action gate. A Voice assistant level agent, scheduled cards and other unattended runs cannot use them.
Examples
- action: brain.rename_entity data: entity_id: - light.shelly_1pm_abc123 name: Kitchen Ceiling- action: brain.change_entity_id data: entity_id: light.shelly_1pm_abc123 new_entity_id: light.kitchen_ceiling- action: brain.delete_orphaned_entities # reports only response_variable: orphans- action: brain.delete_orphaned_entities data: dry_run: false entity_id: - sensor.old_hub_battery - sensor.old_hub_signalaction: brain.set_device_classdata: entity_id: - binary_sensor.back_door_contact device_class: door # leave out to go back to the integration's ownaction: brain.show_switch_asdata: entity_id: switch.bedroom_fan_plug target_domain: fanresponse_variable: shown # shown.entity_id is the new fanaction: brain.stop_showing_switch_asdata: entity_id: fan.bedroom_fan_plug dry_run: trueresponse_variable: previewaction: brain.set_sensor_displaydata: entity_id: - sensor.outdoor_temperature unit_of_measurement: "°F" display_precision: 1