Abstract: A technique is disclosed for controlling a plurality of devices in a building. The technique includes detecting a first network event at a first device, updating a network state on the first device based on the first network event, determining at the first device an action based on the network state, and transmitting a second network event to a second device.