Floors in Home Assistant is a logical grouping of areas that are meant to match floors (or levels) in the physical world: your home. Floors are used to group areas together that are on the same floor in your home. Floors give a better overview of your home and can be used to target actions to a specific floor, like turning off all the lights on the first floor.
Spook provides that allows you to manage and automate the floors in Home Assistant programatically. Great for creating “dynamic” floors, or for creating floors on the fly.
Actions¶
Spook adds the following new actions to your Home Assistant instance:
Create a floor¶
Adds a new floor to your Home Assistant instance.
Action properties | |
---|---|
Action | Create a floor 👻 |
Action name | homeassistant.create_floor |
Action targets | No |
Action response | No response |
Spook's influence | Newly added action |
Developer tools | Try this action |
Action data parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
name | string | Yes | First floor |
icon | string | No | mdi:floor-1 |
level | integer | No | 1 |
aliases | string | list of strings | No | ["ground floor", "downstairs"] |
The use of aliases
is helpful if you want to create an floor with multiple names. For example, if you want to create an floor called “First floor”, but also want to be able to refer to it as “Ground floor” or “Downstairs”, you can add those names as aliases. This is used by Home Assistant Assist.
1 2 3 4 5 6 7 8
action: homeassistant.create_floor data: name: "First floor" icon: "mdi:floor-1" level: 1 aliases: - "Ground floor" - "Downstairs"
Delete a floor¶
Delete a floor from your Home Assistant instance.
Action properties | |
---|---|
Action | Delete a floor 👻 |
Action name | homeassistant.delete_floor |
Action targets | No |
Action response | No response |
Spook's influence | Newly added action |
Developer tools | Try this action |
Action data parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
floor_id | string | Yes | first_floor |
Getting an floor ID from a floor name
Not sure what the floor_id
of a floor is? The floor_id
field also accepts templates. You can use this template to use the floor’s name instead:
floor_id: "{{ floor_id('First floor') }}"
That template will find the floor ID of the floor with the name “First floor”.
1 2 3
action: homeassistant.delete_floor data: floor_id: "first_floor"
Same example, but using the floor’s name instead of the floor ID:
1 2 3
action: homeassistant.delete_floor data: floor_id: "{{ floor_id('First floor') }}"
Add an alias to a floor¶
Adds one or more aliases to an existing floor. This action does not remove existing aliases, but adds the new ones to the existing ones.
As floor aliases are used by voice assistants, you could add (and also remove) aliases to a floor using automations, which allows you to make them available/unavailable programatically.
Action properties | |
---|---|
Action | Add an alias to a floor 👻 |
Action name | homeassistant.add_alias_to_floor |
Action targets | No |
Action response | No response |
Spook's influence | Newly added action |
Developer tools | Try this action |
Action data parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
floor_id | string | Yes | first_floor |
aliases | string | list of strings | Yes | ["Ground floor", "Downstairs"] |
Getting an floor ID from a floor name
Not sure what the floor_id
of a floor is? The floor_id
field also accepts templates. You can use this template to use the floor’s name instead:
floor_id: "{{ floor_id('First floor') }}"
That template will find the floor ID of the floor with the name “First floor”.
1 2 3 4 5 6
action: homeassistant.add_alias_to_floor data: floor_id: "first_floor" aliases: - "Ground floor" - "Downstairs"
Same example, but using the floor’s name instead of the floor ID:
1 2 3 4 5 6
action: homeassistant.add_alias_to_floor data: floor_id: "{{ floor_id('First floor') }}" aliases: - "Ground floor" - "Downstairs"
Remove an alias from a floor¶
Removes one or more aliases from an existing floor. This action will leave the other aliases intact.
As floor aliases are used by voice assistants, you could remove (and also add) aliases to a floor using automations, which allows you to make them available/unavailable programatically.
Action properties | |
---|---|
Action | Add an alias to a floor 👻 |
Action name | homeassistant.remove_alias_from_floor |
Action targets | No |
Action response | No response |
Spook's influence | Newly added action |
Developer tools | Try this action |
Action data parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
floor_id | string | Yes | first_floor |
aliases | string | list of strings | Yes | ["Ground floor", "Downstairs"] |
Getting an floor ID from a floor name
Not sure what the floor_id
of a floor is? The floor_id
field also accepts templates. You can use this template to use the floor’s name instead:
floor_id: "{{ floor_id('First floor') }}"
That template will find the floor ID of the floor with the name “First floor”.
1 2 3 4 5 6
action: homeassistant.remove_alias_from_floor data: floor_id: "first_floor" aliases: - "Ground floor" - "Downstairs"
Same example, but using the floor’s name instead of the floor ID:
1 2 3 4 5 6
action: homeassistant.remove_alias_from_floor data: floor_id: "{{ floor_id('First floor') }}" aliases: - "Ground floor" - "Downstairs"
Set aliases for a floor¶
Sets the aliases for a floor. This action will overwrite/remove all existing aliases.
As floor aliases are used by voice assistants, you could remove (and also add) aliases to a floor using automations, which allows you to make them available/unavailable programatically.
Action properties | |
---|---|
Action | Sets aliases for a floor 👻 |
Action name | homeassistant.set_floor_aliases |
Action targets | No |
Action response | No response |
Spook's influence | Newly added action |
Developer tools | Try this action |
Action data parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
floor_id | string | Yes | first_floor |
aliases | string | list of strings | Yes | ["Ground floor", "Downstairs"] |
Getting an floor ID from a floor name
Not sure what the floor_id
of a floor is? The floor_id
field also accepts templates. You can use this template to use the floor’s name instead:
floor_id: "{{ floor_id('First floor') }}"
That template will find the floor ID of the floor with the name “First floor”.
1 2 3 4 5 6
action: homeassistant.set_floor_aliases data: floor_id: "first_floor" aliases: - "Ground floor" - "Downstairs"
Same example, but using the floor’s name instead of the floor ID:
1 2 3 4 5 6
action: homeassistant.set_floor_aliases data: floor_id: "{{ floor_id('First floor') }}" aliases: - "Ground floor" - "Downstairs"
Add an area to a floor¶
Adds one or more area(s) to a floor. This action will leave the other areas on the floor untouched.
Action properties | |
---|---|
Action | Add an area to a floor 👻 |
Action name | homeassistant.add_area_to_floor |
Action targets | No |
Action response | No response |
Spook's influence | Newly added action |
Developer tools | Try this action |
Action data parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
floor_id | string | Yes | first_floor |
area_id | string | list of strings | Yes | living_room |
Getting an floor ID from a floor name
Not sure what the floor_id
of a floor is? The floor_id
field also accepts templates. You can use this template to use the floor’s name instead:
floor_id: "{{ floor_id('First floor') }}"
That template will find the floor ID of the floor with the name “First floor”.
Getting an area ID from an area name
Not sure what the area_id
of an area is? The area_id
field also accepts templates. You can use this template to use the area’s name instead:
area_id: "{{ area_id('Living room') }}"
That template will find the area ID of the area with the name “Living room”.
1 2 3 4
action: homeassistant.add_area_to_floor data: floor_id: "first_floor" area_id: "living_room"
Same example, but using the floor’s and area’s name instead of their IDs:
1 2 3 4
action: homeassistant.add_area_to_floor data: floor_id: "{{ floor_id('First floor') }}" area_id: "{{ area_id('Living room') }}"
To add multiple areas at once, use a list of area IDs:
1 2 3 4 5 6
action: homeassistant.add_area_to_floor data: floor_id: "first_floor" area_id: - "living_room" - "kitchen"
Remove an area from a floor¶
Removes one or more area(s) from a floor. This action will leave the other area on the floor untouched.
Action properties | |
---|---|
Action | Remove an area from a floor 👻 |
Action name | homeassistant.remove_area_from_floor |
Action targets | No |
Action response | No response |
Spook's influence | Newly added action |
Developer tools | Try this action |
Action data parameters | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
area_id | string | list of strings | Yes | living_room |
This action does not need a floor ID
While this action is floor related, it does not need to know the floor ID. An are can only be on a single floor at a time, so it will remove the area from the floor it is in. Hence, it only needs to know the are you want to remove from a floor.
Getting an area ID from an area name
Not sure what the area_id
of an area is? The area_id
field also accepts templates. You can use this template to use the area’s name instead:
area_id: "{{ area_id('Living room') }}"
That template will find the area ID of the area with the name “Living room”.
1 2 3
action: homeassistant.remove_area_from_floor data: area_id: "living_room"
To remove multiple areas at once, use a list of area IDs:
1 2 3 4 5
action: homeassistant.remove_area_from_floor data: area_id: - "living_room" - "kitchen"
Blueprints & tutorials¶
There are currently no known blueprints or tutorials for the enhancements Spook provides for this integration. If you created one or stumbled upon one, please let us know in our discussion forums.
Features requests, ideas, and support¶
If you have an idea on how to further enhance this integration, for example, by adding a new action, entity, or repairs detection; feel free to let us know in our discussion forums.
Are you stuck using these new features? Or maybe you’ve run into a bug? Please check the page on where to go for help.