Cloud-based smart home framework