Safeguard Your Gadgets: How to Protect Appliances from Malfunctions?