Add button group support (#33681)

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
Franck Nijhof 2024-07-11 09:37:47 +02:00 committed by GitHub
parent e5bcebc49c
commit 77410e8178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@ title: Group
description: Instructions on how to setup groups within Home Assistant.
ha_category:
- Binary sensor
- Button
- Cover
- Event
- Fan
@ -62,6 +63,13 @@ Binary sensor, light, and switch groups allow you set the "All entities" option.
- Otherwise, the group state is `off` if at least one group member is `off`.
- Otherwise, the group state is `on`.
### Button groups
The group state is the last time the grouped button was pressed.
- The group state is `unavailable` if all group members are `unavailable`.
- Otherwise, the group state is the last time the grouped button was pressed.
### Cover groups
In short, when any group member entity is `open`, the group will also be `open`. A complete overview of how cover groups behave:
@ -144,6 +152,19 @@ binary_sensor:
- binary_sensor.door_right_contact
```
Example YAML configuration of a button group:
```yaml
# Example configuration.yaml entry
button:
- platform: group
name: "Restart all ESPHome devices"
device_class: opening
entities:
- button.device_1_restart
- button.device_2_restart
```
Example YAML configuration of a cover group:
```yaml