Wireless sensor networks (WSNs) have been adopted as merely data producers for years. However, the data collected by WSNs can also be used to manage their operation and avoid unnecessary measurements that do not provide any new knowledge about the environment. The benefits are twofold because wireless sensor nodes may save their limited energy resources and also reduce the wireless medium occupancy. We present a self-managed platform that collects and stores data from sensor nodes, analyzes its contents and uses the built knowledge to adjust the operation of the entire network. The system architecture facilitates the incorporation of traditional WSNs into the Internet of Things by abstracting the lower communication layers and allowing decisions based on the data relevance. Finally, we demonstrate the platform optimizing a WSN's operation at runtime, based on different real-time data analysis.