Cory Guynn has built an entire city out of LEGO and then connected up various sensors and motors to it to sense and control aspects of the city. He has then used node.js and NodeRED on a Raspberry Pi to develop an application to send IOT messages to online service PubNub. It really is an impressive piece of work and goes to show what you can do with enough space, enough LEGO and enough imagination. Read about the development of the app here and visit the homepage for the city here.