code: function history(device, from, to) {
      return api.request('/device/history?' + querystring.stringify({id: device.id || device, from: from, to: to}));
    }
docs: Returns device history
  @param device either {id: anId} or anId
  @param from timestamp in seconds
  @param to timestamp in seconds
  @returns {*} a Promise