HomeRules: A Tangible End-User Programming Interface for Smart Homes