Internet connected devices are becoming increasingly common in consumer homes. These devices combined with software entities are used to build Internet of Things (IoT) applications. As democratization of IoT takes shape, developing reliable IoT applications remains a challenge for consumers because these applications exhibit characteristics such as distribution, dynamicity, and heterogeneity, which make their design, development and maintenance difficult. In this paper, we use formal methods to ensure correct composition of objects and propose a reliable deployment mechanism in the context of an IoT application. Objects are modelled using an interface description model integrating a behavioural specification of the object functionality. We provide formal validation techniques for verifying that the composition is correct. A deployment plan is generated for automating the instantiation of all objects involved in a valid composition. All the proposals have been implemented as a prototype tool and experiments were carried out for evaluating the tool performance and usability.