A real-time demand response algorithm for heterogeneous devices in buildings and homes. (1st February 2015)