IoT is considered as one of the key enabling technologies for the fourth industrial revolution, that is known as Industry 4.0. In this paper, we consider the mechatronic component as the lowest level in the system composition hierarchy that tightly integrates mechanics with the electronics and software required to convert the mechanics to intelligent (smart) object offering well defined services to its environment. For this mechatronic component to be integrated in the IoT- based industrial automation environment, a software layer is required on top of it to convert its conventional interface to an IoT compliant one. This layer, that we call IoTwrapper, transforms the conventional mechatronic component to an Industrial Automation Thing (IAT). The IAT is the key element of an IoT model specifically developed in the context of this work for the manufacturing domain. The model is compared to existing IoT models and its main differences are discussed. A model-to-model transformer is presented to automatically transform the legacy mechatronic component to an IAT ready to be integrated in the IoT-based industrial automation environment. The UML4IoT profile is used in the form of a Domain Specific Modeling Language to automate this transformation. A prototype implementation of an In dustrial Automation Thing using C and the Contiki operating system demonstrates the effectiveness of the proposed approach.