Device tracker in Automation

I have an automation where I recognize when I got home and the sun is below_horizon. I’m using nmap_tracker and any reconnection triggers automation. Can I trigger only if the device is X minutes in not_home?

Did you try playing with the consider_home parameter?

In this case as I use to turn on the lights when I arrive, if I leave a lot of time in consider_home, the lights will be slow to turn on.

I’m sorry, I don’t know if I really understand what you are trying to do and what doesn’t work.

I need a parameter for delay on change to not_home, but on changing on_home is immediate.
I do not know if it’s possible.
My automation can trigger only not_home more than x minutes before change to home.

I use an input_boolean to track if someone is home. It’s updated using an automation that gets triggered by device tracker. The problem with device tracker is that it flips between home and not_home even when you are home.

I have the door locks flip is_home to false.

I think that is exactly what consider_home is for. Actually, if I remember correctly, it is to prevent that you phone disconnects from wifi and reapers moments later. iOS does that when it’s in standby and consider_home sets the ‘delay’ before it marks the phone as not home.

Actually that is exactly what the docs describe. See here:

Seconds to wait till marking someone as not home after not being seen. This parameter is most useful for households with Apple iOS devices that go into sleep mode while still at home to conserve battery life. iPhones will occasionally drop off the network and then re-appear. consider_home helps prevent false alarms in presence detection when using IP scanners such as Nmap. consider_home accepts various time representations, (E.g. the following all represents 3 minutes: 180, 0:03, 0:03:00)

On second thought. The state device tracker uses is actually technically labeled wrong. Just because a device is labeled as home doesn’t technically mean it is home.

It should something like the states of in_range and not_in_range. Or nearby and away

Where is the difference? If it is not within the wifi range it is to be assumed that the device is not at home.

Not In range != not home

Sure, but how your the system know? If you don’t use something like GPS you have to assume that if something is not within reach it is away. Everything else would be guessing.

1 Like

Yea. So why not label it as it is? Don’t make up something that may or may not be true.

It should be up to the user to decide what is fact/fiction for their device or setup. They could use input_select or something they like.

I will try it.

tks cgtobi!!! succefully, is working.