πΆ Area-Aware Media Player¶
The Area-Aware Media Player is a virtual media_player
entity that automatically routes play_media
actions to real media_player
devices in occupied areas only.
This ensures messages and notifications are only played where someone is present, instead of broadcasting audio throughout the whole house.
β¨ Perfect for:
- π’ TTS notifications (Text-to-Speech)
- π Context-aware alerts
- π§ Preventing disruptions in quiet or empty rooms
Tip
Works great with Home Assistant Alerts and other notification automations.
βοΈ Configuration Options¶
Warning
This feature must be enabled per area. If an area has it disabled, it will not participate in media routingβeven if itβs occupied.
Option | Description | Default |
---|---|---|
Notification Devices | media_player entities in this area that can be used for playback. Leave blank to include all devices in the area. |
All media players in the area |
Notify States | Area states where playback is allowed. | extended (avoids triggering on transient occupancy like someone walking by) |
π‘ Use occupied
for immediate feedback, or stick to extended
for less noisy results in places like bedrooms.
π How It Works¶
When you send a play_media
command to media_player.magic_areas_area_aware_media_player_global
, Magic Areas will:
- Check each area to see if it's eligible (feature enabled, state allowed, devices available)
- Send the media to all appropriate devices in those areas
β Playback Rules¶
- Only occupied areas matching the configured states will receive audio
- Media is duplicated across multiple areas if more than one qualifies
- No playback occurs in sleeping, empty, or excluded areas
π£ Example: TTS Notification¶
service: media_player.play_media
target:
entity_id: media_player.magic_areas_area_aware_media_player_global
data:
media_content_type: "music"
media_content_id: "media-source://tts/google_translate?message=The+garage+door+was+left+open"
This will play the message only in occupied areas using configured media players.
π£οΈ Example: Notify TTS Integration¶
You can use this feature as a TTS notification target by configuring a notify
service in your configuration.yaml
:
notify:
- platform: tts
name: area_aware_notify
entity_id: tts.piper
media_player: media_player.magic_areas_area_aware_media_player_global
Then you can use it in your automations like this:
service: notify.area_aware_notify
data:
message: "There's a problem in the laundry room."
This will speak the message only where people are present.
π Related¶
- See Area Health for how you can combine this with intelligent alerting.
- Learn more about TTS notifications.