Hi, using my Huawei router I know who is at home and I can use this for automation. For example, when someone gets is at the door, it’s from the family and it’s dark, it lightens the entry of the house. Wifi detects the presence and I switch a relay. Fine until now.
But, a couple of minutes or seconds, the status switches from Home to Away:
A couple of minutes later, it switches to Home again and the process repeats. With lights there is no problem because it’s just saying to switch On again. But I also use the same process to start Spotify and, as soon as I stop it, it starts again.
First, any clue of why the status is switching from Home to Away in just a half a minute ? Is this any Android or Router configuration ? Any idea on how to disable this and keep the Home status until i Leave again ?
Thanks for the help but probably I did not explain me well. When the router detects my presence, it then switches me to Home. That is correct. But then somehow I get reset to Away even though I do nothing with the phone. Any ideas why ?
Then it comes back to Home re-triggering the process.
It’s going to happen. Devices and routers will lose connection all the time, hence why I was suggesting you put a time threshold before it triggers to avoid these false triggers. It’s not like you need to trigger your lights to go off when it detects you away immediately. It can wait a few minutes to make sure you’re really away. Coming home of course, you can have it trigger immediately. Just edit your away automations to wait a bit longer before the trigger.
Also, the template binary sensor is a good way to track all 3 devices in your house and only trigger when all 3 are gone. This could also solve your problem since the likelihood of all 3 dropping connection at the same time is low.
Yes, but the problem is when I get home. If I wait for the trigger, them it does not light ON as soon as I enter home and this is the purpose. Easy, I am doing that.
But now I enter home and then I turn Off the light for some reason. The phone goes "Away"for a reason I do not understand and when, after some time changes to “Home”, triggers again because thinks I am back home again.
So I would need a way to, after entering home, it could not retrigger for several hours even when the state changes from Away to Home.
Not sure how you’ve set up your automations, but if you have one automation for “home” mode and a separate one for “away” you can do exactly what I outlined above and it works well. I use it in my config. No delay for coming home, only for triggering away mode.
- action:
- data:
entity_id: switch.canal_1
service: switch.turn_on
alias: Turns On light when arriving home
condition: []
id: '1512750409333'
trigger:
- entity_id: device_tracker.mi5miphone
from: not_home
platform: state
to: home
As said, the status of the phone switches from Home to Away (I don’t know why) and, when it get’s back to Home, it triggers again.
I can either understand force the phone to remain Home (I don’t now how because it’s retrieving the status from the router) or I can have a software debouncer that, even if the status changes, it will only re-trigger after, let’s say, a 6 hours Away status.
Can you please share your code. That would certainly help.
First make a binary template sensor to get the home/away status. Basically, this determines, is at least one person home? (You’ll need to modify for the actual device tracker names)
And add these two automations. Just modify the actions to whatever more you’d like it to do. But when someone comes home, it turns the binary sensor we created above to on and triggers the home automation immediately. When the last device “leaves” or shows “not_home”, it turns the binary sensor to off and triggers the away mode automation. But first before triggering it, it waits another 5 minutes to see if you are really gone. Make sense?
Hi, I had the configuration as you say but I misinterpreted the variable and inserted 15 thinking it was 15 minutes not 15 seconds. After your comment I reread it and discovered my mistake.