Automationtrigger by area

The possibility to change lights and others by area is great.
And in addition it would be wonderful, if it would be possible to have the same in triggers.

For example:
i have different motion and present sensors in one area/room. When I want to turn the lights on for example, I have to make a group of sensors for this room. But if any sensors changes I have to change the area and the group.

possible solution:
The perfect solution would be to pick an area and home assistants checks every motion sensor in this area.

Thanks :slight_smile:

How would this work exactly?

Imagine this simplified scenario:

  • You have one motion sensor and one light, both with the same area (let’s say kitchen).
  • You set your automation so that when the state of kitchen changes, all devices under kitchen area change to match that state.
  • Your motion sensor changes state to on and triggers the automation, turning the light on.
  • Your light changing state to on also triggers the automation, and attempts to turn the light on.

The last message is fired but doesn’t do anything. Not great, but not a huge deal - you’ll have an extra trace in your automation which says it turned on your light when it didn’t.

Now, imagine you have 5 lights in your kitchen. Suddenly you have a flood of executions in your automation:

  • motion sensor triggers the automation and turns on the lights.
  • light 1 turns on and retriggers the automation.
  • light 2 turns on and retriggers the automation.
  • light 3 turns on and retriggers the automation.
  • light 4 turns on and retriggers the automation.
  • light 5 turns on and retriggers the automation.

Not only are you spamming the system with executions which didn’t need to be triggered, you also have a bigger problem.
Traces by default only show the last 5 executions, so when you go and check, the actual event which caused the lights to turn on is no longer in the automation trace.

That example is only with 5 lights and a single motion sensor. Add another presence sensor and a few more lights, plus a switch or two which use the same area and you’ll quickly run into issues.
For extra fun, set the automation action to toggle the lights :slight_smile: