added a database the keeps device status once every minuete