That is likely a function of your unifi integration. There’s a setting in the unifi integration configuration for how long a device must be disconnected from the network before being marked as away. Mine is set to 120 seconds, but IIRC the default is like 300 seconds maybe? I forget. I still use times in my automations though, like “when my phone is off the wifi for 20 seconds (so that would actually be a total of 140 seconds), do this” or “when my phone has been connected to the wifi for 10 seconds, do this”.
Works spectacularly well.
As for debugging, the developer tools are your friend. You can look at the state of any device or entity or person or anything else there.
Developer Tools on the left, then States.
And not for nothing, but if you’re struggling now, I promise it’s not really going to get a whole lot better if you continue going at it from odd angles. There’s not really a step-by-step “here’s how you log in. Here’s how you do this. Here’s how you do that.” But by the same token, if you try to solve an issue from the inside-out, instead of from the top-down, you’re likely to be met with more frustration. The VAST majority of solutions to issues you are going to find - whether on YouTube, or on the forums, are going to be very narrowly focused ON THAT PARTICULAR ISSUE. As such, there will be pieces left out, because the person who posted the problem already understands those pieces. This means that as a new user, you’ll need to go and research the left out pieces. I know - I know. How do you go look for something that you don’t even know is there? How do you know what you don’t know? (for the record, that’s also kind of why my first response didn’t mention the home/away thing - the assumption was that you already knew that, since it’s one of the most basic things that most users set up right out of the box. My bad!)
But that’s kind of my point - you’ll need to have a good deal of patience when you’re first getting up and off the ground, and be willing to read a LOT, and/or watch a LOT of YouTube. Otherwise, you’re going to be bald long before you finish configuring all the things you want.
But on the bright side, if you stick with it, Home Assistant is definitely the most flexible and robust solution available for Home Automation.
That said, it certainly is not for everyone, and there’s no harm in admitting that to yourself. It’s not a reflection on intelligence, or anything else of the sort. Some people just don’t have the free time to invest to learn something this complex, and others aren’t interested in learning it at all, they want something that “just works”. These are both fine reasons. It takes all kinds, man.
But - you’ll find that me, and others, will be happy to help you along the way.
Welcome, and enjoy!