Exploiting the Human Factor in a WSN-Based System for Ambient Intelligence