Areas no longer suck! Magic Areas will bring your Areas to life with area presence state tracking, aggregations and automations!

I’ve been looking at the clear_timeout value myself. I have motion sensors in each room and need to vary the values by room. I’m experiencing some issues where with too long a timeout the heating never turns off.

Turns out the performance is not very accurate - the actual elapsed time between the motion sensor clearing and the Magic Areas presence sensor turning off does not match the clear_timeout. Some tests:

Clear_timeoutElapsed Time

00

1015

3055

601:50

902:50

1202:05

The python code seems pretty clear: it adds the timeout in seconds to the last cleared presence sensor (I only have one sensor). Then if the time exceeds this threshold, it clears the presence state. There could be a polling delay before the second step - but the test results seem way too variable to be explained by that.

Is this for a regular area or meta area (like Exterior/Interior) ?

This is a regular area. Just one motion sensor and sensor types set to “motion”

Confirmed that issue. Will be fixed on next release. Thanks for reporting.

1 Like

Hi @jseidl

you have an example of how to use the media_play event to play notifications only in media players in active rooms

Hii Antonio, take a look at the wiki page for this feature Area Aware Media Player · jseidl/hass-magic_areas Wiki · GitHub

@jseidl thx u
i have tried but with no result
this code doesn’t work, any help


script:
  test_alexa:
        sequence:
            - service: notify.alexa_media
              data:
                target: 
                  - media_player.area_aware_media_player
                data:
                  type: announce
                message: >-
                    "Test"

ok i think i found the problem.
Magic Areas generates a generic and non-Alexa-type proxy media player, like my media players.
It would be possible:

  • if all media players are of the same type, create a proxy media_player.area_aware_media_player of the same type
  • if they are of different types, as happens now, generate a generic media player?

Hey @blademckain, indeed Alexa’s use a non-standard way of sending announcements. I’ve checked mine and doesn’t looks like there’s a straightforward way to know if it’s an echo device or not unfortunately.

The way general TTS notifications work is that they generate the audio file using the tts platform and send a play_media event with the URL for the generated file. The approach is very different on Echo devices as it goes from text straight into their announce service.

I think you could look at the media player information stored inside the core.device_registry.
In there you can find the manufacturer and understand if it is Alexa or Google

Light groupings don’t work for me anymore - the entities are no longer created. Not sure if Magic Areas has been updated or whether it was the latest update to the core that did it.

Breaking change on 2021.8.1, released a new update 2.0.5 which fixes this. Please update!

installed and configured but I dont know how to use this. do I use it in automations?

I would like to use magic areas to detect someone in the kitchen where I placed an aqara motion sensor and start playing music on an echo show 5 I have there, how can I achieve this please?

the documentation is a bit confusing
what do I have to set up to have a room that turns off the lights (only turns off does not turn on) after everyone has left the room?

1 Like

For your case just add the aqara motion sensor to the area in Home Assistant and Magic Areas will pick up. Then you can you the binary_sensor it creates for the area to track if someone is there, as a trigger for you music thingy

Yeah documentation needs a lot of work unfortunately.

You can use the latest beta branch and use the “Light Groups” functionality. Add your lights to the groups (overhead, sleep etc) and clear any assigned state for that given group, then none shall turn on but they should turn off

Hmm. The light groups are not being created again, since a HA Core update about a week ago.

That was fixed, please update and let me know if you still have issues

I’m on v2.0.5, which as far as I can see is the latest. This issue did happen months ago, and was fixed. It cam back after I updated the core to 2022.4.4, or possibly the version before that (about a week or 20 days ago).

3.0.1 is released, (we were in beta for a while), please update (read the release notes!)!