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 service calls to a specific floor, like turning off all the lights on the first floor.
Spook provides services 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.
Services¶
Spook adds the following new service to your Home Assistant instance:
Create a floor¶
Adds a new floor to your Home Assistant instance.
Service properties | |
---|---|
Service | Create a floor đź‘» |
Service name | homeassistant.create_floor |
Service targets | No |
Service response | No response |
Spook's influence | Newly added service |
Developer tools | Try this service |
Service call data | |||
---|---|---|---|
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.
Example service call in YAML
1 2 3 4 5 6 7 8
service: 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.
Service properties | |
---|---|
Service | Delete a floor đź‘» |
Service name | homeassistant.delete_floor |
Service targets | No |
Service response | No response |
Spook's influence | Newly added service |
Developer tools | Try this service |
Service call data | |||
---|---|---|---|
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”.
Example service call in YAML
1 2 3
service: homeassistant.delete_floor data: floor_id: "first_floor"
Same example, but using the floor’s name instead of the floor ID:
1 2 3
service: 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 service 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.
Service properties | |
---|---|
Service | Add an alias to a floor đź‘» |
Service name | homeassistant.add_alias_to_floor |
Service targets | No |
Service response | No response |
Spook's influence | Newly added service |
Developer tools | Try this service |
Service call data | |||
---|---|---|---|
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”.
Example service call in YAML
1 2 3 4 5 6
service: 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
service: 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 service 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.
Service properties | |
---|---|
Service | Add an alias to a floor đź‘» |
Service name | homeassistant.remove_alias_from_floor |
Service targets | No |
Service response | No response |
Spook's influence | Newly added service |
Developer tools | Try this service |
Service call data | |||
---|---|---|---|
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”.
Example service call in YAML
1 2 3 4 5 6
service: 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
service: 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 service 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.
Service properties | |
---|---|
Service | Sets aliases for a floor đź‘» |
Service name | homeassistant.set_floor_aliases |
Service targets | No |
Service response | No response |
Spook's influence | Newly added service |
Developer tools | Try this service |
Service call data | |||
---|---|---|---|
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”.
Example service call in YAML
1 2 3 4 5 6
service: 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
service: 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 service will leave the other areas on the floor untouched.
Service properties | |
---|---|
Service | Add an area to a floor đź‘» |
Service name | homeassistant.add_area_to_floor |
Service targets | No |
Service response | No response |
Spook's influence | Newly added service |
Developer tools | Try this service |
Service call data | |||
---|---|---|---|
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”.
Example service call in YAML
1 2 3 4
service: 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
service: 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
service: 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 service will leave the other area on the floor untouched.
Service properties | |
---|---|
Service | Remove an area from a floor đź‘» |
Service name | homeassistant.remove_area_from_floor |
Service targets | No |
Service response | No response |
Spook's influence | Newly added service |
Developer tools | Try this service |
Service call data | |||
---|---|---|---|
Attribute | Type | Required | Default / Example |
area_id | string | list of strings | Yes | living_room |
This service does not need a floor ID
While this service 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”.
Example service call in YAML
1 2 3
service: 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
service: 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 service, 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.