Wireless Sensor Networks (WSNs) are challenging types of networks where resources can be scarce. In particular, battery is often a very limited resource and the radio interface is the culprit for most of the energy consumption. This makes any discovery of other sensors a difficult task, less cumbersome if sensors are fixed but crucial if (some) sensors start being mobile (such as in wildlife monitoring projects with tagged animals). In this paper we propose a middleware offering node discovery for partially mobile wireless sensor networks, where fixed nodes (sinks), deployed in the environment to monitor the movement of entities, detect those patterns with low power consumption. The approach is based on various machine learning techniques which allows for learning and adapting the wake up strategy of the sinks dynamically. We also report on the evaluation of the approach through simulation and use of real movement traces.