Android presence with lock

This feature was working OK but lately it’s doing odd things. In my notifications list I have entries saying I left the house at random times in the early hours (as far as I’m aware I was asleep!) then arrived back home some time later. As a consequence it’s switching lights on and off and even unlocking my Yale smart lock which is worrying. How can I troubleshoot this as one of the main selling points of the lock for me was that it would unlock when I arrive home, but if my phone is generating false leave and arrival notices then it’s not a very secure setup. I’m aware I can disable this routine but I bought the lock to use it in this way so I would like to get to the bottom of it.