Text this: COSMOS: Collaborative, Seamless and Adaptive Sentinel for the Internet of Things