jshint recommended changes
var declarations combined
wip: using intervals to check N times if device is running