Use Locative for Presence

Unfortunately its not a simple answer but there are a number of threads around with a lot of discussion touching on this point.

Some are using the AsusWRT wifi or TP-Link Deco wifi presence solution, others are using IFTTT (if you have an android device) to trigger a sensor when you connect/disconnect from a network. I've also seen some setup homebridge (which has a virtual lan presence plugin) and connect that to a virtual device to handle the lan presence. That plugin worked well back in the day when I used homekit.

The more complicated method is setting up a node server to run a ping command and having a driver/app communicate with it to manage virtual devices. This is what I do but its all custom written code. There are examples of this out there somewhere on the smartthings and hubitat forums but will require some work to get working. If you want to go this route I may be able to help you find the necessary info to get it up and running. Let me know.

I wish this was something that was baked into Hubitat or even if they opened up the ping methods so we could create an app to monitor a device but I doubt this will happen.

Here are some threads that may have more info.