Presence detection

Hi all, I´m trying to get this project to work, but after weeks I´m tired searching on it. I want to use a Mega with an HM 10. I have a key tracker (Nut mini), this one is broadcasting his MAC-Adress as long as the battery keeps it alive.

I want to have an event, when Mega is recognizing the key trackers (BLE device).

Can anybody tell me how to do this?

Actual setting: 3.3V, RX -> 18, TX -> 19

#define baud 9600

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(baud);
  Serial1.begin(baud);
  
  at("AT"); // check if working, always returns OK
  at("AT+ROLE0"); // select master = central
  at("AT+RESET"); // actually more a restart than a reset .. needed after ROLE
  at("AT+SHOW1"); // include Bluetooth name in response
  at("AT+IMME1"); // "work immediately", not sure what this does
  //at("AT+DISI?");
  //at("AT+FILT0"); // show all BLE devices, not only HM ones
  //at("AT+JDDS=0");
  delay(1000); // wait a bit, NECESSARY!!
  Serial1.write("AT+DISC?");
  
}

void at(char* cmd) {
  Serial1.write(cmd);
  Serial.print(cmd);
  while(!Serial1.find("OK")) Serial.print(".");
  
  Serial.println(" .. OK");
}

void loop() // run over and over
{
  
  if (Serial1.available())
    Serial.write(Serial1.read());
    
  if (Serial.available())
    Serial1.write(Serial.read());   
}

Output:

AT .. OK
AT+ROLE0 .. OK
AT+RESET .. OK
AT+SHOW1 .. OK
AT+IMME1 .. OK
+Set:1

For the beginning I just want to see, if the Arduino can show me closeby devices...

Did you make any headway with this project? I find myself wanting to do the similar but am running into similar obstacles.