Distributing Intelligence in Smart Homes: a Case Study in Home Manager