Sorry if this has been asked before. I am struggling with this one.
Basically, I have a presence detection based on NMAP and Location, but sometimes it messes up.
What I want is a information on how to do a condition where it will only fire if away had been on for ten minutes minimum prior to switching back to home.
ie: house_mode previous state away for greater than 10 mins before changing to home then proceed.
Use a condition checking that house_mode is away and use the for option to specify a length of time.
Without knowing what house_mode is it’s hard to tell what the actual state for away will be, so confirm the actual state at developer tools > states. For device trackers, away is not_home.
Sorry, house_mode as setup as an input select, but is to change by presence detection.
I should have been more clear.
So what I would like to do is if a device tracker, or even a person entity as I may change this, was in not_home previously for more than ten minutes before changing back to home, then trigger the automation, but if it was away or not home for less than ten minutes, then the automation does not trigger.
Basically, is it possible to check a condition on a previous or old state of the entity prior to changing to the new one.
Looking at this, it may be easier to do it in NodeRed than with Yaml. I have not done much with node red before though. I will have to research it a bit more.
If I understand you correctly, the input_select is being changed to not_home when the device tracker goes to not_home. Is that correct? That’s what I have above assumes.
I agree with what Tediore now has (modified) above.
I know a lot of people like to use node red but it always feels like a cop out to me (though some major (and very valued) contributors here use it)
But even though I use vanilla yaml for everything - I can’t think of a way of doing this without a helper element. In this case Tediore and the OP are using an input select.
I would just use an input boolean (less resource hungry) triggered ten minutes after you leave. But the difference is 3/10 th’s of bugger all.
Though the input select is probably used elsewhere, so probably justified
@Tediore Yes I am preferring to use the state of the input_select. Thanks for the modification. @Mutt I do use the input select in multiple places. I implemented that a while ago.
I was hoping to avoid an additional helper.
Personally I do prefer YAML over Node Red as well. I was just struggling with how to implement using a previous state over a current state.
I’ll test the above today. It’s morning here in Australia now .
Thanks for the advice.