Add event groups (#28653)

This commit is contained in:
Franck Nijhof 2023-08-24 12:49:45 +02:00 committed by GitHub
parent fb2f61973f
commit 01c1f7ec9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ ha_category:
- Binary Sensor
- Cover
- Fan
- Event
- Helper
- Light
- Lock
@ -23,6 +24,7 @@ ha_config_flow: true
ha_platforms:
- binary_sensor
- cover
- event
- fan
- light
- lock
@ -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 %}
@ -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:
@ -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
@ -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`.
@ -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. |