I have been writing a plugin for a home automation system. I am now trying to deal with Groups (Associations). Because talking with devices takes quite a bit of time and could be a problem for the home automation system, I have been issuing all devices and group operations in another thread.
I have all of the device operations working perfectly. However, I am having problems with the Groups.
What I need to do when I start the plugin is determine what groups currently exist. I do have a database with previously known groups, but I still have to talk with every device just in case the user modified any device with a hand held controller.
So, what I am doing is getting the GroupCollection from each device and then working with the groups within that collection. I think however that I made a wrong assumption. I was assuming that once I got the GroupCollection, that I would not be talking to the device again because I would be getting everything in the Collection. However, this seems not to be the case. When I touch any group within the collection, this goes back out to the device. Even just reading the GroupCollection.Count field goes back out to the device. This makes it EXTREMELY difficult to get all of the group information from any device. I must do these operations in another thread so as to not affect the other operations in the home automation system. But, I don't know what group operations cause an I/O to the device. Is there a list somewhere? I have already determined that GroupCollection really doesn't give me what I want. Also, that just getting the count of the groups will cause an I/O to the device.
In one example, I have four groups defined in a single device. So far, just getting the information about this GroupCollection is causing about 7 or 8 I/O's to the device. Imagine this with about 90 devices. This is ALOT of I/O flowing around the network. Also, it makes getting this work done without getting some time of exception from the controller darn near impossible. I am currently getting about 10% of my devices timing out or not responding because there are too many operations flowing on the network.
Any help would be appreciated as this is really vexing me (how's that for a good word)...
Thanks,
Mike