Activity recognition in smart homes: from specification to representation