---
title: "Groups"
description: "Spook adds actions to change the members of a group from an automation, and tells you when a group has members that no longer exist."
canonical_url: "https://spook.boo/group"
---
# Groups

> Spook adds actions to change the members of a group from an automation, and tells you when a group has members that no longer exist.

The group helper integration lets you combine multiple entities into a single entity. Entities that are members of a group can be controlled and monitored as a whole.

Useful to control the bulbs in a light fixture as a single light in Home Assistant, for example. Or to combine all the wall plugs behind your Christmas decorations into a single switch entity.

![An repair raised by Spook for a group that has an unknown member entity.](https://spook.boo/images/screenshots/en/light/repair-group-unknown-members.webp)

Spook found an issue with a group that has a non-existing entity as a member.

## Actions

Spook adds three actions for groups. You find them wherever you add an action, marked with a 👻. They work on groups you made in the interface, under **Settings** > **Devices & services** > **Helpers**.

### Add members to a group

Adds entities to a group, while Home Assistant is running.

Guests staying for the weekend? Put their phones in the group that says somebody is home. Moved a lamp to the hallway? Add it to the hallway lights. Changing who is in a group used to mean opening the helper settings. Now an automation can do it. Entities already in the group stay where they are, and the new ones join at the end.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **add members**, and select **Group: Add members to a group 👻**.
3. Under **Group**, choose the group.
4. Under **Members**, choose the entities that should join it.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=group.add_members) opens it in your Home Assistant, ready to run once.

![The Actions tool with Add members to a group 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-group-add-members.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Group: Add members to a group 👻 |
| Action name | `group.add_members` |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=group.add_members) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=group.add_members) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `group` | string | Yes | `light.hallway` |
| `members` | list | Yes | `light.desk` |

The `group` attribute names the group to add to. The `members` attribute lists the entities joining it, which have to exist and be a kind the group can hold.

If the group is set to hide its members, the ones that join it are hidden. A member that leaves stays hidden, the same as when you take one out through Settings: Home Assistant hides the members a group has, and never touches one that left. It is also the only safe answer. The registry records that an integration hid an entity, but not which one, so showing it again could undo what another helper still asks for. An entity that was already hidden, by you or by anything else, is left as it is.

Which entities a group can hold is read from the same list Home Assistant's own dialog offers, so it is not always one domain: a sensor group takes `number` and `input_number` alongside `sensor`.

A group holds either an entity ID or a registry ID, whichever the interface had when it was made. All three actions treat the two names for one entity as one member. So an entity cannot end up in a group twice, and one stored under the name you did not use still goes when you ask for it.

**Example actions in YAML**

Add the desk lamp to the hallway lights:

```yaml
action: group.add_members
data:
  group: light.hallway
  members:
    - light.desk
```

**Known limitations**

- Only groups created through the interface can be changed, and the same goes for all three group actions. They cannot change a group defined in your YAML configuration, and raise an error saying so. The built-in `group.set` action does still work on that older kind of group, and it does not need a restart either.

### Remove members from a group

Takes entities out of a group, while Home Assistant is running.

The other way round from [Add members to a group](#add-members-to-a-group): the guest goes home, the window closes, the lamp moves to another room. Naming something that is not in the group does nothing, and is not an error. So this is also how you clear out a member that no longer exists.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **remove members**, and select **Group: Remove members from a group 👻**.
3. Under **Group**, choose the group.
4. Under **Members**, choose the entities that should leave it.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=group.remove_members) opens it in your Home Assistant, ready to run once.

![The Actions tool with Remove members from a group 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-group-remove-members.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Group: Remove members from a group 👻 |
| Action name | `group.remove_members` |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=group.remove_members) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=group.remove_members) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `group` | string | Yes | `light.hallway` |
| `members` | list | Yes | `light.desk` |

The `group` attribute names the group to take them out of. The `members` attribute lists the entities leaving it, whether or not they still exist.

If the group is set to hide its members, the ones that join it are hidden. A member that leaves stays hidden, the same as when you take one out through Settings: Home Assistant hides the members a group has, and never touches one that left. It is also the only safe answer. The registry records that an integration hid an entity, but not which one, so showing it again could undo what another helper still asks for. An entity that was already hidden, by you or by anything else, is left as it is.

Which entities a group can hold is read from the same list Home Assistant's own dialog offers, so it is not always one domain: a sensor group takes `number` and `input_number` alongside `sensor`.

