how ai works in smart homes