I want to automate switching off a whole room based on presence and return it to its previous state when the person returns home. The easiest way to achieve this behaviour would be to just snapshot a whole area, but it seems you can’t just pass an area to the “scene.create” service in an automation.
I know I could just pass all entities in the room to the service, but this would get messy quick, especially when adding or removing entites to homeassistant (same with using manually created groups, areas should be those groups, right?).
Is there any sensible workaround or would this be a future feature request?
You can use the area name in a template to create an ad hoc list of every entity in the area . Be forewarned, there may be some unintended consequences since it will include all sensors, media players, etc:
service: scene.create
data:
scene_id: kitchen_temporary
snapshot_entities: "{{ area_entities('Kitchen') }}"
3 Likes