Detection of User Activities in Intelligent Environments