Presence sensor quirk

I and others have seen weird presence sensor issues. where the sensor will say

arrived…
then hours later say arrived again…

unfort. my doors and locks would unlock in the middle of the night when this happens.
To cut down on this I changed the routine to not fire if we are in night mode…

However looking at the code for the presence sensor it doesn’t even check on a state change what the previous state was.
I have added some code for that and an updated/configure routine to initialize it…
I am testing now but it should ignore the incoming message if the previous state is the same as the incoming one…
I will keep you informed on my progress.

I am supprised the device type doesn’t already do this/

I had this issue with ‘Minimum away time’ set to 1 minute, but not since setting it to 2.

Mine is set to 10 minutes. It is occasionally saying I return again hours later so the timeout would not help

As I side note it appears to be workingI well i will put a notification in so I can tell when it would have changed state.

seems to be working well so here is my device type for testing: