Areas & Floors
Ask brAIn to build and maintain the rooms and floors of your home, and to put every device and entity in the right one.
Ask brAIn
Move every hallway light to the Hallway area.Create a Guest Room area on the upstairs floor, with "spare room" as a voice alias.Put the master bedroom and the kids' room on the upstairs floor.The basement is level -1, not 0. Fix it.Make the living room also answer to "lounge" and "front room".Put the under-cabinet light in the kitchen, even though its hub lives elsewhere.brAIn looks up the ids, checks every one, makes the change, and tells you what moved.
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.
Areas
| Service | What it does | Fields |
|---|---|---|
brain.create_area |
Create an area. Returns its area_id. |
name*, icon, aliases[], floor_id |
brain.rename_area |
Rename an area. | area_id*, name* |
brain.set_area_aliases |
Replace the alternative names voice assistants listen for. Send the full new list. | area_id*, aliases[]* |
brain.set_area_icon |
Set the area’s icon. Leave icon out to clear it. |
area_id*, icon |
brain.delete_area |
Delete an area. Its devices and entities are left unassigned. dry_run: true lists what would lose its area. |
area_id*, dry_run |
brain.add_device_to_area |
Move devices into an area. | area_id*, device_id[]* |
brain.remove_device_from_area |
Take devices out of whatever area they are in. | device_id[]* |
brain.add_entity_to_area |
Move entities into an area. This overrides the area of the device they belong to. | area_id*, entity_id[]* |
brain.remove_entity_from_area |
Take entities out of whatever area they are in. | entity_id[]* |
Floors
| Service | What it does | Fields |
|---|---|---|
brain.create_floor |
Create a floor. Returns its floor_id. level is the storey number: 0 for the ground floor. |
name*, icon, level, aliases[] |
brain.rename_floor |
Rename a floor. | floor_id*, name* |
brain.update_floor |
Change a floor’s icon, level or aliases. Fields you leave out stay as they are. Use a negative level for a basement. |
floor_id*, icon, level, aliases[] |
brain.delete_floor |
Delete a floor. Its areas are left without a floor. dry_run: true lists them. |
floor_id*, dry_run |
brain.add_area_to_floor |
Put areas on a floor. | floor_id*, area_id[]* |
brain.remove_area_from_floor |
Take areas off whatever floor they are on. | area_id[]* |
Good to know
- A device gives its area to all of its entities. Assign an entity to an area to override that, for example when one hub owns gadgets in different rooms.
- Aliases are what voice assistants use to resolve “turn off the lights upstairs” or “the lounge”.
- Find ids by asking brAIn, or in the pickers under Developer tools → Actions.
Examples
action: brain.create_areadata: name: Guest Room icon: mdi:bed aliases: ["spare room"] floor_id: upstairsresponse_variable: area # area.area_id- action: brain.add_device_to_area data: area_id: office device_id: - a1b2c3d4e5f6- action: brain.add_entity_to_area data: area_id: kitchen entity_id: - light.under_cabinet- action: brain.create_floor data: name: Upstairs level: 1 icon: mdi:home-floor-2- action: brain.add_area_to_floor data: floor_id: upstairs area_id: - master_bedroom - kids_roomaction: brain.delete_areadata: area_id: guest_room dry_run: trueresponse_variable: preview