Skip to content

Area State

Jan Seidl edited this page May 29, 2024 · 6 revisions

Magic Area's main goal is detecting an Area's current presence state. This is achieved by the means described on presence sensing, but we also track other secondary states to help out our features.

Presence state

For each area, Magic Areas will scan the Area Registry and pull all the entities assigned to that area*. It will then create an binary_sensor.area_{area_name} entity that will track the supported entities for presence sensing. Whenever one of those entities enter on of the supported states, the area is considered occupied and this entity will have its state flipped to on.

After all presence entities change to a non-presence state (e.g. off), the Area will wait for a given time (configurable under Clear Timeout) before flipping its state to off (clear).

(*) Note: MagicAreas only scans the area registry during load. If you make changes to the area registry (e.g. add a new entity to an area), you'll have to either change the area's configuration on the UI to force a reload or restart Home Assistant.

Secondary states

Magic Areas track other states related to the area apart of the main presence state. Those states are tracked by tracking specific entities (configurable) and our different features listen to those states.

The secondary states are:

  • dark: Tracked by Area Light Sensor
  • sleep: Tracked by Sleep Entity
  • accented: Tracked by Accent Entity
  • extended: When occupied for more than Extended Time seconds

Secondary state usage on features

  • Light Groups currently considers all secondary states to decide whether to turn lights on and which lights to turn on.
  • Climate Groups supports turning climate devices on when area is occupied or only when it enters the extended state (default)
  • Area-Aware Media Player will only play media on areas which are on the selected secondary states.