This document discusses employing Internet of Things technologies for building automation. It proposes using the Constrained Application Protocol (CoAP) as the main communication protocol between applications and smart devices. A gateway is used to bridge wireless sensor networks and the Internet. New devices can be automatically discovered and configured using CoAP. The system was implemented and tested with various sensor and networking hardware over a 4 month period. Future work includes adding more CoAP extensions and implementing DNS-like capabilities for gateways.