When you get the light switches from a service, iterate over the collection and assign ID to each light switch. Then in the onClick event of your button, you will get something that looks like this (it will have the name of your container):

That block will contain the property and value which you assigned when you iterated over the results of service.