To do more advanced programming like what you would want, and to do it automatically, you would need to make an Orbiter.
Orbiters register themselves with the Orbiter Plugin using Device Registered, and at that point, get all sorts of information, such as the status of each user, etc..
Orbiters then send commands to different devices, such as the media plugin, to do things like change the volume in a room (this is derived from the room the orbiter is currently set to, and the media plugin then traverses the appropriate pipes to do the right thing.).
Of course, any DCE device can manually send commands to the target device, you just have to form the right message, and then use SendCommand() to send it off. Look at Developing a DCE Device.
-Thom