Ubiquiti - Automation based on device connected to AP

Is there a way to create an automation if a device is connected to a specific AP? It appears in the general integration it is setup only as if the device is connected anywhere in the network. I’m looking to drill that down to one specific AP and do some things from there.
I have full ubiquiti setup - UDM pro, switch, AP etc

I have not used this but this may be a solution:

I think that only pertains if connected to a specific AP

This might need to be done on the ubiquiti side of things?

Could you query each AP to see if the device was connected to that AP?