Automatic device detection and activation with node.js