Hi, I am trying to create an automation that will toggle all the plugs in an area when a button is clicked.
This is the same behavior as the area toggle that gets automatically added to the dashboard, see:
So the desired behaviour is like this: if one of the plugs in the area is on, turn them off; if none of the plus in the area are on, turm all of them on.
I searched the documentation and the forum, but could not find a solution that works. I found some solutions that require to create a group, but I would like to avoid that if possible. I feel like I am missing something fairly obvious.
The following automation configuration toggles all the entities in the area individually, which is not what I want.
alias: Toggle Area
- platform: device
discovery_id: 0x000d6f000fe4c1d2 action_left_bottom_release
- service: homeassistant.toggle
See also this related topic (use-header-toggle-in-automation), but this is not specific about area’s.