Skip to content

Add event groups #28653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 40 additions & 19 deletions source/_integrations/group.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ha_category:
- Binary Sensor
- Cover
- Fan
- Event
- Helper
- Light
- Lock
Expand All @@ -23,6 +24,7 @@ ha_config_flow: true
ha_platforms:
- binary_sensor
- cover
- event
- fan
- light
- lock
Expand All @@ -38,7 +40,7 @@ The group integration lets you combine multiple entities into a single entity. E
This can be useful for cases where you want to control, for example, the
multiple bulbs in a light fixture as a single light in Home Assistant.

Home Assistant can group multiple binary sensors, covers, fans, lights, locks, media players, switches as a single entity, with the option of hiding the individual member entities.
Home Assistant can group multiple binary sensors, covers, events, fans, lights, locks, media players, switches as a single entity, with the option of hiding the individual member entities.

{% include integrations/config_flow.md %}

Expand Down Expand Up @@ -70,6 +72,11 @@ In short, when any group member entity is `open`, the group will also be `open`.
- Otherwise, the group state is `open` if at least one group member is `open`.
- Otherwise, the group state is `closed`.

### Event groups

- The group state is `unavailable` if all group members are `unavailable`.
- Otherwise, the group state is the last event received from any group member.

### Fan groups
In short, when any group member entity is `on`, the group will also be `on`. A complete overview of how fan groups behave:

Expand Down Expand Up @@ -149,6 +156,20 @@ cover:
- cover.living_room_window
```

Example YAML configuration of an event group:

```yaml
# Example configuration.yaml entry
event:
- platform: group
name: "Remote events"
entities:
- event.remote_button_1
- event.remote_button_2
- event.remote_button_3
- event.remote_button_4
```

Example YAML configuration of a fan group:

```yaml
Expand Down Expand Up @@ -376,13 +397,13 @@ Old style groups can calculate group state with entities from the following doma

When member entities all have a single `on` and `off` state, the group state will be calculated as follows:

| Domain | on | off |
|-------------------|----------|----------|
| device_tracker | home | not_home |
| cover | open | closed |
| lock | unlocked | locked |
| person | home | not_home |
| media_player | ok | problem |
| Domain | on | off |
| -------------- | -------- | -------- |
| device_tracker | home | not_home |
| cover | open | closed |
| lock | unlocked | locked |
| person | home | not_home |
| media_player | ok | problem |

When a group contains entities from domains that have multiple `on` states or only use `on` and `off`, the group state will be `on` or `off`.

Expand All @@ -394,14 +415,14 @@ These groups can still be in templates with the `expand()` directive, called usi

This integration provides the following services to modify groups and a service to reload the configuration without restarting Home Assistant itself.

| Service | Data | Description |
| ------- | ---- | ----------- |
| `set` | `Object ID` | Group id and part of entity id.
| | `Name` | Name of the group.
| | `Icon` | Name of the icon for the group.
| | `Entities` | List of all members in the group. Not compatible with **delta**.
| | `Add Entities` | List of members that will change on group listening.
| | `Remove Entities` | List of members that will be removed from group listening.
| | `All` | Enable this option if the group should only turn on when all entities are on.
| `remove` | `Object ID` | Group id and part of entity id.
| `reload` | `Object ID` | Group id and part of entity id.
| Service | Data | Description |
| -------- | ----------------- | ----------------------------------------------------------------------------- |
| `set` | `Object ID` | Group id and part of entity id. |
| | `Name` | Name of the group. |
| | `Icon` | Name of the icon for the group. |
| | `Entities` | List of all members in the group. Not compatible with **delta**. |
| | `Add Entities` | List of members that will change on group listening. |
| | `Remove Entities` | List of members that will be removed from group listening. |
| | `All` | Enable this option if the group should only turn on when all entities are on. |
| `remove` | `Object ID` | Group id and part of entity id. |
| `reload` | `Object ID` | Group id and part of entity id. |