How would you set up "Everyone has been away for some time"?

When I had my Homey device to run my home for me I had it set up like this:

  • A flow called “Everyone has been away for some time” to control lights and some devices
  • A timer that started when last person left the home (Timer “Countdown from last person left home”)
  • When the timer reached 5 minutes I started the flow “Everyone has been away for some time”.
  • If someone came home I disabled the flow “Everyone has been away for some time” and reset the timer.
  • If I turned on Guest Mode the flow was disabled and timer reset to 0.

How would you set this up in Home Assistant?

  • Scene: “Everyone has been away for some time”
  • Create a timer in HA “timer-last_person_left_home”
  • Create automation to start countdown of timer when last person leaves home (How do I know that?)
  • Create automation to run scene “Everyone has been away for some time” when timer reaches 0.
  • Create automation to disable scene “Everyone has been away for some time” when someone is at home.
  • Create automation to reset timer when someone is at home.

Or any smarter way doing this?

What are you using to determine presence? (the HA app, motion sensor, ping (the phone) sensor…).

I don’t do a nobody is home, I do it room by room since I have motion sensor in each room. I do have automations that look to see if any motion sensor has ‘not’ had motion in x minutes.

1 Like

This depends on what you are using to establish presence to be honest.

But assuming it’s a tracker device of some sort then I would simply create groups in yaml.

So for example we all have our own trackers individually but also have created a group for mine and the Mrs tracker and similarly for the kids. You could also create a group containing all people / trackers and then simply use the group home or not_home for x amount of time as a trigger for what ever you like.

You can create as many groups as you want.

Unless you need or want a timer etc but to be honest HA is able to tell you when the group last changed state anyway.

1 Like

I’m amazed over and over how straight forward HA is compared to Homey. It is more and more obvious that Homey is far from complete to be a home automation system. It lacks these sort of things. You can solve most of the things but its just complicated.

HA rocks! <3

Oh yeah, this is the solution:

  • Create a script “Everyone is away” where I adjust my lights and devices for “away mode”.
  • Create an animation that triggers on when everyone is away (group of trackers) with a delay for 5 minutes before calling the script “Everyone is away”.

Next is to create an animation that triggers if someone comes home before these 5 minutes delay has ticked down to zero, to abort the countdown. I think I can do that with homeassistant.turn_off if I have understood it correctly.

Thanks all in the thread for helping out :slight_smile:

Just set the trigger for the automation to:
state of the group is not_home for x mins.

That way you don’t need to worry about a timer or if someone comes back within 5 mins, it simply won’t trigger the scene unless the group is away for how ever long you require.

2 Likes

Agree on groups, it is a life saver for these type of problems.

i am using them for 3 motion sensors in one stairs.