Cortex API? But then xAP route might be just as good. If using macro type method might be worth linking to the state of a virtual light object to give some aspects of automation. Of course if someone changes light states via an external application then things will get in a mess.