A group holds either an entity ID or a registry ID, whichever the interface had when it was made. All three actions treat the two names for one entity as one member. So an entity cannot end up in a group twice, and one stored under the name you did not use still goes when you ask for it.

**Example actions in YAML**

Take the desk lamp out of the hallway lights again:

```yaml
action: group.remove_members
data:
  group: light.hallway
  members:
    - light.desk
```

**Known limitations**

- Only groups created through the interface can be changed, and the same goes for all three group actions. They cannot change a group defined in your YAML configuration, and raise an error saying so. The built-in `group.set` action does still work on that older kind of group, and it does not need a restart either.

### Set the members of a group

Replaces the members of a group with the ones you give, while Home Assistant is running.

For when you know the whole list, not just what changed: a scene that decides which lights make up "the reading corner", or an automation that rebuilds a group from scratch every evening.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **set the members**, and select **Group: Set the members of a group 👻**.
3. Under **Group**, choose the group.
4. Under **Members**, choose every entity the group should hold from now on.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=group.set_members) opens it in your Home Assistant, ready to run once.

![The Actions tool with Set the members of a group 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-group-set-members.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Group: Set the members of a group 👻 |
| Action name | `group.set_members` |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=group.set_members) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=group.set_members) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `group` | string | Yes | `light.hallway` |
| `members` | list | Yes | `light.desk` |

The `group` attribute names the group to change. The `members` attribute lists the entities it should hold from now on, which have to exist and be a kind the group can hold.

If the group is set to hide its members, the ones that join it are hidden. A member that leaves stays hidden, the same as when you take one out through Settings: Home Assistant hides the members a group has, and never touches one that left. It is also the only safe answer. The registry records that an integration hid an entity, but not which one, so showing it again could undo what another helper still asks for. An entity that was already hidden, by you or by anything else, is left as it is.

Which entities a group can hold is read from the same list Home Assistant's own dialog offers, so it is not always one domain: a sensor group takes `number` and `input_number` alongside `sensor`.

A group holds either an entity ID or a registry ID, whichever the interface had when it was made. All three actions treat the two names for one entity as one member. So an entity cannot end up in a group twice, and one stored under the name you did not use still goes when you ask for it.

**Example actions in YAML**

Make the hallway lights the ceiling light and the desk lamp, and nothing else:

```yaml
action: group.set_members
data:
  group: light.hallway
  members:
    - light.hallway_ceiling
    - light.desk
```

**Known limitations**

- Only groups created through the interface can be changed, and the same goes for all three group actions. They cannot change a group defined in your YAML configuration, and raise an error saying so. The built-in `group.set` action does still work on that older kind of group, and it does not need a restart either.

## Repairs

Spook looks through your groups for members that no longer exist, and tells you in the repairs dashboard. New to repairs? Follow [Fix your first repair](https://spook.boo/fix-your-first-repair).

Want Spook to leave one group alone? Keep it out on the **Exclusions** page of Spook's panel, or put the **Excluded from Spook** label on it. [How that works](https://spook.boo/troubleshooting#excluded-from-spook).

### Unknown source entity

A group has a member that no longer exists, usually because the entity was renamed or removed. The group carries on with the members it has left, so it does less than you think.

**How to fix it:** Select the repair. Spook offers to **Remove the deleted members** from the group for you: the ones the repair marks as deleted, which Home Assistant removed. Choose **Let me fix it myself** to change the group under **Settings** > **Devices & services** > **Helpers** instead, or **Keep them, stop telling me** if they are meant to come back. For a group set up in YAML, edit the group in your configuration. The repair disappears by itself once it is fixed.

**How Spook checks this**

Spook looks at the members of every group. When one of them no longer exists, it raises a repair that names the group and the missing member.

Before removing anything, Spook checks again. If the members the repair listed are back, or changed since Spook looked, nothing is removed, and Spook updates the repair on its own. A button that removes something needs proof the entity was removed, and Spook only takes Home Assistant's own word for that: the entity registry keeps a record of every entity it deleted, for a month after nothing owns it any more. Something that is merely not there yet looks exactly like something that is gone: a YAML sensor without a unique ID whose integration is still starting, or an entity of an integration that is retrying its setup. Neither has a state, neither is in the registry, and Spook cannot tell them apart. So those are reported, and left for you to check. Spook cannot edit a group set up in YAML, and says so.


## Sitemap

See the full [sitemap](https://spook.boo/sitemap.md) for all pages.
