How to handle multiple presence(s)

I am trying to think of a way that I can handle multiple presences in a location. This is for controlling lights. I have multiple people with the Fobs and want the lights to turn on when the first person arrives, but turn off after the last person leaves.
Is there some way to poll if there are any “present” presence devices?

Glen - there is a good smartapp that was written by a fellow member of the ST community. This would address you need to have the lights controlled by who present. Something else to consider is using IFTTT with ST to have this set up with triggers based on presence.

I wrote this to change state based on presence in the home:

I use this in conjunction with “Big Turn OFF” to turn off all my lights, “change my nest mode” to mark my thermostat home / away: turning the alarm on my Foscam: using the custom device type: and hooked up contact sensors, motion sensors and light switches to “Notify Me When”.

The key is to use the “nobody home” app to set mode - and use other apps installed for specific modes (away, in this case) to layer on functionality.

You guys are awesome! Thanks tons!!!

…and to give credit where it’s due: the inspiration (and some code snippets) are from the SmartApp: Bon Voyage:

@ImBrian - Yes those are the ones. A big THANK YOU for them, I was able to use them as a base line to create a smartapp as well as learn how to code again. It’s been sometime…