Skip to content

Labels

Ask brAIn to label things that cut across rooms, such as battery powered, holiday lights or critical, so Home Assistant can target the whole group in one action.

Ask brAIn

Label every battery-powered sensor in the house "Battery powered".
Create an amber "Holiday lights" label and put it on the porch and tree plugs.
Make the battery label red and say what it's for.
That motion sensor is wired now. Drop its battery label.
Delete the "test" label everywhere.

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.create_label Create a label. Returns its label_id. color is a theme color name (red, blue, amber) or a hex code. name*, icon, color, description
brain.rename_label Rename a label. Everything carrying it keeps it. label_id*, name*
brain.update_label Change a label’s icon, color or description. Fields you leave out stay as they are. label_id*, icon, color, description
brain.delete_label Delete a label and remove it from everything it was on. dry_run: true lists what carries it. label_id*, dry_run
brain.add_label Apply one or more labels to entities, devices and areas in the same call. Name at least one target. label_id[]*, entity_id[], device_id[], area_id[]
brain.remove_label Remove one or more labels from entities, devices and areas. Name at least one target. label_id[]*, entity_id[], device_id[], area_id[]

Examples

Create a label and apply it
- action: brain.create_label
data:
name: Battery powered
icon: mdi:battery
color: amber
- action: brain.add_label
data:
label_id: [battery_powered]
entity_id:
- sensor.front_door_battery
- sensor.motion_battery
device_id:
- a1b2c3d4e5f6
Restyle it
action: brain.update_label
data:
label_id: battery_powered
color: red
description: Anything that runs on a battery and needs watching
Take it off one sensor
action: brain.remove_label
data:
label_id: [battery_powered]
entity_id:
- sensor.motion_battery