Consumer grade cyber-physical systems are becoming an integral part of our life, automatizing and simplifying everyday tasks; they are almost always capable of connection to the network allowing remote monitoring and programming. They rely on powerful programming languages, cloud infrastructures, and ultimately on complex software stacks. Indeed, due to complex interactions between hardware, networking and software, developing and testing such systems is known to be a challenging task. Ensuring properties such as dependability, security or data confidentiality is far from obvious. Various quality assurance and testing strategies have been proposed.The most common approach for pre-deployment testing is to model the system and run simulations with models or software in the loop. In practice, most often, tests are run for a small number of simulations, which are selected based on the engineers' domain knowledge and experience.To improve quality assurance practices, previous works such as the ARISTEO paper, promulgate the adoption of searchbased techniques and models to falsify a given property. Our conjecture is that effectiveness and usefulness are improved if the environment is also explicitly accounted for. In the approach presented in this paper, we seek properties violations via simulation and search based-techniques. However, the environment, more precisely, a set of environment conditions are accounted for via models learned on real world data. Learned models, represent the interactions of cyber-physical systems and the surroundings under specific environmental conditions. Models are then fed into a combined simulation -search algorithms. Indeed, we seek to find a model combination (i.e., environment realization) and sequence of system actions violating a particular property.We have implemented our approach in Python, using standard frameworks and used it to generate scenarios violating temperature constraints for a smart thermostat implemented as a part of our IoT testbed. Data collected from an application managing a smart building have been used to learn models of the environment under ever changing conditions. The suggested approach allowed us to identify several pit-fails, scenarios (i.e., environment conditions), where the system behaves not as expected.